logo elektroda
logo elektroda
X
logo elektroda

[Solved] Arduino IDE does not see the /dev/ttyS0 port. It cannot see the ESP32 device, there is no way to upl

CC_PL 5745 15
Best answers

Why does Arduino IDE only see /dev/ttyS0 and fail to upload to an ESP32, and how can I make the board appear as a usable serial port?

Arduino IDE should use the ESP32’s USB-serial port as /dev/ttyUSB0, not /dev/ttyS0; if /dev/ttyUSB0 appears and disappears, the problem is likely with the USB connection rather than the IDE itself [#20512593][#20512674] The most likely fixes are to try a different USB cable, preferably a shorter one, and use a USB port with enough current, because the board may be losing power or communication over the link [#20512617][#20512681] In this case, replacing the cable solved the problem and the board started working normally again [#20518044]
Generated by the language model.
ADVERTISEMENT
Treść zostaĹ‚a przetĹ‚umaczona polish » english Zobacz oryginalnÄ… wersjÄ™ tematu
  • #1 20512534
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    The Arduino IDE cannot see my device and claims that the only port that is selectable does not exist...

    Quote:

    Global variables use 38540 bytes (11%) of dynamic memory, leaving 289140 bytes for local variables. Maximum is 327680 bytes.
    python3 /home/cc/snap/arduino/85/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py --chip esp32 --port /dev/ttyS0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 /tmp/arduino_build_570467/SimpleBleDevice.ino.bootloader.bin 0x8000 /tmp/arduino_build_570467/SimpleBleDevice.ino.partitions.bin 0xe000 /home/cc/snap/arduino/85/.arduino15/packages/esp32/hardware/esp32/2.0.7/tools/partitions/boot_app0.bin 0x10000 /tmp/arduino_build_570467/SimpleBleDevice.ino.bin
    esptool.py v4.5.1
    Serial port /dev/ttyS0

    A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist
    A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist


    In the Arduino IDE the project passes the check ("Verify") and compiles, but the Arduino IDE throws errors about a connection problem / does not find such a port as /dev/ttyS0. Only this port is seen in the list in the IDE, I have no other choice.

    I have Arduino IDE 1.8.19 (installed with SNAP from Ubuntu Software) and Ubuntu 22.

    How do I remedy this? Thanks for your help!

    Command:

    ls -l /dev/ttyS0

    yields:

    crw-rw-rw- 1 root dialout 4, 64 Mar 2 13:58 /dev/ttyS0 .
  • ADVERTISEMENT
  • Helpful post
    #2 20512593
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 20512615
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    Yes, you are definitely right! In ArduinoIDE, the /dev/ttyUSB0 port shows up and disappears. I don't know why. I managed to upload the soft to the ESP32 3 times and then it disappears, sometimes it appears, disappears,.... /dev/ttyUSB0. What could this be caused by? I have a metre USB cable with filter, a fairly good quality cable (for the phone charger).
  • #4 20512617
    Anonymous
    Level 1  
  • #5 20512636
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    I'll make sure to get a shorter cable.

    What are the correct next steps after showing up in IDE (after flashing):

    Quote:


    Leaving....
    Hard resetting via RTS pin...



    Remove and re-insert USB? I tried resetting, but something doesn't work (in any case, the Arduino IDE doesn't detect that I'm resetting the board). And I would like to receive messages / information from the serial of the board.

  • ADVERTISEMENT
  • Helpful post
    #6 20512661
    Anonymous
    Level 1  
  • #7 20512674
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    The reset button has, so does the BOOT. But the Arduino IDE does not respond to reset, the board yes resets (after pressing the button). This is DEVKiT- ESP32-2432S035.

    The problem with the port has returned - the USB port disappears. I'm already trying with the third cable :) I'm giving shorter and shorter cables, but the port is not visible at the moment.

    lsusb dumps:

    Quote:
    Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 003: ID 046d:c315 Logitech, Inc. Classic Keyboard 200
    Bus 003 Device 002: ID 275d:0ba6 USB OPTICAL MOUSE
    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 002: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH D50s
    Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics CH340 serial converter
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    .
  • Helpful post
    #8 20512681
    Anonymous
    Level 1  
  • #9 20512690
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    Yes I have 115200 in the IDE and in the code. The USB port has moved after being plugged into another USB socket. Hopefully for longer :) .
  • ADVERTISEMENT
  • #10 20516508
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    I have changed the cables, the third shortest one seems to be OK. I can burn the program to a disc, but I have no communication with the disc after the serial. I.e. after uploading the software I get the message:

    Quote:

    Leaving....
    Hard resetting via RTS pin...


    and that's where the fun ends. The board does not automatically reset, as a result I have no access to the data sent over the serial.
  • #11 20516520
    Anonymous
    Level 1  
  • #12 20516545
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    I work with the same one all the time: ESP32-2432S035, this is an extended Dev Kit with touchscreen display based on ESP-WROOM-32.

    Soft are examples from the Arduino IDE and my own apps. They work - I have this confirmed via another channel. Specifically, I send information via BLE and receive on the phone. Everything works as expected. So flashing works

    On the other hand, I can't talk to the board over serial.
  • #13 20516563
    Anonymous
    Level 1  
  • #14 20516611
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    I will attach the schematic soon. However, I also have RESET and BOOT buttons on it. It's just that resetting it doesn't have the desired effect. The Arduino IDE doesn't seem to know about it (?).

    I will find the schematic and upload it.
  • #15 20516902
    Anonymous
    Level 1  
  • #16 20518044
    CC_PL
    Level 13  
    Posts: 497
    Help: 4
    Rate: 57
    Thank you for your help and guidance!

    Another cable replacement helped 🙂 Now everything works as it should.

