-->
Page 6 of 6

Re: Connectiong GPIO2 to GND on Startup results in junk in

PostPosted: Thu Apr 07, 2016 7:21 am
by martinayotte
GPIO15/GPIO2/GPIO0 are special pins that dictate the way ESP is booting.

https://github.com/esp8266/esp8266-wiki ... ot-Process

So, GPIO15 needs to be pulled down while GPIO2/GPIO0 needs to be pulled up to boot in execution mode.
It has always been like that.

You can still use those pins for other purposes, but you need to take care of the states above at reset or poweron.
For example you can place an LED on GPIO15 with cathode side to GND, and keeping the pulldown, it will work.
Doing the same on GPIO2 won't work, except if you reverse it and connect cathode to GPIO2 and anode to VCC and along with the pullup.

Re: Connectiong GPIO2 to GND on Startup results in junk in

PostPosted: Wed May 04, 2016 3:08 am
by eqsOne
For my reed switch I solved it by declaring GPIO 0 as output, pull it low in setup and use it instead of ground to connect the switch to. Additionaly you might add a 2k2-10k resistor between GPIO 0 and 3.3V to have GPIO 2 high or floating during boot up (depending on the switch position).
In my case the ESP boots up fine regardless of GPIO 0/2 being pulled up or floating initially (I do keep RST permanently pulled high with 10k). GPIO 2 is used as input_pullup, sensing for high or low states:

ESP Reed Switch.jpg


This one got me in the right direction on that topic.

Just remember - for my purpose, GPIO 0 has no other use than being pulled low, the ESP(V1) sends push messages to my phone on switch changes. You might want to have a further look if you need GPIO 0 doing other stuff than just providing a steady ground connection after boot up.

Code: Select allvoid setup() {

pinMode(2, INPUT_PULLUP); // One reed wire at GPIO 2
pinMode(0, OUTPUT); // Other reed wire at GPIO 0 which provides...
digitalWrite(0, LOW); // ...ground after booting
(...)
}


Re: Connectiong GPIO2 to GND on Startup results in junk in

PostPosted: Thu Jan 12, 2017 12:08 pm
by Vijay Sharma
Thanks for the inputs, I did as you mentioned. Connected a LED between GPIO2 and VCC and pulled up GPIO2 via a resistor. It works now.
Thanks!