aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Fincham <michael@hotplate.co.nz>2016-11-03 16:46:20 +1300
committerMichael Fincham <michael@hotplate.co.nz>2016-11-03 16:46:20 +1300
commit001a3897a549c7e6d01cde79dc535ff9c8f73892 (patch)
treede669dfe91f6509c450830cea0f63e37435cfe98
parent88fb90ab0b8f2095ffee86e20ce4dbb1aa8f4a27 (diff)
downloadkiwiconx-001a3897a549c7e6d01cde79dc535ff9c8f73892.tar.gz
kiwiconx-001a3897a549c7e6d01cde79dc535ff9c8f73892.tar.bz2
kiwiconx-001a3897a549c7e6d01cde79dc535ff9c8f73892.zip
Prod version as deployed on pagers
-rw-r--r--badges/code/pager/pager/pager.ino7
1 files changed, 5 insertions, 2 deletions
diff --git a/badges/code/pager/pager/pager.ino b/badges/code/pager/pager/pager.ino
index b7e3014..d848fb5 100644
--- a/badges/code/pager/pager/pager.ino
+++ b/badges/code/pager/pager/pager.ino
@@ -17,6 +17,7 @@ const char* password = "ilikeotters";
const int backlight_time = 60000; // in millis
const int wifi_time = 10000; // in millis
+const int scan_time = 30000; // in millis
const int default_contrast = 45; // usable range 30 - 60
const int number_of_blinks = 100;
@@ -43,6 +44,8 @@ int backlight_blink_count = number_of_blinks;
int backlight_status = HIGH;
unsigned long backlight_timeout = millis();
unsigned long wifi_timeout = 0;
+unsigned long scan_timeout = 0;
+
bool wifi_working = false;
bool directory_dirty = true;
@@ -485,8 +488,8 @@ void timers() {
}
- if (WiFi.status() == 1 && millis() > wifi_timeout + wifi_time) {
- wifi_timeout = millis();
+ if ((WiFi.status() == 1 || WiFi.status() > 3) && millis() > (scan_timeout + scan_time)) {
+ scan_timeout = millis();
Serial.println("Forcing a WiFi re-scan...");
WiFi.reconnect();
}