diff --git a/src/main.cpp b/src/main.cpp index 35f6bf8..d3d80f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -93,6 +93,10 @@ void handleMqttMessage(char *topic, char *payload) { // Unused for now } +void subscribeToIoTCallbacks() +{ + espmega.updateTimeFromNTP(); +} void setup() { @@ -161,6 +165,7 @@ void setup() Serial.print("boot_state.txt=\"MQTT Initializing . . .\""); sendStopBytes(); espmega.iot->loadMqttConfig(); + espmega.iot->registerSubscribeCallback(&subscribeToIoTCallbacks); espmega.iot->connectToMqtt(); Serial.print("boot_state.txt=\"Display Initializing . . .\""); espmega.enableWebServer(80);