Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Barnabybear
#26100 Hi, the ESP8266 is a tricky little beast. Some of the pins have different uses depending on the mode the ESP or at boot.

GPIO 2 needs the resistor as:
It needs to be floating or pulled high at boot (still being debated) but not low.
it is also connected to UART Tx & the blue led). Only impotant during flashing when in run mode it can be used as a normal GPIO.

It gets a bit complicated with the ESP8266-01, other formats with more GPIOs broken out you would just not use GPIO 2, we don't have much choice.
We have 3 modes that the ESP can be in:
Boot mode - lasts about 250ms - GPIO 2 is an input & can be high or floating (there are different opinions about this) but not low.
Flash mode - follows boot mode & lasts until flash completed or power cycled - GPIO 2 is UART Tx with a blue indication led - can be high, floating or low, as long as connected by a high impedance, such that can be overcome by other devices using that line. 1K to 10K generaly seem to work. The blue led not functioning as expected gives an indication that the impedance is to low.
Run mode - follows boot mode & or flash mode - GPIO 2 only now functions as a GPIO.

In some applications it may be possable contend with all three modes, others my require that the ESP be removed from its application to be flashed. I have one for opening some gates that uses both GPIO 0 & 2, with the parts I had available it was possable to contend with boot & run mode, but there was no way I could get the impedance low enough to to be able to flash aswell. I dont consider this a problem, should the ESP need to be reflashed it will be unplugged & flashed on a different board.

Blue led:
Boot mode - flashes at power up to indicate which mode is to be entered. Once for flash mode, twice for run mode & others that you shouldn't come across during this.
Flash mode - flashes to indicate UART Tx trafic.
Run mode - TBH I can't remember what if anything it does - will update.
If the led does not opperate as expected it is an indication that the connection to GPIO 2 is having an effect. This may or may not be a problem depending on the mode you are in.

There are other modes, SD card boot is the only other hardware selectable mode that I know of. Others are set via code after boot.

Hope that helps & gives you an indication of why even a slight change can make a difference.
User avatar
By PaulRB
#26151 @BarnabyBear, thanks for the explanation and taking the time to write it and help me out. I really appreciate it.

I'm going to use that word yet again now: "unfortunately".

Unfortunately even matching your suggested circuit exactly, with the 2 x 10K pullups on GPIO 0 & 2, I get the same result. I can still upload a sketch if I ground GPIO0 and cycle the power. One flash. Then I upload the sketch and it goes OK. Then I remove the ground from GPIO0, cycle the power, one blue flash, garbage on serial monitor.

I should say that I have noticed that the "garbage" I see on serial monitor appears to be an identical sequence of garbage characters each time, its not just noise.

I installed CoolTerm, but it does not seem to have a 74880 baud selection. Maybe I have to edit a config file for thiat?
User avatar
By Barnabybear
#26155
PaulRB wrote:Then I remove the ground from GPIO0, cycle the power, one blue flash

That sugests that GPIO 0 is being seen as low for some reason & booting into flash mode, you might need less than 10k to get a logic one, try a 1k.
0 is < 0.25 Vcc
1 is >0.75 Vcc
The problem is that as the pins change mode so do the internal pull up / downs, & as boot only lasts about 250ms its almost impossable to measure without a scope.

On the plus side, generaly if people have problems its getting the ESP to flash.
User avatar
By PaulRB
#26187
Barnabybear wrote:That sugests that GPIO 0 is being seen as low for some reason & booting into flash mode

No, it isn't flash mode. I can't upload a sketch at that point, I get the error message I posted about 5 posts back.

Barnabybear wrote: you might need less than 10k to get a logic one, try a 1k.

OK I'll try that.