From 1c565435e7c37b044aa80cdc94abbf1d4214ff03 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Mon, 27 Apr 2026 16:43:19 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20ping=20Miotiq=20command=3D0x02=20pour=20?= =?UTF-8?q?retrocompat=20avec=20capteurs=20deploy=C3=A9s=20(byte=209=20=3D?= =?UTF-8?q?=200x01)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les capteurs en production envoient 0x01 sur le byte 9 (ancien protocol_version). Cote serveur: 0x00 et 0x01 = data normal, 0x02 = ping test. Co-Authored-By: Claude Opus 4.6 (1M context) --- SARA/sara_ping_miotiq.py | 2 +- html/saraR4.html | 2 +- loop/SARA_send_data_v2.py | 2 +- loop/error_flags.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SARA/sara_ping_miotiq.py b/SARA/sara_ping_miotiq.py index 10c21d2..d5f7605 100644 --- a/SARA/sara_ping_miotiq.py +++ b/SARA/sara_ping_miotiq.py @@ -24,7 +24,7 @@ import sqlite3 MIOTIQ_IP = "192.168.0.20" MIOTIQ_PORT = 4242 PAYLOAD_SIZE = 100 -COMMAND_PING = 0x01 +COMMAND_PING = 0x02 LISTEN_TIMEOUT = 15 # seconds to wait for downlink response # --- Load device_id from SQLite --- diff --git a/html/saraR4.html b/html/saraR4.html index 527fbc4..ee1a14f 100755 --- a/html/saraR4.html +++ b/html/saraR4.html @@ -334,7 +334,7 @@

3. Test aller-retour

-

Envoie un payload ping (command=1) via UDP puis écoute la réponse descendante Miotiq (~15s).

+

Envoie un payload ping (command=2) via UDP puis écoute la réponse descendante Miotiq (~15s).

diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index d5ffa0c..9bc1b53 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -387,7 +387,7 @@ class SensorPayload: self.payload[68] = status & 0xFF def set_command(self, value): - """Set command byte (byte 9): 0x00 = normal data, 0x01 = ping test""" + """Set command byte (byte 9): 0x00 = normal data, 0x01 = legacy (ancien protocol_version), 0x02 = ping test""" self.payload[9] = value & 0xFF def set_firmware_version(self, version_str): diff --git a/loop/error_flags.md b/loop/error_flags.md index 5c7c6e1..7197577 100644 --- a/loop/error_flags.md +++ b/loop/error_flags.md @@ -13,7 +13,7 @@ etre actifs simultanement. ## Position dans la payload ``` -Byte 9 : command (0x00 = data normal, 0x01 = ping test) +Byte 9 : command (0x00 = data normal, 0x01 = legacy/ancien protocol_version, 0x02 = ping test) Bytes 0-8 : device_id (8 bytes) + signal_quality (1 byte) Bytes 10-65 : donnees capteurs Byte 66 : error_flags (erreurs systeme)