Fix wifiman config and ntp activation

This commit is contained in:
Carsten Schmiemann 2022-11-13 19:20:46 +01:00
parent 786d835ac0
commit af8e9becbf

View file

@ -506,6 +506,8 @@ void setup() {
json["display_language"] = display_lang;
json["time_zone"] = time_zone;
json["time_server"] = time_server;
json["show_graph"] = show_graph;
json["show_statistics"] = show_statistics;
File configFile = Flash.open("/config.json", "w");
if (!configFile) {
@ -523,15 +525,18 @@ void setup() {
//end save
}
//NTP setup
#ifdef ESP32
configTime(0, 0, time_server);
setenv("TZ", time_zone, 1);
tzset();
#endif
#ifdef ESP8266
configTime(time_zone, time_server);
#endif
if (display_conf_time_present)
{
//NTP setup
#ifdef ESP32
configTime(0, 0, time_server);
setenv("TZ", time_zone, 1);
tzset();
#endif
#ifdef ESP8266
configTime(time_zone, time_server);
#endif
}
delay(1000); //for screen display