UART communication
This commit is contained in:
@@ -48,6 +48,8 @@ mqtt_client = get_mqtt_client(
|
||||
keepalive=config.MQTT_KEEPALIVE,
|
||||
)
|
||||
mqtt_client.connect()
|
||||
mqtt_client.subscribe(config.MQTT_TOPIC_SENSOR, qos=config.MQTT_QOS)
|
||||
print(f"Subscribed to topic: {config.MQTT_TOPIC_SENSOR}")
|
||||
|
||||
# --- THE CRUCIAL PAHO FIX ---
|
||||
# Start Paho's internal background thread. This handles all network packets,
|
||||
@@ -93,7 +95,7 @@ while True:
|
||||
# Publish debug telemetry message
|
||||
print("[Main Loop] Envoi d'un message de debug sur MQTT...")
|
||||
response = mqtt_client.publish(
|
||||
config.MQTT_TOPIC,
|
||||
config.MQTT_TOPIC_COOKING,
|
||||
f"Orchestrateur actif, ID: {DEVICE_ID}",
|
||||
qos=config.MQTT_QOS
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user