Ubuntu Arduino ide 2 USB port not detected

I have downloaded Arduino IDE 2 as an image file and have been able to run it after following the advice at Can't Run AppImage on Ubuntu 22.04? Here's How to Fix it

The problem here is that Ubuntu 22.04 is missing the FUSE (Filesystem in Userspace) library. This FUSE library provides an interface for userspace programs to export a virtual filesystem to the Linux kernel.

After that I can select my board but NONE of the USB port are shown.
I relise it is probabley a Ubuntu setting but have not been able to get Arduino to reconise the port even though the port is shown when I us lsusb in the terminal window.

I have the same problem in the Arduino WEB editor, I have installed the AGENT file.

1 Like

Thanks for sharing the solution you found to the missing FUSE library dependency. The Arduino IDE developers are tracking the need to improve on this user experience in some way (either by avoiding the external dependency or else by documenting the installation procedure) here:

If you would like to do some troubleshooting, you can check whether the low level serial-discovery tool used by the Arduino development software to find ports is behaving and able to see the port of your board.

I'll provide the instructions here:

:exclamation: NOTE: These instructions will not solve the problem. They are only intended to possibly gather some more information about the problem, which might provide a clue that leads to a solution.

During all this, keep an eye out for anything that doesn't match the expected behavior as described at each step.

  1. Open a command line terminal.
  2. Run this command:
    ls ~/.arduino15/packages/builtin/tools/serial-discovery
    
  3. You will now see a list of the versions of serial-discovery which are installed on your computer. Take note of the highest version on the list (recent versions of Arduino IDE 2.x always use the newest one)
    For example, if you see output like this:
    1.2.2   1.3.0   1.3.0-rc1   1.3.1
    
    then the newest version is "1.3.1".
  4. Run the following command:
    ~/.arduino15/packages/builtin/tools/serial-discovery/<newest version>/serial-discovery
    
    (where <newest version> is the version number you found at step 3)
    serial-discovery will now start. There won't be any obvious sign of this other than that there is no longer a command prompt at the cursor in the terminal.
  5. Type the following command:
    HELLO 1 "arduino-cli 0.20.2"
    
  6. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "hello",
      "protocolVersion": 1,
      "message": "OK"
    }
    
  7. Unplug your Arduino board from your computer if you have it plugged in.
  8. Type the following command:
    START_SYNC
    
  9. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "start_sync",
      "message": "OK"
    }
    
    You might also see some additional objects in the output depending on which serial ports are available on your computer.
  10. Plug your Arduino board into your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "add",
      "port": {
        "address": "/dev/ttyACM0",
        "label": "/dev/ttyACM0",
        "protocol": "serial",
        "protocolLabel": "Serial Port (USB)",
        "properties": {
          "pid": "0x804e",
          "vid": "0x2341",
          "serialNumber": "EBEABFD6514D32364E202020FF10181E"
        }
      }
    }
    
    This is only an example of what you might see. The output will be different depending on the board you connected.
  11. Unplug your Arduino board from your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "remove",
      "port": {
        "address": "/dev/ttyACM0",
        "protocol": "serial"
      }
    }
    
    This is only an example of what you might see. The address field value should be the same as the "add" event you saw when you plugged the board in.

You should continue to see the same results if you repeat steps (10) and (11).

Once you are done with your experiments with the "serial-discovery" tool, follow these instructions to exit:

  1. Type the following command:
    STOP
    
  2. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "stop",
      "message": "OK"
    }
    
  3. Type the following command:
    QUIT
    
  4. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "quit",
      "message": "OK"
    }
    
    You should now be back at the shell command line.
1 Like

WOW finally have the USB port working in Ubuntu after issung the terminal command sudo chmod 777 and then rebooting the computer. This may not be the correct way to make the USB port work but it is good for me.

I'm glad to hear you were able to get it working. Thanks for taking the time to post an update.

Which file did you run that command on?