Topic summary

✨ The discussion revolves around issues with the Arduino IDE not recognizing the ESP32 device on the /dev/ttyS0 port, with users experiencing intermittent visibility of the /dev/ttyUSB0 port. The author has tried multiple USB cables, including shorter ones, but continues to face connection problems. Suggestions include checking for power issues, ensuring the correct baud rate in both the IDE and code, and verifying the board's autoreset capability. The author confirms the use of the ESP32-2432S035 model and mentions successful flashing of programs but struggles with serial communication post-upload. Ultimately, a cable replacement resolved the issue.
Generated by the language model.

FAQ

TL;DR: Compile succeeded (11% memory used), but upload failed with "A fatal error occurred: Could not open /dev/ttyS0". This points to a wrong or unstable serial port on Ubuntu. Use the guidance below to select the correct USB device and stabilize the connection. [Elektroda, CC_PL, post #20512534]

Why it matters: Linux Arduino IDE users can quickly fix ESP32 upload/serial issues without chasing drivers or reinstalling tools.

Quick Facts

Why does Arduino IDE only show /dev/ttyS0 and fail to open it?

/dev/ttyS0 is a built‑in serial port, not the USB‑to‑UART used by ESP32. If the IDE lists only /dev/ttyS0, the board’s USB device did not enumerate as /dev/ttyUSBx. Check your USB cable and try another USB port. Once the USB interface comes up, select /dev/ttyUSB0 in Tools → Port. [Elektroda, khoam, post #20512593]

My ESP32 port appears as /dev/ttyUSB0 then disappears. How do I fix it fast?

Intermittent ports are often a cable issue. "Would suggest trying with a different USB cable to start with. Maybe even a shorter one." Use a data‑capable, short cable and avoid front‑panel ports. How‑To:
  1. Swap to a short, known‑good data USB cable.
  2. Try a different USB socket on the PC.
  3. Reopen Serial Monitor after reconnecting. These steps usually stabilize /dev/ttyUSB0. [Elektroda, khoam, post #20512617]

Is this a USB power issue from my PC port?

Yes. Weak USB ports cause brownouts and disconnects during upload or when Wi‑Fi/BLE starts. Symptoms include a port that flaps and failed uploads. Try another USB socket or a powered hub. Keep Serial.begin() and the Serial Monitor baud in sync, but note that power problems can still break communication. [Elektroda, khoam, post #20512681]

After upload says "Hard resetting via RTS pin..." but nothing happens—what now?

That message means esptool toggled RTS/DTR to reset. Some boards don’t auto‑start afterward. Press RESET, or hold BOOT while pressing RESET if required by your board, then release. Open the Serial Monitor to view startup logs. If your board lacks proper autoreset wiring, manual RESET/BOOT is expected. [Elektroda, CC_PL, post #20516508]

Why doesn’t Arduino IDE react when I press RESET on the board?

The IDE doesn’t detect reset events; it only opens the serial port for logs. To see output after pressing RESET, keep the Serial Monitor open or reopen it immediately. This ensures you capture boot messages and confirms the board restarted correctly. [Elektroda, khoam, post #20516902]

Do baud rates need to match? What baud should I use on ESP32?

Yes. Set Serial.begin(115200) in your sketch and match 115200 in the Serial Monitor. Mismatched rates produce unreadable output. In this case, both code and monitor used 115200 and communication worked once the USB connection was stable. 115200 is a common default for ESP32 logging. [Elektroda, CC_PL, post #20512690]

Which USB-to-UART chip is on this board, and what should lsusb show?

This board uses a CH340 USB‑to‑serial converter. lsusb shows it as “QinHeng Electronics CH340” with VID:PID 1a86:7523. When present, the kernel creates a device like /dev/ttyUSB0. Select that port in Arduino IDE before uploading or opening the Serial Monitor. [Elektroda, CC_PL, post #20512674]

My ESP32-2432S035 doesn’t auto-reset like Espressif’s DevKit. Why?

Its reset wiring differs from the official Espressif DevKit. DTR/RTS autoreset may not be implemented the same. Use the board’s BOOT and RESET buttons when needed. As one expert noted, "This board has little to do with the official DevKit." [Elektroda, khoam, post #20516563]

How can I verify Linux permissions to access /dev/ttyUSB0?

Ensure your user belongs to the dialout group. Run: sudo usermod -a -G dialout $USER, then log out and back in. Without dialout membership, the IDE may not open the serial device. After re-login, verify the port appears and select it in Tools → Port. [Arduino, 2023]

Can charge-only USB cables cause 'no port' or upload failures?

Yes. Charge-only cables power the board but lack data lines, so no /dev/ttyUSBx device appears. Always use a data-capable USB cable. Swapping to a known-good data cable is a common and effective fix for missing or unstable serial ports. [Arduino, 2023]

What does 'crw-rw-rw- ... root dialout ... /dev/ttyS0' tell me?

That output shows a character device with read/write permissions and the dialout group owner. However, /dev/ttyS0 is a legacy serial port, not your ESP32’s USB interface. Focus on detecting and selecting /dev/ttyUSB0 for ESP32 communication. [Elektroda, CC_PL, post #20512534]

How much current can a USB 2.0 port supply, and does that affect ESP32 boards?

USB 2.0 ports supply up to 500 mA. ESP32 boards with Wi‑Fi/BLE can draw significant bursts. Marginal ports or long cables can cause voltage drops and disconnects. If the port flaps or uploads fail, use a rear motherboard port or a powered USB hub for stability. [USB – Wikipedia]
Generated by the language model.
ADVERTISEMENT