Skip to content

Commit

Permalink
CONST added for reboot time
Browse files Browse the repository at this point in the history
  • Loading branch information
redakker committed Nov 22, 2023
1 parent 0cd2092 commit 43bb13a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// Network
#define WIFI_MAX_TRY 10
#define WIFI_OFF_REBOOT_TIME 5*60*1000 // If SSID is configured, but still AP is created restart after this time. Ex: Wifi router is gone -> device goes to AP mode. Without this it never tries to connect again. Just after a reboot
#define AP_IP {192, 168, 4, 1} // Change together with the string version
#define AP_IP_STRING "192.168.4.1" // Change together with the object version
#define AP_NETMASK {255, 255, 255, 0}
Expand Down
4 changes: 2 additions & 2 deletions src/webcontent.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ BLEcker
<a class="button w100" href="/">home</a>
<a class="button w100" href="/update">update</a>
<!--<a class="button w100 button-danger" id="reset" href="#">reset</a>-->
<div class="version" id="version">v1.11 - 175</div>
<div class="version" id="version">v1.11 - 176</div>
<div class="version" id="chip"></div>
<div id="footer">
<div><a href="https://github.com/redakker/blecker" target="_blank">blecker</a></div>
Expand Down Expand Up @@ -1564,7 +1564,7 @@ BLEcker
<a class="button w100" href="/">home</a>
<a class="button w100" href="/update">update</a>
<!--<a class="button w100 button-danger" id="reset" href="#">reset</a>-->
<div class="version" id="version">v1.11 - 175</div>
<div class="version" id="version">v1.11 - 176</div>
<div id="footer">
<div><a href="https://github.com/redakker/blecker" target="_blank">blecker</a></div>
</div>
Expand Down
8 changes: 3 additions & 5 deletions src/wifinetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,9 @@ void WifiNetwork::wifiConnectedLoop() {

// while wifi is not connected
void WifiNetwork::wifiDisconnectedLoop() {
// Try to reconnect time to time
// TODO
if ((millis() - APstart) > (5 * 60 * 1000)) { // 5 min
if (ssid.length() > 0) {
//this -> connectToAP();
// Try to reconnect time to time
if ((millis() - APstart) > WIFI_OFF_REBOOT_TIME) {
if (ssid.length() > 0) {
ESP.restart();
}
}
Expand Down

0 comments on commit 43bb13a

Please sign in to comment.