update time from NTP

This commit is contained in:
reaw55 2024-04-22 22:55:51 +07:00
parent 553eae0566
commit 980687b154

View file

@ -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);