1

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.

5
  • If you run dmesg -w and then plug in your board, what new messages show on its output?
    – timemage
    Jan 5 at 2:11
  • /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. Enter groups in a shell and check if you are a member of the dialout group. If the user is not a member try sudo adduser $USER dialout. Perhaps the name of device has changed from ttyUSB0 to ttyUSBx. 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 Jan 5 at 14:17
  • These occurred to me also, but the way the question is worded makes it difficult to not answer it here or to not put questions in the answer. The thing about the device group-owner is that their board previously worked. So, presumably they are already in the dialout group. Otherwise it would make sense as an explanation for the permission error, though not the "No such file or directory" error.
    – timemage
    Jan 5 at 14:27
  • @timemage There plenty of other possibilities. I just named a few. I also was not correct with the ttyUSB file system entry the user attribute of the file is the user like 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. Jan 5 at 14:53
  • Yeah, I was hoping they'd come back and clarify some things. As it stands the theories I have would run on for 1000 words or so. Much it would probably be made irrelevant by some new nugget of information. Their first board is probably dead regardless.
    – timemage
    Jan 5 at 14:59
2

The fact that you're referencing ttyUSB0 tells me you have cheap Chinese clones and not genuine Ardunios. These are usually based around the CH340 USB interface chip which is notoriously unreliable.

Your UNO is dead.

My supposition is that plugging it in cripples the CH340 driver. Any other boards that you subsequently plug in can not be recognised because the driver is in a bad state.

To prove this:

  1. Unplug the UNO
  2. Reboot (power cycle) the computer
  3. Plug in the Nano

It should recognise the Nano fine.

  1. Unplug the Nano
  2. Plug in the UNO

It should fail now.

  1. Unplug the UNO
  2. Plug in the Nano

The Nano should now also fail.

If that sequence is correct then the Uno is definitely dead. Throw it away, or at least never plug it in through USB ever again (you could program over serial through the TX/RX pins or using ICSP as if it were a breadboard Arduino though).

4
  • The fact im referencing ttyUSB0 tells you i'm using Linux. The UNO is genuine direct from Arduino even got the gold SMT fuse. My UNO isnt dead its running fine now I have fixed the permissions. Thanks though.
    – dogfood
    Jan 7 at 14:43
  • @dogfood Genuine Arduinos use /dev/ttyACM0 not /dev/ttyUSB0. Unless it's a very old Arduino UNO (Rev 1) based on the FT232...
    – Majenko
    Jan 7 at 14:48
  • its r2 the USB interface is an atmega 8u2, be over a decade old by now (im not in the habit of dragging wires randomly across PCBs haha)
    – dogfood
    Jan 7 at 15:05
  • @dogfood I too have the R2. The 8u2 identifies as /dev/ttyACM0 not /dev/ttyUSB0.
    – Majenko
    Jan 7 at 15:05
1

running:

sudo usermod -a -G dialout $USER

cleared the issue it was the first time I have used that machine with an Aduino not sure how it was running before with out permissions set up correctly or why it failed when I dropped that 5v, I assume that just reset the board and when it tried to reconnect it failed. Both board and PC all working fine, phew.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.