obehr / esp32-wordclock

0 stars 0 forks source link

NTP use is offered in offline mode #4

Open swede89 opened 5 years ago

swede89 commented 5 years ago

The clock should only support non-ntp operation in AP mode

swede89 commented 5 years ago

Steps to solve this issue:

  1. create additional settingsAP.html that excludes the option line „NTP usage (yes/no)“
  2. adapt the function void createCustomRoute(WebServer *server)
    • add parameter String file
    • replace "/settings.html" by parameter variable name file
  3. update function calls „createCustomRoute“ to run it for
    • API using parameter "/settings.html" and
    • AP using parameter "/settingsAP.html"
  4. update function void checkConfig(boolean init)
    • update line where ntpUse is retrieved to set boolean tempNtpUse ...
    • strcmp(config.ntpUse, "yes") == 0 and configManager.getMode() == 1
    • we might also consider checking the connected state WiFi.status() == WL_CONNECTED;
    • we might also consider combining this check with the checkWifi function to avoid repetition
swede89 commented 5 years ago

1., 2. and 3. dont work.

  1. is available in branch bugfixOfflineMode