From eb93ba49bd491367d36ac9d683a41aa86497814c Mon Sep 17 00:00:00 2001 From: PaulVua Date: Wed, 18 Mar 2026 10:17:37 +0100 Subject: [PATCH] v1.5.0: error flags payload UDP + init bytes status a 0x00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bytes 66-68 (error_flags, npm_status, device_status) initialises a 0x00 au lieu de 0xFF pour eviter faux positifs cote serveur - Implementation flag RTC (byte 66) + methodes SensorPayload - Escalade PDP reset: si echec → notification + hardware reboot + exit - Changelog et VERSION mis a jour Co-Authored-By: Claude Opus 4.6 (1M context) --- VERSION | 2 +- changelog.json | 21 +++++++++++++++++++++ loop/SARA_send_data_v2.py | 8 +++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c514bd8..bc80560 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.6 +1.5.0 diff --git a/changelog.json b/changelog.json index c636a5b..841b67d 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,26 @@ { "versions": [ + { + "version": "1.5.0", + "date": "2026-03-18", + "changes": { + "features": [ + "Payload UDP Miotiq: byte 66 error_flags (erreurs systeme RTC/capteurs)", + "Payload UDP Miotiq: byte 67 npm_status (registre status NextPM)", + "Payload UDP Miotiq: byte 68 device_status (etat general du boitier, specification)", + "Methodes SensorPayload: set_error_flags(), set_npm_status(), set_device_status()" + ], + "improvements": [ + "Initialisation bytes 66-68 a 0x00 au lieu de 0xFF pour eviter faux positifs cote serveur", + "Escalade erreur UDP: si PDP reset echoue, notification WiFi + hardware reboot + exit" + ], + "fixes": [], + "compatibility": [ + "Necessite mise a jour du parser Miotiq pour decoder les bytes 66-68 (error_flags, npm_status, device_status)" + ] + }, + "notes": "Ajout de registres d'erreur et d'etat dans la payload UDP (bytes 66-68). Les bytes de status sont initialises a 0x00 (aucune erreur) au lieu de 0xFF. Le flag RTC est implemente, les autres flags seront actives progressivement." + }, { "version": "1.4.6", "date": "2026-03-17", diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 0832a2e..976413b 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -281,7 +281,13 @@ class SensorPayload: #device_id_bytes = bytes.fromhex(device_id)[:8].ljust(8, b'\x00') self.payload[0:8] = device_id_bytes - + + # Status/error bytes default to 0x00 (no error) + # 0xFF = "no data" for sensor values, but for status bytes + # 0x00 = "no error/no flag" is the safe default + self.payload[66] = 0x00 # error_flags + self.payload[67] = 0x00 # npm_status + self.payload[68] = 0x00 # device_status # Set protocol version (byte 9) self.payload[9] = 0x01