ESP8266 - any experience?

The Rocketry Forum

Help Support The Rocketry Forum:

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
Not entirely rocket related, but hoping for some advice. I have been playing with Arduino for a few years, and have built some fun and useful projects. My latest effort is to get into the IoT realm, and I've hit a bit of a wall. The forums for this are not being the most helpful since much of it is over my head. I bought a NodeMCU knock-off from eBay, and got my sketch loaded and working fine (it's reading temp and humidity and posting it over WiFi to a website). I wanted to trim this down to a smaller package, so I also bought the standalone ESP8266-12e modules. This is the same as what's on the NodeMCU, minus the FTDI and powersupply circuitry. My trouble is that I can't get the sketch to load on the standalone module (I'm using the Arduino IDE)- I've got the proper 3.3v, and I've tried two different FTDI boards, and nothing...
Pinout is:
GPIO0 and GPIO15 - Low
EN - High
Tx to Rx
Rx to Tx
Vcc and Gnd to 3.3 and gnd.
RST to ground via switch, and also tried RTC on my UART.

I know eggtimer Quantum uses this WiFi MCU, but didn't want to bug Cris directly since this isn't his product, but maybe he or someone with similar experience will take pity ?
 

ttabbal

Well-Known Member
Joined
Jan 19, 2009
Messages
1,082
Reaction score
22
I can't remember which one it is, but you need to tie a pin high or low for programming mode.
 

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
I believe you're correct, but have done that and still nothing!
 

ttabbal

Well-Known Member
Joined
Jan 19, 2009
Messages
1,082
Reaction score
22
Are the modules on a breakout board? I suppose something could be set up wrong on the board. I have a couple modules that use a simple breakout board that just brings all the pins out.

If you load a terminal program and watch while it boots, you should get some data from the module. Anything at all? You are certain that your FTDI boards are 3.3v IO? 5v might damage the chip, even on the data lines.
 

cerving

Owner, Eggtimer Rocketry
TRF Sponsor
TRF Supporter
Joined
Feb 3, 2012
Messages
4,366
Reaction score
1,742
Not entirely rocket related, but hoping for some advice. I have been playing with Arduino for a few years, and have built some fun and useful projects. My latest effort is to get into the IoT realm, and I've hit a bit of a wall. The forums for this are not being the most helpful since much of it is over my head. I bought a NodeMCU knock-off from eBay, and got my sketch loaded and working fine (it's reading temp and humidity and posting it over WiFi to a website). I wanted to trim this down to a smaller package, so I also bought the standalone ESP8266-12e modules. This is the same as what's on the NodeMCU, minus the FTDI and powersupply circuitry. My trouble is that I can't get the sketch to load on the standalone module (I'm using the Arduino IDE)- I've got the proper 3.3v, and I've tried two different FTDI boards, and nothing...
Pinout is:
GPIO0 and GPIO15 - Low
EN - High
Tx to Rx
Rx to Tx
Vcc and Gnd to 3.3 and gnd.
RST to ground via switch, and also tried RTC on my UART.

I know eggtimer Quantum uses this WiFi MCU, but didn't want to bug Cris directly since this isn't his product, but maybe he or someone with similar experience will take pity ?
GPIO0 (*PGM) and GPIO2 need to be pulled HIGH through a resistor (10K works fine) in order to boot from the flash. To put it into the bootloader mode, you need to pull GPIO0 down to GND at power-up. Google "ESP8266 arduino", there are some excellent forums out there on the ESP8266.

P.S. Tie *RST to HIGH through a 10K resistor, and EN as well.
 
Last edited:

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
GPIO0 (*PGM) and GPIO2 need to be pulled HIGH through a resistor (10K works fine) in order to boot from the flash. To put it into the bootloader mode, you need to pull GPIO0 down to GND at power-up. Google "ESP8266 arduino", there are some excellent forums out there on the ESP8266.

P.S. Tie *RST to HIGH through a 10K resistor, and EN as well.
Thanks Cris- I've found a lot of conflicting info on this thing on the internets. The sequence most claim is hold GPIO0 and rst low, power up, release rst, release GPIO0 to enter bootload mode...but I'm wondering if I bought modules that have no/wrong flash? I plan to try to read from the module tonight to see if I can read the boot mode confirm.
 

cerving

Owner, Eggtimer Rocketry
TRF Sponsor
TRF Supporter
Joined
Feb 3, 2012
Messages
4,366
Reaction score
1,742
All ESP8266 modules have a flash memory chip, because the ESP8266 WiFi processor doesn't have any on-chip flash. That's a good thing and a bad thing... it's bad because it's one more thing the module designer has to put on the board, it's a good thing because you can put as much or as little as you want. Most of them have at least 1 MB on them, which is a huge amount for a microcontroller.

The bootloader sequence is this:

1) Connect your serial cable... you only need the RXD, TXD, and GND wires.
2) Jumper GPIO0 to GND
3) Power up the module... you should see the blue LED on the module blink once
4) Upload your firmware... if you're using the Arduino IDE, pick the "Huzzah" processor, the "ArduinoISP" device, and set it to your COM port. While it's loading you should see the blue LED blinking. If the Arduino IDE times out and you get an error, check your device/COM/processor settings.
5) Power down the module and remove the jumper on GPIO0.
6) Power up... your program should be running.

