Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By martinayotte
#45034 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.
User avatar
By eqsOne
#46843 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
(...)
}

You do not have the required permissions to view the files attached to this post.