I have an ESP32-WROM-32 board*, and I have installed a sketch on it in the past. In fact, the sketch is running when I connect power through the USB cable and I see the output of the sketch in both the Arduino v 2.3.4 serial monitor connected to /dev/ttyUSB0 (ESP32 Dev Module) and a separate terminal window connected to /dev/ttyUSB0.
However, when I try to upload a new sketch using the Arduino IDE, the sketch compiles without any errors but I get the following error message:
Sketch uses 332834 bytes (25%) of program storage space. Maximum is 1310720 bytes.
Global variables use 22052 bytes (6%) of dynamic memory, leaving 305628 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port /dev/ttyUSB0
Connecting......................................
A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Failed uploading: uploading error: exit status 2
Based on similar problems on this forum, I have tried the following without any success:
- Holding the 'reset' button (only button on the board) down while the Arduino IDE tries to connect
- Verified that I am part of the dialout group on my PC
- Verified that the dialout group has rw permissions for /dev/ttyUSB0
- Swapped out the USB cable - I have used both cables in the past
How can I get the new sketch to download?
*The actual board is "HiLetgo ESP32 ESP-32 ESP-32S ESP32S WiFi Bluetooth Wireless Board Module Based ESP32 Dual Core Mode CPU" from Amazon.