As the title says... Chat on...

User avatar
By Guiherme Nicolini
#45318 I flashed my ESP-01 with the last version of nodeMCU (1.4.0)
Than I uploaded the following code:

Case 1
Code: Select allGPIO2 = 4
gpio.mode(GPIO2, gpio.OUTPUT)
gpio.write(GPIO2, gpio.LOW)

Case 2
Code: Select allGPIO0 = 3
gpio.mode(GPIO0, gpio.OUTPUT)
gpio.write(GPIO0, gpio.LOW)


My connections use FTDI232 and ESP8266 ESP-01:
FTDI VCC 3.3v > ESP-01 VCC
FTDI VCC 3.3v > ESP-01 CH_PD
FTDI GND > ESP-01 GND
FTDI TX > ESP-01 RX
FTDI RX > ESP-01 TX

There are two LEDs connected:
LED (-) > FTDI GND
LED (-) > FTDI GND

When I turn on my device WITH the GPIO0 or GPIO2 connected to LED (+), they are HIGH
When I turn on my device WITHOUT the GPIO0 or GPIO2 connected to LED (+) they are LOW.

This problem occurs with net.createServer:
When I turn on my device WITH the GPIO0 or GPIO2 connected to LED (+), the LEDs are HIGH and the service do not start.
When I turn on my device WITHOUT the GPIO0 or GPIO2 connected to LED (+) they are LOW and the service start normally. Then if I connect the GPIO0 and GPIO2 the service turn on/off the LEDs.

What am I doing wrong? If I can't use the GPIO0 and GPIO2 to control sensors
User avatar
By martinayotte
#45359 The problem is that you've connected the LEDs in Source mode (ie: anode to GPIO and cathode to GND).
This prevent the ESP to boot properly because those LEDs are acting as pulldown, while it is well known that both GPIO2/GPIO0 needs to be pulled up at reset or power-up to boot properly in Execution mode.

Read those threads, and connect your LEDs in Sink mode :
viewtopic.php?f=6&t=9454#p45277