Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By xytsrm
#94932 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:
Code: Select allledObj = 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.
User avatar
By QuickFix
#94935
xytsrm wrote:I believe I figured out why an ESP-01 loses REPL after LED Flashing.

Great that you've found the problem, but could you elaborate for those that might have a similar problem in the future? :idea: