I am currently facing an issue with an ESP32 Developer Board and two Sonoff Basic modules. Some time ago, these were flashed with ESPHome via Home Assistant. Unfortunately, they disappeared from Home Assistant and were neither listed among the devices nor in the add-on sidebar.
After some updates and backups, the devices reappeared. Unfortunately, I did not note down the encryption code. I was able to find the YAML files for two devices in the File Editor under the ESP folder and copy the code. These are now back in Home Assistant, but unfortunately not in the add-on where you can edit the YAML files, but only under devices.
Now, I wanted to simply reflash the devices and proceeded as follows:
I created a new device in Home Assistant.
I opened the ESP web page.
I connected an FTDI adapter to the Sonoff or ESP Developer Board via USB to my laptop.
An audible signal was played, but an error message also appeared: āThis device has been stopped because it has reported errors. (Code 43) Error with a request of the USB device descriptor.ā
Consequently, the devices were also not found under āConnect.ā
Does anyone have any advice on how I can reflash and correctly use my devices?
This error used to appear when thereās something wrong with USB uart adapter (or usb chip). Either wrong drivers, bad connection (damaged cable, damaged usb connectorā¦) or, some time ago these errors also appeared when Chinese fake USB chips were connected to windows and consequently driver was disabled. Ok, bad USB chip is also an option, although not likely.
Try to remove/reinstall usb driver, or use another computer (if you have one). If you have another usb uart device also try with that one (note thatās very advisable to have more than 1 usb - uart adapter anyway).
āEsp32 Developer boardā is really vague and knowing which one out of the dozens of developer boards would be useful as they dont all use the same procedure to enter boot mode.
Problems like this, just start doing a process of elimination.
Test flashing a new board to see if its your esp32 itself or something ellse.
Make sure youāre using a data USB cord and not a power only USB.
Go to Google and search for āyour specific dev board + boot modeā. Find the boot mode instructions for your specific dev board and not vague āEsp32 dev boardā
after experiencing difficulties flashing Sonoff devices or similar, I tried different cables and FTDI adapters, but that didnāt solve the problem. It wasnāt until my wife asked if I had replaced both that I realized both the cable and the FTDI adapter could be damaged. After replacing them, flashing these devices works perfectly again.
Unfortunately, Iām still having trouble flashing the ESP32 DEVKIT V1. Even after attempting to connect it directly to the Home Assistant computer with an FTDI and flash it, I still receive error messages. Hereās an excerpt from the log I received:
INFO ESPHome 2024.4.2
INFO Reading configuration /config/esphome/esp32-devkit-v1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-devkit-v1 (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.3
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
RAM: [= ] 12.4% (used 40528 bytes from 327680 bytes)
Flash: [==== ] 44.3% (used 812193 bytes from 1835008 bytes)
========================= [SUCCESS] Took 3.24 seconds =========================
INFO Successfully compiled program.
esptool.py v4.7.0
Serial port /dev/ttyUSB1
Connecting......................................
ERROR Running command failed: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/ttyUSB1 --chip esp32 write_flash -z --flash_size detect 0x10000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/firmware.bin 0x1000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/bootloader.bin 0x8000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/partitions.bin 0xe000 /data/cache/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
esptool.py v4.7.0
Serial port /dev/ttyUSB1
Connecting......................................
ERROR Running command failed: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyUSB1 --chip esp32 write_flash -z --flash_size detect 0x10000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/firmware.bin 0x1000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/bootloader.bin 0x8000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/partitions.bin 0xe000 /data/cache/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.
Perhaps someone else has experienced similar issues or can glean from the log excerpt what the problem might be. Any advice would be greatly appreciated!
A little late to the party, but two things to try if your board is still not flashable:
The command and options suggested in the log you posted
Lower your baud rate
I think it is unlikely that you have reached the limit of rewrites for your deviceās flash memory, unless you had a write-intensive configuration in place. That would be something to keep in mind for the replacement device.
If you created your own yaml files, change the log level to a āproductionā level, less intensive and verbose than debug and reduce the number of events that are logged. During development you want to know every time a pin changed, but once you have a stable device, that is usually not of interest anymore.