Chat freely about anything...

User avatar
By Kleber_Guimaraes
#48134 Hi Guys, I start use ESP8266 with Modemcu Firmware. But I can't understand error apper to me.
I can download and Burn firmware in my esp8266 - 01, and I restart him with GPIO in HIGH (VCC).
I open Serial monitor in IDE Arduino and press enter, appear in serial this symbol ">"

>

I enter the command node.restart()
and my esp8266 restart and show me version the firmware.

But him GPIO2 is always ON. I try Turned OFF but I can't

I enter command.

gpio.mode(2,gpio.OUTPUT)
gpio.write(2,gpio.LOW)

and led dont turne off

I try gpio.write(2,gpio.HIGH) and him always on.

Please somebody, help me, turn on a light for me.

thaks...
User avatar
By 8n1
#48170 NodeMCU uses a different numbering schema. 2 doesn't correlate to GPIO2 there but to GPIO4.

GPIO2 hides behind the number 4.
So try this:
Code: Select allgpio.mode(4, gpio.OUTPUT)
gpio.write(4, gpio.LOW)


Here is a list of all ESP8266 GPIO pins and how they correlate to the NodeMCU numbering schema:
http://nodemcu.readthedocs.io/en/dev/en/modules/gpio/