Works every time. The default baud rate should be 115,200 baud, you can go higher depending on your cable & PC, but 115,200 is the most reliable. I flash the ESP8266's in Eggtimer Rocketry products at 115,200 baud because reliability is way more important that speed; I can't afford to send out a module that "might" not be programmed correctly.
 

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
Ok- I really am not sure what I did differently this time, but I was successful with the upload! Thanks for the info, Cris- it proved that I was on the right track, just must've had one squirrely breadboard connection that was solid this time.
 

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
All ESP8266 modules have a flash memory chip, because the ESP8266 WiFi processor doesn't have any on-chip flash. That's a good thing and a bad thing... it's bad because it's one more thing the module designer has to put on the board, it's a good thing because you can put as much or as little as you want. Most of them have at least 1 MB on them, which is a huge amount for a microcontroller.

The bootloader sequence is this:

1) Connect your serial cable... you only need the RXD, TXD, and GND wires.
2) Jumper GPIO0 to GND
3) Power up the module... you should see the blue LED on the module blink once
4) Upload your firmware... if you're using the Arduino IDE, pick the "Huzzah" processor, the "ArduinoISP" device, and set it to your COM port. While it's loading you should see the blue LED blinking. If the Arduino IDE times out and you get an error, check your device/COM/processor settings.
5) Power down the module and remove the jumper on GPIO0.
6) Power up... your program should be running.

Works every time. The default baud rate should be 115,200 baud, you can go higher depending on your cable & PC, but 115,200 is the most reliable. I flash the ESP8266's in Eggtimer Rocketry products at 115,200 baud because reliability is way more important that speed; I can't afford to send out a module that "might" not be programmed correctly.
I had difficulty again last night, but found success with the following steps- I'm trying to comprehend how there can be such variation, since nearly everyone online has a "preferred" method that works for them!
1) Jumper GPIO to GND
2) Power up module, blue LED blinks once.
3) Connect serial, but would not work without also connecting RTS to RST.
4) Flash.
5) Undo, restart, and it works.

If I started with the serial connections on, I wouldn't get the blue flash from the module. If I didn't have the RTS connected, I got the esp.comm errors.
 

cerving

Owner, Eggtimer Rocketry
TRF Sponsor
TRF Supporter
Joined
Feb 3, 2012
Messages
4,366
Reaction score
1,742
It might be your serial cable, which one are you using? I'm guessing it's a FTDI, they want RTS held high. Since the *RST pin on the ESP8266 has to be pulled high, that would make sense. The Prolific cables that we sell are a simple 3-pin cable... no handshaking.
 

soopirV

Well-Known Member
Joined
Sep 1, 2010
Messages
1,157
Reaction score
6
It might be your serial cable, which one are you using? I'm guessing it's a FTDI, they want RTS held high. Since the *RST pin on the ESP8266 has to be pulled high, that would make sense. The Prolific cables that we sell are a simple 3-pin cable... no handshaking.
You're right, it's an FTDI. I will give your cable a try!
 
Top