0

On the ESP8266 NodeMCU I have GPIO2 , GPIO3 , GPIO1 , GPIO9 free but when I assign them to a button they do not work. I assume it is because those pins have other function behind them. When I look at the schematic I found that they are TXD1, RXD0, TXD0, and SSD2. Is there a way to still use these pins as inputs?

If not, can I use an Arduino Uno for my inputs and send signals from there to the analog pin to my ESP8266 NodeMCU for the connection to the MQTT server?

For the record all my other pins are used so I can't use any other input pin than these 4.

  • safest pins to use are 4, 5, 12, 13, 14 then 16. 0, 2 and 15 can be safe to use as long as you realise that normal boot should have 15 LOW, and 0 and 2 High - so, if you have a pullup resistor on 0 and 2, and the button shorts to ground when pressed, and a pulldown resistor on 15, and the button shorts to vcc when pressed, you shouldn't have any issues using these – Jaromanda X Dec 7 '17 at 2:36
  • forgot to mention, all boards I've used (ESP07/12E/12F) have a pulldown resistor on GPIO15 already - so, check before adding another one – Jaromanda X Dec 7 '17 at 2:57
  • @JaromandaX I used your method with the pullup resistors for pins 0 and 2 and that worked thanks a lot. I do have 1 more question about your answered in the other command about the GPIO9 and GPIO10 . The 10 works fine but the 9 doesn't, it doesn't work as an output or input. I don't need the 9 but my question is if pin GPIO10 is safe to use for a button because the 9 and 10 are both SSD pins. *All the other pins you mentioned are used I should've thought about this in the beginning of my project :D – achahbar Dec 7 '17 at 7:33
0

GPIO2 is NodeMCU D4 which is U1TXD, transmit for the second UART, generally available. GPIO3 is NodeMCU U0RXD, receive for the first UART, generally available if you aren't using serial. GPIO1 is NodeMCU U0TXD, transmit for the first UART, generally available if you aren't using serial. GPIO9 is NodeMCU SPIHD and is NOT available, as it is required for the flash memory. All that is well documented in many places. You can easily use serial to move data between modules, or multiplex your input to the one module. Cannot provide much insight without more details.

  • Thank you for the clarfication of the pins and your answer. The problem i'm having with these pins are that when my esp8266 is in flash mode (when booting up and when uploading) there can't be a button connecting to these pins , when it is finished uploading /booting. The input pins work perfectly. Is there something in my code that i can tell the esp8266 to not check these ports while booting up. or other solutions. – achahbar Dec 6 '17 at 21:44
  • on a nodemcu, GPIO9(11) and GPIO10(12) seem to be available - (node mcu io index number in brackets) perhaps only SDD0 and SDD1 are connected to the flash ram. – Jaromanda X Dec 7 '17 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.