LED shines when GPIO2 low on ESP-12?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

LED shines when GPIO2 low on ESP-12?

Post by deshipu » Fri May 06, 2016 9:02 pm

I just noticed a strange thing. If I set the GPIO2 pin to low (or enable PWM on it), the blue serial LED, which normally blinks when there is serial communication, switches on. I would expect that LED to be connected to GPIO3 or GPIO1, not GPIO2, so I'm not sure what is happening there. Anybody had a similar experience?

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: LED shines when GPIO2 low on ESP-12?

Post by platforma » Sat May 07, 2016 11:36 am

Nope, seems okay here. I have ESP12-E. Tried both PWM and Pin.OUT/Pin.IN set to low for pin 2. Does the LED turn off when you set the pin to other values (high or PWM)?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: LED shines when GPIO2 low on ESP-12?

Post by pfalcon » Sat May 07, 2016 12:35 pm

Yes, ESP-12 has an on-module blue LED, on GPIO2, active low. I don't see it blinking with serial communication (except for when using BootROM bootloader for programming, but that's bootloader blinking it, not serial communication, i.e. it in no way tied to UART).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: LED shines when GPIO2 low on ESP-12?

Post by deshipu » Sat May 07, 2016 12:51 pm

That makes sense, thanks.
At the bootloader time, everything from GPIO1 is echoed on GPIO2 (possibly for debugging), so that would explain why it blinks then.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: LED shines when GPIO2 low on ESP-12?

Post by pfalcon » Sat May 07, 2016 12:53 pm

A bit better explanation is that GPIO2 is TXD1, i.e. TX of TX-only UART1, intended to be used for logging. Apparently, bootloader dumps quite a lot there. It would be interesting to see what it writes there, I don't believe I ever saw someone describing that (I bet it's 74880 baud or whatever it is).

This made me think: we forgot to disable OS logging to UART0 in the release %).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply