fix: update health monitoring on serial data receive and send; change default serial protocol to json_newline

Signed-off-by: sh4un <97253929+sh4un-dot-com@users.noreply.github.com>
This commit is contained in:
sh4un committed 2026-01-29 17:14:46 -05:00
1 parent 89037a1bfe
commit ab20a6ae12
2 files changed
+9 -2

No files matched your search

+8 -1
View File
@@ -254,7 +254,10 @@ class MeshcoreHandler:
if raw_data:
self.logger.debug("Serial RAW RX: %r", raw_data)
# Update health on every receive
self.health_monitor.update_component(
"external", HealthStatus.HEALTHY, "Serial RX received"
)
# Decode using the selected protocol handler
decoded_msg: Optional[Dict[str, Any]] = (
self.protocol_handler.decode(raw_data)
@@ -433,6 +436,10 @@ class MeshcoreHandler:
self._is_connected.clear()
if send_success:
# Update health on every successful send
self.health_monitor.update_component(
"external", HealthStatus.HEALTHY, "Serial TX sent"
)
self.to_serial_queue.task_done()
else:
self.logger.error(
+1 -1
View File
@@ -40,7 +40,7 @@ SERIAL_BAUD_RATE = 9600
# (Use this if your device talks Text/JSON)
# raw_serial: Reads raw binary/text bytes and forwards them as Hex.
# (Use this for MeshCore Companion Mode or binary protocols)
SERIAL_PROTOCOL = raw_serial
SERIAL_PROTOCOL = json_newline # Use json_newline for text/JSON, raw_serial for binary/hex
# --- MQTT Transport Settings ---