Fix wifiman config and ntp activation
This commit is contained in:
parent
786d835ac0
commit
af8e9becbf
1 changed files with 14 additions and 9 deletions
23
src/main.cpp
23
src/main.cpp
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue