-->
Page 1 of 2

Blue LED On When Applying Power With LED Connected to GPIO2

PostPosted: Wed Jul 01, 2015 3:57 pm
by Marty
I have an LED connected to GPIO2 through a 220ohm resistor. When I upload my sketch, the sketch works fine once the upload is completed.

If I remove power, remove the GPIO0 - GND short, and reapply power, the blue LED on the ESP8266 stays on constantly and my LED comes on (should be initially off).

If I remove the connection to my LED, cycle power, and then reconnect my LED, the sketch works perfectly.

Can anyone explain what is happening here.

Thanks,
Marty

Re: Blue LED On When Applying Power With LED Connected to GP

PostPosted: Wed Jul 01, 2015 4:21 pm
by lethe
GPIO2 is one of the pins used to select boot mode & must be high on startup. Your LED is pulling the pin low. Easy fix: flip your LED around and invert the logic levels in your code.

Re: Blue LED On When Applying Power With LED Connected to GP

PostPosted: Thu Jul 02, 2015 12:54 pm
by Marty
Thanks Lethe,

You are correct, switching the polarity of the LED fixed the problem.

Is it commonly known about this behavior of GPIO2? I had not come across this in the documentation before.

Now I see a small note on the ESP8266 Arduino Githup site "GPIO2 is alternative TX for the boot loader mode". I would not have read into that statement about preventing the voltage on that pin from going low during boot-up.

Is this situation covered in some other documentation ? It's rather important.

Regads,
Marty

Re: Blue LED On When Applying Power With LED Connected to GP

PostPosted: Thu Jul 02, 2015 2:23 pm
by martinayotte
The Boot Process table in Wiki : https://github.com/esp8266/esp8266-wiki ... ot-Process
Any LEDs connected to GND will act as pull-down.