The ESP8266 uses some of the pins as 'boot mode' pins so on boot they must be set to certain values:
- CH_PD (EN) should be always pulled high (it will disable the entire module if low)
- RST should be always pulled high (it will disable the entire module if low)
- GPIO 0 sets whether the bootloader is active, it must be pulled HIGH during power up/reset for the user program to run. If its pulled LOW, it will activate the bootloader. The built-in red LED on #0 pulls it up
- GPIO 2 must be pulled high on power up/reset.
- GPIO 15 must be pulled low on power up/reset.
The most common reason for crashes is power failure. Make sure you're powering the Huzzah with a good ~5V power supply, and if you're using a USB-Serial cable, that its plugged into the mainboard of your computer or through a powered hub!
Don't forget to install the CP2104 VCP drivers for your computer, they are required!
If your error message looks like this:
fork/exec /Users/xxxxxxx/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++: no such file or directory
To fix this problem, do this:
- Open the Boards Manager in the Arduino IDE
- Uninstall the ESP8266 support
- go to your ~LIbrary folder (in the Finder, select "Go::Go to folder:, and enter ~Library ). Find the folder Arduino15.
- In the Arduino15 folder, go into packages, and delete the folder esp8266
- Go back to the Arduino IDE, and install ESP8266 board support.
- Now go back to the Finder, and check that you have the xtensa-lx106-elf-g++ file in the path Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++
- That's it!
This is the ROM debug messages, its transmitted at 74880 baud so you rarely see it in proper 'ascii output' - instead usually it gets corrupted into a bunch of strange characters.
Make sure you're using a good quality USB/Serial cable. Install the official drivers for that cable too! We've also noticed that PL2303-based cables don't work on Macs for some reason. FTDI or CP210x based chipsets work best
Sometimes, it helps to switch the board type to "Generic ESP8266 Module". Set the Reset Method to "nodemcu"
See this forum post
You say your led is stuck on dim and you get an error trying to upload? And you're sure your serial cable is connected and working correctly? Well, here's a potential fix: Connect the GPIO0 pin to GND through a 220 ohm resistor. Leave it connected while you upload. You may have to try it a couple of times, but it should eventually upload and get the HUZZAH unstuck from bootload mode! You can then remove the resistor connection, and your HUZZAH will be happy ever after!
(Note: you may also have to tie RST and EN (CH_PD) together to get this to work. Remove the connection once you have the module programmed).
Thanks to forum user misslevania for the tip!
Make sure your terminal software is sending correct line endings! The default PuTTY settings may be wrong when trying to talk to Lua on an ESP8266. Lua expects CRLF "\r\n" line endings, and apparently PuTTY defaults to just LF "\n"!