Page 1 of 1

Issues blinking ESP32 onboard LED

Posted: Tue Feb 12, 2019 12:36 am
by oserror
The below is with MicroPython 1.10 stable.

This locks up my ESP32 from AZDelivery (found on USA

>>> from machine import Pin
>>> led = Pin(1, Pin.OUT, 1)

as well as this:

>>> from machine import Pin
>>> led = Pin(1, Pin.OUT)

In both cases, the LED lights solid blue and stays lit, but the machine is unresponsive and has to be either reset or disconnected.

I have successfully run the Arduino blink sketch so I know this must be some MicroPython issue. The LED seems to be used for activity in Micropython.

My main sketch runs well, using uasyncio and uselect. I am even having luck with asynchronous generators! It's been a duct tape and bail out the boat situation, and I'll post further on that when I have the chance -- I have some questions there. Still, I'm learning and I'm really enjoying it.

I'd just like to be able to control the only LED on the board. Otherwise, I'm fairly impressed at the difference from my ESP8266 boards.

I've been looking pretty hard for the solution to this issue but I haven't found anything yet. I'm sure it's just a simple thing.

Any help would be greatly appreciated!


Re: Issues blinking ESP32 onboard LED

Posted: Tue Feb 12, 2019 4:48 am
by OutoftheBOTS_
GPIO1 is the TXD0 pin on the UART serial used by the REPL it can't be used for anything else with MP

It the LED is connected to it then it should flash when ever data is being sent to the serial terminal.

Re: Issues blinking ESP32 onboard LED

Posted: Tue Feb 12, 2019 3:31 pm
by oserror
I've been trying to change the REPL ports but so far no luck. I saw this issue on GitHub: ... issues/158

It seems relevant. I tried these settings in sdkconfig.h


I got the firmware compiled. I didn't manage to get a REPL prompt afterward. Perhaps I need to change something else in the code?

It seems that there might also be a solution with uos.dupterm() but I wasn't successful with this path either.

It seems like there might be a way to do this. I don't mind trying -- I just need a little guidance.

Re: Issues blinking ESP32 onboard LED

Posted: Tue Feb 12, 2019 4:42 pm
by oserror
Okay, the last post is still being approved.

I managed to get the LED to work by setting this in sdkconfig.h:


I then had to hook up with a USB-UART device (I may have called it by the wrong name) to those pins. REPL worked fine.

It's not exactly practical since it's tedious for me to connect the wires by hand (I'm not as young as I used to be). But it works.

I'm not saying this is solved. Is there some other way I could do this while retaining the REPL on pins 0 and 1? I have a feeling that I might have an issue with just this particular board. I can try with a breadboard, I suppose. I'm not very good with those but I think I have enough jumper wires to do it.

Thanks again for any input. Also, thank you to @OutoftheBOTS_ whose comment pointed me in the right direction.

Re: Issues blinking ESP32 onboard LED

Posted: Tue Feb 12, 2019 9:37 pm
by OutoftheBOTS_
Well u can't use that pin for both a UART and a general GPIO at the same time it is either 1 of the other. I would assume that the blue LED is connected to that pin for the purpose of seeing that your serial port is transmitting not for the purpose of using it as a general LED.

If your really need to use this board and have an LED rather than reroute the REPL to a different UART then connect a UART to USB converter to connect to your PC why don't u just connect an LED to another pin. Just get an LED and solder the correct size resistor to 1 end then connect it across the new pin and gnd. The pin should be able to otuput enough current to light a small LED

Re: Issues blinking ESP32 onboard LED

Posted: Fri May 03, 2019 9:22 am
by seb77
I am using ESP32 WROOM DEVKIT v1.
The blue led is on GPIO2 and turning it on and off in MP goes sth like this (it works ;) ):
>>> from machine import Pin
>>> led = Pin(2, Pin.OUT)
>>> led.on()
>>> led.value()