unable to access webrepl when main script is running
Re: unable to access webrepl when main script is running
Just following the recommended delay on several Micropython document pages for 1-wire.
Re: unable to access webrepl when main script is running
Hi, sorry the time estimates were just an example.
I tried all combinations of timing intervals. Different sleep times , but no success.
My Data logger essentially works like this:
Samples the sensors (takes 2 minutes)
Send the data (takes about 3 minutes)
Deep sleep for 5/10 minutes
Repeat
Like I said above the only way I can access webrepl is using an input() that hangs the device.
I can't kill or stop the main thread and gain control at all
I tried all combinations of timing intervals. Different sleep times , but no success.
My Data logger essentially works like this:
Samples the sensors (takes 2 minutes)
Send the data (takes about 3 minutes)
Deep sleep for 5/10 minutes
Repeat
Like I said above the only way I can access webrepl is using an input() that hangs the device.
I can't kill or stop the main thread and gain control at all
Re: unable to access webrepl when main script is running
So my Pyboard D is being used as a data logger for various sensors e.g. GPS, Temperature etc.MostlyHarmless wrote: ↑Sat Nov 07, 2020 12:40 am750ms to read sensors sounds like a lot. Can you give more details on that?
Jan
The main loop functions like so:
- Sample Devices (2-3 minutes)
- Send Data (2 minutes)
- deep sleep for 10 minutes
The deep sleep effectively hard resets the Pyboard.
I've experimented with all different kinds of sleep e.g. sleep, sleep_ms and sleep_us
But until the main thread is killed or stops I can't access webrepl.
The only minor success I had was putting in a input() statement which hangs the main code and allowed me to log in, however I couldn't enter a Control + C or Control + D to gain control.
If anyone can think of a way for me to gain control of the repl using WiFi I would be really grateful.
This Data logger is being placed in a lake and opening the case up to access the Repl just isn't ideal and risks water damage.
Thanks in advance
Re: unable to access webrepl when main script is running
1-wire delay from https://docs.micropython.org/en/latest/ ... ckref.html
and https://docs.micropython.org/en/latest/ ... kref.html
I don't see 1-wire in the pyboard section.
and https://docs.micropython.org/en/latest/ ... kref.html
Code: Select all
import time, ds18x20
ds = ds18x20.DS18X20(ow)
roms = ds.scan()
ds.convert_temp()
time.sleep_ms(750)
for rom in roms:
print(ds.read_temp(rom))