diff --git a/LibreMetric.ino b/LibreMetric.ino index 1ca21f0..8a045f7 100644 --- a/LibreMetric.ino +++ b/LibreMetric.ino @@ -3,6 +3,8 @@ #include "config.h" //################# LIBRARIES ########################## +//#include +#include #include #include #include @@ -13,6 +15,7 @@ #include #include #include +//#include #include "OTAsetup.h" #include "d_helper.h" #include "FS.h" @@ -28,14 +31,12 @@ // CLK -> D5 (Same Pin for WEMOS) //################ PROGRAM SETTINGS #################### -String version = "0.1b"; +String version = "0.2b"; int PORT = 80; int wait = 50; int spacer = 1; int width = 5 + spacer; String SITE_WIDTH = "1000"; -int timezone = 1; -int dstOffset = 1; const char* ntpServer = "fr.pool.ntp.org"; int brightness = 16; int pinCS = D4; @@ -52,6 +53,10 @@ Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVe #ifdef DEBUG_TELNET WiFiServer telnetServer(23); WiFiClient telnetClient; +TimeChangeRule CET = {"CET", Last, Sun, Oct, 2, 60}; //UTC + 1 hour +TimeChangeRule CEST = {"CEST", Last, Sun, Mar, 2, 120}; //UTC + 2 hours +Timezone CentralEuropean(CET, CEST); + void handleTelnet(void) { if (telnetServer.hasClient()) { @@ -111,7 +116,7 @@ void setup() { DEBUG_PRINTLN(WiFi.localIP()); // First sync with NTP - configTime(timezone * 3600, dstOffset * 3600, ntpServer); // First sync of time with (S)NTP + configTime(0, 0, ntpServer); // First sync of time with (S)NTP in UTC // Initialise Telnet Server for debugging purposes #ifdef DEBUG_TELNET @@ -147,6 +152,7 @@ void loop() { // Getting and parsing the time time_t now = time(nullptr); + now = CentralEuropean.toLocal(now); String time = String(ctime(&now)); time.trim(); time.substring(11,19).toCharArray(time_value, 10); @@ -171,6 +177,8 @@ void loop() { matrix.setIntensity(brightness); brightness = 16; } + + // Managing OTA thing ArduinoOTA.handle(); #ifdef DEBUG_TELNET diff --git a/data/index.html b/data/index.html index 1b9c618..70f8a4d 100644 --- a/data/index.html +++ b/data/index.html @@ -81,12 +81,12 @@





-

LibreMetric v0.1b

+

LibreMetric v0.2b