fix: 24hr restart schedule enchanced.

Step 0: Pause polling
Step 1: Stop measurement → wait 10s
Step 2: Disable FTP → wait 10s
Step 3: Enable FTP → wait 10s
Step 4: Download data
Step 5: Wait 30s for device to settle
Step 6: Start new measurement
Step 7: Re-enable polling
This commit is contained in:
serversdwn
2026-01-31 05:15:00 +00:00
parent cc0a5bdf84
commit eb0cbcc077
2 changed files with 10 additions and 4 deletions

View File

@@ -1381,8 +1381,13 @@ class NL43Client:
result["stopped"] = True
logger.info(f"[STOP-CYCLE] Measurement stopped")
# Step 2: Enable FTP
logger.info(f"[STOP-CYCLE] Step 2: Enabling FTP")
# Step 2: Reset FTP (disable then enable) to clear any stale state
logger.info(f"[STOP-CYCLE] Step 2: Resetting FTP (disable then enable)")
try:
await self.disable_ftp()
logger.info(f"[STOP-CYCLE] FTP disabled")
except Exception as e:
logger.warning(f"[STOP-CYCLE] FTP disable failed (may already be off): {e}")
await self.enable_ftp()
result["ftp_enabled"] = True
logger.info(f"[STOP-CYCLE] FTP enabled")