diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 7b0c684..790d02f 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -286,6 +286,7 @@ const char HTMLheader[] PROGMEM = R"EOF(
  • WiFi settings
  • Help
  • +
  • @@ -833,6 +834,7 @@ void wifiConnect() { Serial.println(":: Getting time from NTP ::"); timeClient.begin(); + timeClient.setTimeOffset(ntpOffset * 60 * 60); timeClient.update(); while ( ! timeClient.isTimeSet()) { timeClient.update(); @@ -1073,7 +1075,8 @@ void WebHandler() { void WebRestart() { String body = FPSTR(HTMLheader); - if(NeedRestart == true) { + // TODO only debug and development solution, remove this later + if(true) { body += "

    Restarting

    "; body += "
    After restart CanGrow will be connected to WiFi SSID
    "; body += WIFIssid; @@ -1123,19 +1126,28 @@ void WebAuthApi() { // returns footer with javascript stuff String returnHTMLfooter() { String footer; + + // add replaceStr javascript function from PROGMEM + // first is dst ID, second is content (&#.. is a seedling emoji ) + footer += FPSTR(JSreplaceStr); + // print actual time in header + footer += ""; + // show the GrowName in the menu if set if(strlen(GrowName) > 0){ - // add replaceStr javascript function from PROGMEM - // first is dst ID, second is content (&#.. is a seedling emoji ) - footer += FPSTR(JSreplaceStr); + footer += ""; + footer += "';"; + footer += ""; } footer += FPSTR(HTMLfooter); @@ -1245,7 +1257,6 @@ void WEBroot() { body += "

    🌱 "; body += GrowName; body += "

    "; - body += "

    "; body += "Grow started: "; body += returnStrDateFromEpoch(GrowStart); body += "
    "; @@ -1295,7 +1306,7 @@ void WEBroot() { body += ""; - body += "

    "; + body += returnHTMLfooter(); @@ -1431,7 +1442,7 @@ void WEBsystemSettings() { body += "
    \n"; // ntpOffset int - body += "NTP offset:
    \n"; @@ -1642,6 +1653,10 @@ void POSTsystemSettings() { EEPROM.commit(); + // update time with new offset + timeClient.setTimeOffset(ntpOffset * 60 * 60); + timeClient.update(); + Serial.println(":: POSTsystemSettings ::"); Serial.print("configured: ");