Every once in a while, my Raspberry Pi 4B when running Arduino IDE will lose the port the board is connected to. I usually reboot and the correct serial port appears in the Arduino IDE.
for example, the board is always attached to the /dev/ttyACM1. When I get into trouble the IDE does not 'see' any port but the /dev/ttyACM0 port.
How can I check the status of the serial ports? Can I reset them from the shell?
Any help would be appreciated. A link to a good serial (really usb) Debian resource for basic troubleshooting would be helpful as well.
Roger
- DougieLawson
- Posts: 40788
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: help with disappearing serial port
They're assigned when the kernel detects the device. The only way to change a device is to disconnect (so the kernel forgets it) and re-attach it. Or if the device isn't powered from the USB connection to power cycle it.
There are no controls for this that you can use to get the kernel to forget a device unless you can for the kernel to unload the active device driver (with sudo rmmod ...; sudo modprobe ...).
There are no controls for this that you can use to get the kernel to forget a device unless you can for the kernel to unload the active device driver (with sudo rmmod ...; sudo modprobe ...).
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
-
- Posts: 2865
- Joined: Sat Aug 18, 2012 2:33 pm
Re: help with disappearing serial port
Code: Select all
udevadm info -a -p /sys/class/tty/ttyUSB0 | less
in my case:
Code: Select all
ATTRS{interface}=="FT232R USB UART"
Re: help with disappearing serial port
I ran the command:
udevadm info -a -p /sys/class/tty/ttyACM1 | less
and it said no such device,
I ran:
udevadm info -a -p /sys/class/tty/ttyACM0 | less
and it gave me a long report. Why has ACM1 disappeared? This was run after a fresh reboot.
Roger
udevadm info -a -p /sys/class/tty/ttyACM1 | less
and it said no such device,
I ran:
udevadm info -a -p /sys/class/tty/ttyACM0 | less
and it gave me a long report. Why has ACM1 disappeared? This was run after a fresh reboot.
Roger
-
- Posts: 2865
- Joined: Sat Aug 18, 2012 2:33 pm
Re: help with disappearing serial port
linux assigns ports starting at number 0
if 0 is still in-use when you plug the device in, then it becomes 1 instead
if 0 is still in-use when you plug the device in, then it becomes 1 instead