After downloading the .AppImage file (https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.0_Linux_64bit.AppImage), naviagte to the directory it is in with the terminal. (If you are in ~Home, and your file is in ~Home/Downloads/, type cd Downloads).
Then, run the command:
chmod +x arduino-ide_2.0.0_Linux_64bit.AppImage

(In the image, my file was in the Desktop directory)

Then right-click on the file and there should be a “Run as a program” option.

Thanks for your time,
Best_codes

In Arduino IDE 2.0 (using version 1.3.2 of the serial-discovery tool), I get "NO PORTS DISCOVERED". I already made sure my user is added to the dialout group, to no avail. Thanks to @ptillisch, the serial-discovery tool helped me in troubleshooting what exactly is happening, but not how to fix it.

Upon plugging in my device, it is discovered, but it is immediately after that also removed again (see below). Why is this happening? And how can I fix this?

{
  "eventType": "add",
  "port": {
    "address": "/dev/ttyUSB0",
    "label": "/dev/ttyUSB0",
    "protocol": "serial",
    "protocolLabel": "Serial Port (USB)",
    "properties": {
      "pid": "0x7523",
      "serialNumber": "",
      "vid": "0x1a86"
    }
  }
}
{
  "eventType": "remove",
  "port": {
    "address": "/dev/ttyUSB0",
    "protocol": "serial"
  }
}

Probably that
https://askubuntu.com/questions/1408192/can-not-connect-arduino-ide-with-arduino-board-on-ubuntu-22-04

1 Like

Hi nickon, I have exactly the same problem! Did you already fix it and how?

This is my discovery output:

{
  "eventType": "add",
  "port": {
    "address": "/dev/ttyACM0",
    "label": "/dev/ttyACM0",
    "protocol": "serial",
    "protocolLabel": "Serial Port (USB)",
    "properties": {
      "pid": "0x80c2",
      "serialNumber": "0",
      "vid": "0x303a"
    }
  }
}
{
  "eventType": "remove",
  "port": {
    "address": "/dev/ttyACM0",
    "protocol": "serial"
  }
}

ZX80's solution did not work

Hi @JeroenD. In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to run the dmesg command from the command line and share the output.

  1. Open a terminal.
  2. Disconnect the USB cable of your Arduino board to your computer.
  3. Connect the USB cable of your Arduino board to your computer.
  4. Type this command:
    dmesg | tail --lines=20
    
  5. Press Enter
  6. Click and drag the mouse to select all the output in the terminal window.
  7. Press Ctrl+Shift+C.
    This will copy the selected text to the clipboard.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the </> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the output is correctly formatted.
    Code block
  10. Press Ctrl+V.
    This will paste the output into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the Reply button to post the output.

Please let me know if you have any questions or problems while following those instructions.

Hi @ptillisch, thank you for your help! After two days of frustration I found a workaround. I also believe it is not an Arduino IDE issue. Fact is that I can not reproduce the erroneous state, maybe it is a combination of pressing buttons on the ESP32 s2 mini Lolin board (Aliexpress clone) or disconnecting the board at a bad moment? Maybe it has something to do with the boards USB chip? I do not know...

The facts are:

  • Ubuntu 20.04.5 LTS
  • Arduino IDE 2.0.0
  • Lolin ESP32 s2 mini board (clone)
  • 'Tools > USB CDC On Boot', 'USB DFU On Boot', 'USB Firmware MSC On Boot' are all enabled
  • In the Arduino IDE, in the blue bar, the board name is continuously alternating between "LOLIN S2 Mini" with and without the USB logo
  • In the serial-discovery tool the above output is continuously repeating
  • In the lsusb output the board is appearing and disappearing, depending on the exact moment of issuing the command

The latter bullet suggests that it is not an Arduino issue.

My work around:

  • Press and hold EN button, push RST button, release EN button to set the ESP32 into boot mode
  • A stable Port can be selected, in my case /dev/ttyACM0
  • Normally upload the code using the Arduino IDE (although the waiting time before uploading starts seems a little longer, 2-3 seconds?)
  • The esptool in the black windows gives the following information:
