|
|
@ -201,6 +201,13 @@ void wifiConnect() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool obtain_time() { |
|
|
|
ESP_LOGI(TAG, "syncing time"); |
|
|
|
configTzTime("CET-1CEST,M3.5.0/2,M10.5.0/3", "de.pool.ntp.org"); |
|
|
|
struct tm timeinfo; |
|
|
|
return getLocalTime(&timeinfo, 5000); |
|
|
|
} |
|
|
|
|
|
|
|
void helloWorld() |
|
|
|
{ |
|
|
|
const char HelloWorld[] = "IchbinsBens!"; |
|
|
@ -747,6 +754,7 @@ void setup() |
|
|
|
// wakeup not caused by deep sleep
|
|
|
|
display.clearScreen(); |
|
|
|
display.refresh(); |
|
|
|
lastDisplayRefresh = getTimestamp(); |
|
|
|
helloWorld(); |
|
|
|
display.powerOff(); |
|
|
|
} else { |
|
|
@ -760,10 +768,11 @@ void setup() |
|
|
|
wifiConnect(); |
|
|
|
|
|
|
|
WiFi.waitForConnectResult(); |
|
|
|
//displayIcoPartial(ico_wifi16, display.width()-20, y_offset+0, ico_wifi16_width, ico_wifi16_height);
|
|
|
|
displayIcoPartial(ico_wifi16, display.width()-20, y_offset+0, ico_wifi16_width, ico_wifi16_height); |
|
|
|
|
|
|
|
if (wakeup_reason == ESP_SLEEP_WAKEUP_UNDEFINED || bootCount == 1) { |
|
|
|
// wakeup not caused by deep sleep
|
|
|
|
obtain_time(); |
|
|
|
ESP_LOGD(TAG, "trying to fetch over-the-air update"); |
|
|
|
if (WiFi.status() == WL_CONNECTED) { |
|
|
|
ota.update(); |
|
|
|