I'm making a GUI in Python that will control an Arduino via serial monitor. I have 6 input pins grounded and I'm taking 5V from the board (powered from USB) whilst serial monitoring and everything's going beautifully.
I'm so impressed by all these flickering 0's and 1's that I drop my flying lead straight onto the tiny cap behind the USB connector on the UNO. Everything is definitely not going beautifully now. My serial data is frozen mid-string.
I try to connect again with my serial monitor software:
Error: Could not open device /dev/ttyUSB0
Power off and on my PC and the Arduino, same result. So, I connect another board a nano this time.
The Arduino Web Editor recognizes that I have connected a Nano, but when I try to upload my code the Arduino Web Editor says this:
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
So, I put this in to terminal:
sudo chmod a+rw /dev/ttyACM0
chmod: cannot access '/dev/ttyACM0': No such file or directory
sudo chmod a+rw /dev/ttyusb0
chmod: cannot access '/dev/ttyusb0': No such file or directory
Thought I might have fried my USB but it's still accepting flash drives being plugged in, and I have connected to both front and back USBs with the same results. And I have power-cycled my PC.
So, not sure if I fried my Arduino, (but having 2 Arduinos with the same fault seems unlikely, especially as one was not attached when I dropped the flying lead).
Magic smoke escaped from my PC USB ports, but again it seems unlikely that front and back would be dead whilst allowing USB sticks to communicate.
Is there some kind of software fusing preventing communication that needs to be/can be reset? Or could something have become corrupted maybe?
I'm on Ubuntu 20. If anyone knows of a command I can give that will bring ttyusb0 back to life, that would be great.
dmesg -w
and then plug in your board, what new messages show on its output?/dev/ttyUSB0
is not the same as/dev/ttyusb0
. Take care of the error messages:cannot access '/dev/ttyusb0': No such file or directory
. Did you change the users group settings. Entergroups
in a shell and check if you are a member of thedialout
group. If the user is not a member trysudo adduser $USER dialout
. Perhaps the name of device has changed fromttyUSB0
tottyUSBx
.ls -l /dev/tty*
lists all devices. Make also sure that the group for device file is dialout. e.g.crw-rw---- 1 root dialout 4, 73 Jan 5 11:02 /dev/ttyUSB1
crw-rw---- 1 pkiefer dialout 188, 0 Jan 5 15:42 /dev/ttyUSB0
. So I assume that is controlled by the automatic device creation when the USB/Serial adapter is plugged in. Reconfiguration should be cleared with a reconnect. My fault, sorry.