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