Fatal error occurred with esptool.py after erase_flash
Closed this issue · 7 comments
I just received my Badgy. I installed a LIR2450 battery, started it up, and played with the defaults. The screen responded to the button and joystick.
I wanted to install MicroPython right away so I followed instructions to get esptool.py for my Mac running macOS 10.14.6. I also installed the SIL USB driver.
I was able to get the “erase_flash” command to work.
esptool.py v2.7
Found 5 serial ports
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 84:f3:eb:84:64:fc
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 7.1s
Hard resetting via RTS pin...
After that, all of my attempts to do anything — erase_flash or write_flash — with esptool.py have failed.
esptool.py v2.7
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header
I have tried turning the Badgy off, holding the button down while turning it on, and other tips/tricks I’ve come across in the issues. I’ve tried various baud rates, all the way down to 9600.
Other notes:
- The screen does not flash when I turn the Badgy on
- The screen is stuck on the last thing I did (“You pressed the right button!”), which is now taunting me
- The charging LED comes on when I plug into USB on my computer, but I’ve seen it both bright and dim
- An LED next to the ESP-12F flashes immediately after turning the Badgy on but is off in an instant
- update: I saw the device’s Wi-Fi network initially, but no longer see it
Can you upload a sketch via Arduino IDE like a "classic" ESP8266 project? i.e. not using Micropython or ESPtool?
I’ll see if I can figure out how to do that and try. Thanks!
I don’t know if I did this correctly, but I tried File > Examples > 01.Basics > Blink. I clicked the Upload button, it compiled, it tried to upload with esptool.py (2.6, which looks like it’s in the app bundle for the Arduino app), and got the same error.
No, you will need to install the ESP8266 boards with the Arduino Board Manager. It's quite a lengthy process....
I'm not a Python man, so can't advise much further, sorry.
I did get the Badgy to flash with badgy.bin and a MicroPython .bin file. The badgy.bin one doesn’t seem to return the unit to starting up in the default state, so I don’t know if that’s what it’s supposed to do. The MicroPython .bin just made the ESP8266 LED blink blue very fast, which I gather is not a good thing. I think it may be the first time I saw that LED.
My other LED does appear to have various states. It gets the brightest when my LIR2450 is installed and the Badgy is plugged into USB. I’m not sure the LIR2450 I got is charged or charging.
I figured out that examples/hello.bin returned the Badgy to its default state.
I was able to install the various .bin files by using an Ubuntu VM with my Mac’s USB UART interface mapped to the guest OS. Esptool.py worked there, and I think it did so with every attempt I made. It did not seem to matter how I started up the Badgy or what buttons I pushed when.
I don’t know what’s up with doing the same thing directly from macOS. I’m good for now. If anyone comes across this and has a solution for flashing from macOS, let me know! :)