From 0d56074adc3320f51a0b8bb9d0ec15fb0f8c35d7 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 31 Jul 2019 19:29:53 +0200 Subject: [PATCH] publish version on startup --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index f49f91e..249e8da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -607,6 +607,12 @@ void setup() if (!ota.getMAC().equals("246f28d1a080")) mqtt.subscribe("thomas/sensor/246f28d1a080/#", receiveMqtt); if (!ota.getMAC().equals("30aea47b0568")) mqtt.subscribe("thomas/sensor/30aea47b0568/#", receiveMqtt); + /* temp: publish version */ + delay(5000); + String topic_version = String("thomas/sensor/") + ota.getMAC() + String("/version"); + const char* fw_version_str = String(FW_VERSION).c_str(); + mqtt.publish(topic_version.c_str(), fw_version_str, strlen(fw_version_str)); + ESP_LOGD(TAG, "setup done"); }