From 5cac86c01826ad89c6e9c38cc7e6dd2605611f3a Mon Sep 17 00:00:00 2001
From: Robert Piotrowski <robert.piotrowski@gmail.com>
Date: Wed, 19 Mar 2025 09:43:27 +0100
Subject: [PATCH] Add table name in front on mqtt msg

---
 serial_to_mqtt_bridge/serial_to_mqtt.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/serial_to_mqtt_bridge/serial_to_mqtt.py b/serial_to_mqtt_bridge/serial_to_mqtt.py
index ddd75a9..4a0825f 100755
--- a/serial_to_mqtt_bridge/serial_to_mqtt.py
+++ b/serial_to_mqtt_bridge/serial_to_mqtt.py
@@ -59,7 +59,7 @@ def main(serial_port=None, baud_rate=115200, file_path="sim_data.txt", mqtt_brok
                 # Get the next line from the file
                 line = next(file_reader)
                 cnt = cnt +1
-                msg=line+str(cnt)
+                msg=mqtt_topic+","+line+str(cnt)
                 client.publish(msg)
                 print(f"Sent to MQTT broker={mqtt_broker} in topic={mqtt_topic} msg={msg}")
                 time.sleep(sim_interval)  # Use interval from YAML config
-- 
GitLab