Browse Source

publish version on startup

ir
Hendrik Langer 5 years ago
parent
commit
0d56074adc
  1. 6
      src/main.cpp

6
src/main.cpp

@ -607,6 +607,12 @@ void setup()
if (!ota.getMAC().equals("246f28d1a080")) mqtt.subscribe("thomas/sensor/246f28d1a080/#", receiveMqtt); if (!ota.getMAC().equals("246f28d1a080")) mqtt.subscribe("thomas/sensor/246f28d1a080/#", receiveMqtt);
if (!ota.getMAC().equals("30aea47b0568")) mqtt.subscribe("thomas/sensor/30aea47b0568/#", 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"); ESP_LOGD(TAG, "setup done");
} }

Loading…
Cancel
Save