Skip to content

Commit

Permalink
Fix: Change default NTP server
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Mar 31, 2024
1 parent eff8d52 commit 6f3b8fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <cstdint>

#define CONFIG_FILENAME "/config.json"
#define CONFIG_VERSION 0x00011b00 // 0.1.27 // make sure to clean all after change
#define CONFIG_VERSION 0x00011c00 // 0.1.28 // make sure to clean all after change

#define WIFI_MAX_SSID_STRLEN 32
#define WIFI_MAX_PASSWORD_STRLEN 64
Expand Down
3 changes: 2 additions & 1 deletion include/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

#define MDNS_ENABLED false

#define NTP_SERVER "pool.ntp.org"
#define NTP_SERVER_OLD "pool.ntp.org"
#define NTP_SERVER "opendtu.pool.ntp.org"
#define NTP_TIMEZONE "CET-1CEST,M3.5.0,M10.5.0/3"
#define NTP_TIMEZONEDESCR "Europe/Berlin"
#define NTP_LONGITUDE 10.4515f
Expand Down
6 changes: 6 additions & 0 deletions src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ void ConfigurationClass::migrate()
config.Dtu.Cmt.Frequency *= 1000;
}

if (config.Cfg.Version < 0x00011c00) {
if (!strcmp(config.Ntp.Server, NTP_SERVER_OLD)) {
strlcpy(config.Ntp.Server, NTP_SERVER, sizeof(config.Ntp.Server));
}
}

f.close();

config.Cfg.Version = CONFIG_VERSION;
Expand Down

0 comments on commit 6f3b8fb

Please sign in to comment.