Skip to content

Commit

Permalink
fix wdt timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mzakharo committed Jan 8, 2024
1 parent 87ebb45 commit 822ce65
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ports/esp32/modules/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
SLEEP = 5_000

#how long to wait for sensor to settle after power on from deep sleep
SENSOR_CALIBRATE_SLEEP = 900_000
SENSOR_CALIBRATE_SLEEP = 100_000
SENSOR_CALIBRATE_SLEEP_TIMES = 9
if PROFILING:
SENSOR_CALIBRATE_SLEEP = 3_000
SENSOR_CALIBRATE_SLEEP_TIMES = 1

#sleep due to wlan connect error
SLEEP_FAST = 60_000
Expand Down Expand Up @@ -225,7 +227,7 @@ def discovery(client):
model = uos.uname().machine
sha = s.check.get('sha', '')[:8]

expire = 3 * (SLEEP + SENSOR_CALIBRATE_SLEEP) // 1000
expire = 3 * (SLEEP + SENSOR_CALIBRATE_SLEEP * SENSOR_CALIBRATE_SLEEP_TIMES) // 1000
device = {
'identifiers' : NODE_ID,
'name' : name,
Expand Down Expand Up @@ -322,9 +324,9 @@ def measure():
#dummy read to lower light sleep current to 1.1ma from 2.4mA
#Can anyone explain THIS????
ao.read_uv()

my_sleep_ms(SENSOR_CALIBRATE_SLEEP)
wdt.feed()
for _ in range(SENSOR_CALIBRATE_SLEEP_TIMES):
my_sleep_ms(SENSOR_CALIBRATE_SLEEP)
wdt.feed()

raw = dict(orp=[], vbat=[], ph=[])
for i in range(NUM_SAMPLES):
Expand Down

0 comments on commit 822ce65

Please sign in to comment.