Skip to content

Instantly share code, notes, and snippets.

@jaindinkar
Forked from DrSensor/esptool.md
Last active April 24, 2022 02:57
Show Gist options
  • Save jaindinkar/31f683823cdc5f26e353d88c5fcd55d9 to your computer and use it in GitHub Desktop.
Save jaindinkar/31f683823cdc5f26e353d88c5fcd55d9 to your computer and use it in GitHub Desktop.
ESP Troubleshooting 101
$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 84:f3:eb:0b:dd:53
Uploading stub...
Running stub...
Stub running...
Chip ID: 0x000bdd53
Hard resetting via RTS pin...

TroubleShooting

Permission denied

$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
/dev/ttyUSB0 failed to connect: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'

A fatal error occurred: All of the 1 available serial ports could not connect to a Espressif device.

Solution (choose only one of this):

  • sudo chmod 666 /dev/ttyUSB0
  • set an UDEV rule to permanently allow the access
  • add $USER to dialout group

Device or resource busy

$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
/dev/ttyUSB0 failed to connect: [Errno 16] could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: '/dev/ttyUSB0'

A fatal error occurred: All of the 1 available serial ports could not connect to a Espressif device.

Solution:

  1. Gather some infos which process/app use that Serial port. For example:
$ lsof /dev/ttyUSB0
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
screen  21416 wildan    5u   CHR  188,0      0t0  499 /dev/ttyUSB0
  1. Kill that process/command: killall screen

ESP32 - No serial data received

$ esptool.py chip_id
esptool.py v3.2
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting......................................
/dev/ttyUSB0 failed to connect: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://github.com/espressif/esptool#troubleshooting

Solution:

  1. Press download button on the ESP32 generic module. (Some modules have this problem, you have to manually put them to boot mode. Another thing you can do if this problem persists to add a capacitor b/w rst pin and ground (Explaination below).
  2. Link to solution: Reddit Link

ESP32 - Wrong boot mode detected (0x13)!

$ esptool.py chip_id
esptool.py v3.2
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting......................................
/dev/ttyUSB0 failed to connect: Failed to connect to Espressif device: Wrong boot mode detected (0x13)! The chip needs to be in download mode.
For troubleshooting steps visit: https://github.com/espressif/esptool#troubleshooting

A fatal error occurred: Could not connect to an Espressif device on any of the 1 available serial ports.

Solution:

Observation: This usually happens with new boards which doesn't have micropython preinstalled.

  1. Press download button on the ESP32 generic module. (Some modules have this problem, you have to manually put them to boot mode. Another thing you can do if this problem persists to add a capacitor b/w rst pin and ground (Explaination below).
  2. Link to solution: Reddit Link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment