Fixes for NTP.

master
Holger Wirtz 4 years ago
parent 7a8580d9ab
commit d9fdb64204
  1. 8
      WLAN_Thermometer.ino

@ -26,7 +26,8 @@
#define KRATE_RESET_AP_DATA 5000
#define KRATE_CHECK_DATETIME 250000
#define ONBOARD_LED 2
#define NTP_TIMEOUT 15000
#define NTP_TIMEOUT 30000
#define NTP_SERVER "time.fu-berlin.de"
#define WIFI_CONNECT_TIMEOUT 30
#define CFG_PORTAL_TIMEOUT 90
#define DHTTYPE DHT22
@ -105,7 +106,7 @@ void setup()
lcd.print(F("Failed "));
DEBUG_MSG("Failed to connect\n");
delay(1000);
lcd.setCursor(8, 2);
lcd.setCursor(7, 2);
lcd.print(F("- restart"));
delay(1000);
ESP.restart();
@ -134,7 +135,8 @@ void setup()
lcd.setCursor(0, 3);
lcd.print("Getting time...");
DateTime.setTimeZone(1);
DateTime.begin();
DateTime.setServer(NTP_SERVER);
DateTime.begin(NTP_TIMEOUT);
/* while (!DateTime.isTimeValid())
{
DEBUG_MSG("Failed to get time from server.\n");

Loading…
Cancel
Save