-2

Now I've been pulling my hair for two days over this one. I've tried everything. I've turned every stone, looked at every search result, and every Arduino Forums thread.

The problem is that Arduino IDE does not recognize the Arduino when connected to the PC, thus I can't upload compiled sketches. As usual, the serial port dropdown menu is greyed-out.

Things I have tried so far:

  1. Tried a different USB cable. Same results.
  2. Tried it on a Mac. It works flawlessly with different sketches.
  3. Looked at dmesg logs for Arduino when connecting. It connects to the PC successfully.
  4. Created a custom udev rule for it to be symlinked from /dev/bus/usb/001/00X to /dev/ttyACMX.
  5. Modified the custom udev rule for it to be symlinked from /dev/bus/usb/001/00X to /dev/ttyUSBX (since for some reason IDE was looking for ttyUSB0 first).
  6. Tried Arduino IDE from snap, apt, and from arduino.cc. All of them work the same.
  7. Tried different versions of AVR board packages from the Boards Manager, none of them work at all.
  8. Tried a NodeMCU (ESP8266), it works flawlessly.
  9. Tried Arduino Due, it works flawlessly.
  10. Added myself to dialout, uucp, and tty groups. Nothing changed.
  11. Changed permissions to a+rwx for all possible Arduino device file nodes.
  12. Changed group ownership to dialout, uucp, and tty for all possible Arduino device file nodes.
  13. Tried running Arduino IDEs as root. Nothing changed.
  14. Installed different firmware and libraries for linux (ex. libserialport0)
  15. Patched the apt version of Aruino IDE with patchelf.
  16. Updated.
  17. Rebooted.

"But hey man, why don't you just use the Mac to compile and upload the sketch, or any other MCU for that matter?" - Because I need to get output from my main PC and delegate it via serial to the Arduino. And Arduino Due is too clunky. And NodeMCU has disputable support for FastLED.

If any of you crazy mfs has an idea on how to solve this, I owe you a beer.

6
  • it may be a baud rate mismatch ... load a sketch that sends a known character at a known baud rate every 1/2 second, or so ... use a serial console, other than arduino IDE, to monitor the serial port
    – jsotola
    Commented Feb 10, 2022 at 18:44
  • 3
    When the Arduino is connected, are there any ttyACMX or ttyUSBX device files in /dev? If yes, please connect to them with a serial program (like cu -l /dev/ttyUSB0 -s 115200 on the commandline) and try to sends something. Is the RX LED lighting up a bit (will only be very shortly, but visible)?
    – chrisl
    Commented Feb 10, 2022 at 19:49
  • @jsotola The sketch can't send anything since I can't upload anything to the Arduino sadly :(
    – Tozzart
    Commented Feb 12, 2022 at 13:53
  • @chrisl There can be ttyACX/ttyUSBX since I created an udev rule to symlink the device once it connects. It is normally "mounted" at /dev/bus/usb/001/00X for some reason. I'll try the cu trick. Thank you very much!
    – Tozzart
    Commented Feb 12, 2022 at 13:54
  • @Tozzart you said that it works on a Mac ... use the Mac to load a test sketch
    – jsotola
    Commented Feb 12, 2022 at 17:09

2 Answers 2

1

After upgrading to Ubuntu 22.04 from 20.10, I could no longer upload anything to Arduino UNO boards. Issue was, the correct port was not listed in the Arduino IDE. All I had available as a port was ttyS0. It won't work with USB boards. I am using Arduino IDE 1.8.19, but I believe this is irrelevant to the issue.

After checking the logs :

sudo dmesg

I got this output:

usb 4-2: Product: USB2.0-Serial
ch341 4-2:1.0: ch341-uart converter detected
usb 4-2: ch341-uart converter now attached to ttyUSB0
input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input27
usb 4-2: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
ch341 4-2:1.0: device disconnected

So, my Arduino UNO boards all seem to be recognized as some braille tty device (!). Then braille support tries to establish dialog with the UNO board. This of course fails, resulting in a disconnection of the UNO board, causing removal of device /dev/ttyUSB0. This is the reason why it does not show up in the IDE.

The quick fix is to simply remove braille tty display devices support if you don't need it.

sudo apt remove -y brltty

This worked for me. Hopefully it works for you too.

The issue might be related to some udev rule installed with the package brltty. If I am not mistaken, udev rules are processed in alphabetical order. So it could be that some braille udev rule matches in first, causing the above mentioned scenario.

1
  • Thanks for specific details of dmesg. That helped out, because I had gone all through this and uninstalled brltty many months ago after upgrading to 22.04. However, today I tried connecting a Arduino Nano and I couldn't get it to be recognized. I discovered that brltty had been installed again. I ran the apt remove and arduino nano came up on ttyUSB0 just as it should. Because you showed dmesg I was able to compare to mine and see that it was the problem. 👍🏽
    – raddevus
    Commented Apr 17, 2023 at 15:29
0

I have experienced that with several new installs of the Linux OS. Try this:

Linux does not see board Run:

Type 'groups', is 'dialout' there ?

sudo usermod -a -G tty yourUserName

sudo usermod -a -G dialout yourUserName

Log off and log on again for the changes to take effect. https://playground.arduino.cc/Linux/All/#Permission sudo ln -s /usr/bin/python3 /usr/bin/python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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