From 0cd773058c54578bb54247f07beb7a998df2b74f Mon Sep 17 00:00:00 2001 From: Daniel Eichhorn Date: Thu, 17 Aug 2017 08:23:00 +0200 Subject: [PATCH] Fix time synchronization (1970 00:00:00) issue --- esp8266-weather-station-color.ino | 5 ++--- settings.h | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/esp8266-weather-station-color.ino b/esp8266-weather-station-color.ino index eada7ea..6d7cf27 100644 --- a/esp8266-weather-station-color.ino +++ b/esp8266-weather-station-color.ino @@ -156,6 +156,7 @@ void setup() { gfx.fillBuffer(MINI_BLACK); gfx.commit(); + connectWifi(); ts.begin(); @@ -248,8 +249,7 @@ void loop() { // Update the internet based information and update screen void updateData() { - WiFi.mode(WIFI_STA); - connectWifi(); + gfx.fillBuffer(MINI_BLACK); gfx.setFont(ArialRoundedMTBold_14); @@ -275,7 +275,6 @@ void updateData() { astronomyClient = nullptr; moonAgeImage = String((char) (65 + 26 * (((15 + astronomy.moonAge.toInt()) % 30) / 30.0))); - WiFi.mode(WIFI_OFF); delay(1000); } diff --git a/settings.h b/settings.h index 265f53a..fa090fe 100644 --- a/settings.h +++ b/settings.h @@ -24,7 +24,7 @@ See more at http://blog.squix.ch #define WIFI_SSID "yourssid" #define WIFI_PASS "yourpassw0rd" -const int UPDATE_INTERVAL_SECS = 10 * 60; // Update every 10 minutes +const int UPDATE_INTERVAL_SECS = 15 * 60; // Update every 10 minutes const int SLEEP_INTERVAL_SECS = 0; // Going to Sleep after idle times, set 0 for dont sleep @@ -45,8 +45,8 @@ const int SLEEP_INTERVAL_SECS = 0; // Going to Sleep after idle times, set 0 f // e.g. http://api.wunderground.com/api/808ba87ed77c4511/conditions/q/CH/Zurich.json // e.g. http://api.wunderground.com/api/808ba87ed77c4511/conditions/q/CA/SAN_FRANCISCO.json <- note that in the US you use the state instead of country code -const String DISPLAYED_CITY_NAME = "Zürich"; -const String WUNDERGRROUND_API_KEY = ""; +const String DISPLAYED_CITY_NAME = "Zurich"; +const String WUNDERGRROUND_API_KEY = ""; const String WUNDERGRROUND_LANGUAGE = "EN"; const String WUNDERGROUND_COUNTRY = "CH"; const String WUNDERGROUND_CITY = "Zurich";