Leaving...
WARNING: ESP32-S2FNR2 chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
Failed uploading: uploading error: exit status 1
  • Close the Serial Monitor tab in the Arduino IDE
  • Press the ESP32 RST button
  • Reopen the Serial Monitor tab
    From now on the board can be flashed in the ordinary way and the Serial Monitor behaves as usual

As said, I can not reproduce the erroneous state at the moment. From my investigations I believe it has something to do with the Lolin ESP32 S2 board having a USB chip that also acts as a USB UART bridge? Maybe it has something to do with 'brltty' although the commands to disable brltty suggested on the internet did not help for me. I think it may also have something to do with the (boot) mode the ESP32 is, because of the workaround I am using.

Although I do not think it is an Arduino IDE issue, I do believe more people will encounter similar problems, because I see issues on this forum about ports and connections. Maybe the Arduino IDE can detect the state and solve it? Also your insights in the root cause of this problem are appreciated!

For completeness, this is my dmesg output (in the current, stable situation):

[11696.301186] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[11759.016909] usb 3-2: USB disconnect, device number 29
[11759.506442] usb 3-2: new full-speed USB device number 30 using xhci_hcd
[11759.690381] usb 3-2: New USB device found, idVendor=303a, idProduct=80c2, bcdDevice= 1.00
[11759.690394] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11759.690399] usb 3-2: Product: LOLIN-S2-MINI
[11759.690403] usb 3-2: Manufacturer: WEMOS.CC
[11759.690407] usb 3-2: SerialNumber: 0
[11759.731178] cdc_acm 3-2:1.1: ttyACM0: USB ACM device
[11761.428885] usb 3-2: USB disconnect, device number 30
[11770.861855] usb 3-2: new full-speed USB device number 31 using xhci_hcd
[11771.049080] usb 3-2: New USB device found, idVendor=303a, idProduct=80c2, bcdDevice= 1.00
[11771.049093] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11771.049098] usb 3-2: Product: LOLIN-S2-MINI
[11771.049102] usb 3-2: Manufacturer: WEMOS.CC
[11771.049105] usb 3-2: SerialNumber: 0
[11771.091402] cdc_acm 3-2:1.1: ttyACM0: USB ACM device
[12011.993402] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[12017.887794] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[12023.982796] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7

lsusb output in the stable situation:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 031: ID 303a:80c2 WEMOS.CC LOLIN-S2-MINI
Bus 003 Device 002: ID 0bda:0177 Realtek Semiconductor Corp. USB2.0-CRW
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:385a Realtek Semiconductor Corp. Bluetooth Radio
Bus 001 Device 002: ID 0408:5365 Quanta Computer, Inc. HP TrueVision HD Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Does it have one? I am not familiar with this board, but from a quick Google it appears it is just using the native USB capabilities of the ESP32-S2 chip.

Is this the board you have?

https://www.wemos.cc/en/latest/s2/s2_mini.html

Yes that board, or at least a copy of it. Maybe I am wrong about the chip, but I think I recall (because I can not reproduce I am not sure) that it appeared as different /dev/tty's, and not just a different number at the end. Any clues?

On a board that uses native USB to communicate with the computer, it might be that the specific sketch running on the board could produce this behavior of the port appearing and disappearing. I don't have any experience with the ESP-S2, but on a Leonardo or MKR board, examples of sketch code that would cause this is putting the microcontroller to sleep and then reawakening it, or disabling and reenabling interrupts over significant periods of time.

Did the problem of the board appearing and disappearing stop immediately when you did that?

I think you are spot on: I am writing a library involving a ISR that crashes the MCU, that must be the root cause of the issue!

I would suggest adding a Q&A about this topic: more people must have the same issues! Maybe even adding a list of boards MCUs with native USB communication and a solution suggestion how to get back to the "normal" situatiom.

