Disconnecting issues after adding any pinMode(xxxx, INPUT); and other random events

I’m a bit confused by this:

The numbers (15, 16, 8, 7, 6 & 0) are GPIO numbers used by your board.

Node MCU Dev boards don’t have GPIO 6, 7 or 8 available as pins on the board. At first I assumed that you were confusing GPIO numbers with the “D” numbers that are screen-printed onto the board, but these boards don’t have D15 or D16, so I guess you’re mixing and matching GPIO numbers and D numbers and expecting it to work - which it wont!

You need to use GPIO numbers throughout, and choose ones that are available as pins on the board.
However, you need to avoid the “Special” GPIOs…

It’s not recommended that you use GPIO16 as this is used as part of the wakeup functionality and can cause issues if you use it for other stuff
GPIO 1 and 3 are used by the serial interface, so will cause issues if you wnat to do serial debugging or upload code with these pins connected.
GPIO0 is used when flashing code, so avoid this as well.
GPIO2 is connected to the internal LED. That’s not necessarily a problem, depending on what you use this pin for.

This excellent post from @wanek gives more details:

Pete.

1 Like