reconnecting to boards running endless loops
Posted: Sat Mar 17, 2018 7:00 am
A basic question that may have more to do with programing on microcontollers than Micropython specifically.
I am using a ESP8266 WEMOS D1 mini using vanilla micropython.
I have written a program that uses an endless loop of
connecting to wifi -> reading a sensor -> publishing the sensor data by mqtt-> then entering a deep sleep using
this works fine and will happily cycle endlessly.
However, if it want to stop the program running, and adjust some parameters, I hit a problem.
I cannot connect to the dev board via USB serial port (using rshell). Presumably because the code is running or the esp is in deep sleep.
I have no idea how to deal with the obvious issue. Should I include something in the script to allow me to stop the code running?
I am using a ESP8266 WEMOS D1 mini using vanilla micropython.
I have written a program that uses an endless loop of
connecting to wifi -> reading a sensor -> publishing the sensor data by mqtt-> then entering a deep sleep using
Code: Select all
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, 300000)
machine.deepsleep()
However, if it want to stop the program running, and adjust some parameters, I hit a problem.
I cannot connect to the dev board via USB serial port (using rshell). Presumably because the code is running or the esp is in deep sleep.
I have no idea how to deal with the obvious issue. Should I include something in the script to allow me to stop the code running?