The curious problem of the flashing LED
Posted: Thu Jul 14, 2022 6:51 pm
I'm programming in microPython, and have successfully flashed uPy to ESP-01, 01S, 12E & 12F modules.
Coded an ESP-01 & ESP-01S with an ESP-Now application; both devices were functioning properly.
Needed to identify the state of each unit when used remotely for testing by adding an simple LED flashing routine to each unit. The LED for the ESP-01 is on Pin-1 (Tx), and on Pin-2 (GPIO2) for the ESP-01S. After completing an operation, each unit would flash their respective LED's then go to REPL. This worked for the ESP-01S, but after flashing it's LED the ESP-01 failed to go to REPL. Every Stop query to the ESP-01 resulted in a "device busy" response; the only way to return functionality was to re-flash microPython, and re-code.
I paired the ESP-01 code down to simple LED flashing and the same thing happened; here is the LED flashing code:
Any suggestions as to why the ESP-01 code gets corrupted by just flashing it's LED?
X.
Coded an ESP-01 & ESP-01S with an ESP-Now application; both devices were functioning properly.
Needed to identify the state of each unit when used remotely for testing by adding an simple LED flashing routine to each unit. The LED for the ESP-01 is on Pin-1 (Tx), and on Pin-2 (GPIO2) for the ESP-01S. After completing an operation, each unit would flash their respective LED's then go to REPL. This worked for the ESP-01S, but after flashing it's LED the ESP-01 failed to go to REPL. Every Stop query to the ESP-01 resulted in a "device busy" response; the only way to return functionality was to re-flash microPython, and re-code.
I paired the ESP-01 code down to simple LED flashing and the same thing happened; here is the LED flashing code:
Code: Select all
ledObj = Pin(1, Pin.OUT)
offState = 1
onState = 0
ledObj.value(offState)
TFlash = 0.3
while True:
ledObj.value(onState)
sleep(TFlash)
ledObj.value(offState)
sleep(TFlash)
Any suggestions as to why the ESP-01 code gets corrupted by just flashing it's LED?
X.