Did the problem of the board appearing and disappearing stop immediately when you did that?

No, I close the Serial because sometimes the Serial is occupied by another process and uploading will fail in such case. The appearing and disappearing stopped right after putting the board in boot mode / flash mode, which is logical because at that time the program on the boards stops running and the bootloader takes over.

Thanks again for your help, shall I close the issue?

I think it is a good suggestion. It would be a valuable addition to the "Arduino Help Center" content. I see they do have an "If your board does not appear in the port menu" article, but this is not mentioned.

If you like, you can submit a formal request for the Arduino Support Team to add this information to the Help Center. Such requests can be made in the issue tracker:

https://github.com/arduino/help-center-content/issues

Or via the support contact form if you prefer:

https://www.arduino.cc/en/contact-us

Or better yet, you can contribute this information directly to the Help Center. There are instructions for that here:

OK, thanks for the info. I asked because the Serial Monitor does currently have an odd "polling" behavior that interacts with the board at 1 Hz. Your description of the port appearing and disappearing made me think of that behavior.

If you like. At the bottom of each reply to a topic you created, you will see a " Solution" control:

image

Find the post that contains the solution and click on " Solution". You will now see it change to the active state:

image

A checkmark will be shown next to the title in the topic listings. For example:

image

A preview of the solution will be added to the first post. For example:

image

Marking the solution is helpful because it allows those with the same question to more quickly find the answer, and allows the helpers on the forum to differentiate solved topics from the ones that still require their assistance.

Thanks!

Well mentioning that issue, I am not 100% sure, but I believe scrolling is sometimes enabled according to the monitor's button, but the text is not scrolling.

I made a quick github request to add the issue to the Q&A.

I do not have the 'solution' button.

I see. It is because you were not the creator of this topic. Only the creator has that button.

It shows remove automaticaly within 1 sec

`Preformatted text`{
  "eventType": "add",
  "port": {
    "address": "/dev/ttyUSB0",
    "label": "/dev/ttyUSB0",
    "protocol": "serial",
    "protocolLabel": "Serial Port (USB)",
    "properties": {
      "pid": "0x7523",
      "serialNumber": "",
      "vid": "0x1a86"
    }
  }
}
{
  "eventType": "remove",
  "port": {
    "address": "/dev/ttyUSB0",
    "protocol": "serial"
  }
}

Hi @reyalo. In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to run the dmesg command from the command line and share the output.

  1. Open a terminal.
  2. Disconnect the USB cable of your Arduino board to your computer.
  3. Connect the USB cable of your Arduino board to your computer.
  4. Type this command:
    dmesg | tail --lines=20
    
  5. Press Enter
  6. Click and drag the mouse to select all the output in the terminal window.
  7. Press Ctrl+Shift+C.
    This will copy the selected text to the clipboard.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the </> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the output is correctly formatted.
    Code block
  10. Press Ctrl+V.
    This will paste the output into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the Reply button to post the output.

Please let me know if you have any questions or problems while following those instructions.

1 Like

I too had the problem where /dev/ttyUSB0 was removed as soon as it was discovered.
Using dmesg I found that the remove action was due to the braille service:
[12199.459581] ch341 1-13.2:1.0: ch341-uart converter detected
[12199.460138] usb 1-13.2: ch341-uart converter now attached to ttyUSB0
[12199.470286] input: PC Speaker as /devices/platform/pcspkr/input/input28
[12199.976392] input: BRLTTY 6.5 Linux Screen Driver Keyboard as /devices/virtual/input/input29
[12200.096177] usb 1-13.2: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[12200.096778] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[12200.096788] ch341 1-13.2:1.0: device disconnected
[12997.418765] usb 1-13.2: USB disconnect, device number 12

I removed brltty: sudo apt remove brltty
Disconnected my nano and reconnected and /dev/ttyUSB0 was recognised as a port within the IDE