the esp8266 mcu is widely used in iot projects. however, most gpio pins on this mcu have special / multiple functionality and are not safe to use in all circumstances.
these “features” are still not well documented and not explained in a friendly manner for newbies. i see lots of cases when the “issues” are simply caused by not knowing which pins to use in which case.
here is a basic table for startup. i’ve collected the info from various sources on the internet, there could be erroneous or missing informations, so, please comment if something is off…
There is one, done by the youtuber “guy with the swiss accent”. Can’t remember his name, proper youtube profile or post a link to the website, as I am on mobile… My aging PC is misbehaving.
well, it depends what “device” it is hooked on them, i guess. there is no universal rule for that.
you have to take into consideration the pins default behaviour on startup and think about how it will affect your application: for example if you have a mosfet gate on a pin that goes high at startup for some milliseconds, and that mosfet opens your garage door, it is a bad idea… it will open your door everytime the mcu restarts.
if the mosfet just turns on a light, it is no problem if the mcu restarts and the light will be on for 100 millis.
also, if you hook up a small relay directly to a pin, and the other end of the coil is connected to vcc / gnd, that relay can act as a “pullup” / “pulldown” resistor. you have to choose carefully and avoid to change the state of the pins which must be in a specific state for proper boot.
use common sense and EXPERIMENT for yourself.
for example, in one of my projects i found out that even if gpio 2 theoretically has to be high for proper boot, it still boots properly if it pulled low. i do not know why, but it works.
yes, I realised that when asking the question, hence I was aiming at ‘simple’ devices like led, but the garage-door is an interesting example of stuff that can go really wrong when not connected right.
But I meant more for the ESP itself, so the last part where you describe the relay that can act as a pullup/down resistor.
In short which pins are ‘safe’ to use under any (withing bounds obviously) condition, which pins are ‘reasonably safe’ and which should not be used for output (unless you really know what you are doing).
Another way would be to describe the ‘risk’ of using that pin in for output.
common sense if far too rare to use too often, hence its too often not used at all
and yes I’ve experimented a LOT and found out that some pins used as output (or even set as output) can screw things up.
thnx, that helps. And is it possible that you share the original file as well? So I can add my own notes, I could type it over but thats a bit silly in this day and age. I recall its not allowed on this forum, so perhaps a (e.g. dropbox) link? Its how I share all my stuff)
Mike shared the article on a private part of the forum, so I’ve added it on to this thread to enable everyone to see it, and to enable me to find it again when I want to reference it.
thanks @PeteKnight, this is really usefull. unfortunately i was restricted from the lounge, because in the last months i’ve had no time to activate on this forum. so, i couldn’t read the news
currently i’m very busy with some projects, but maybe i could put together a new table for the esp32 too.