Wifi Robustness

Reconnect if lost
This commit is contained in:
jameswood 2015-08-31 22:06:38 +10:00
parent 131c1dc673
commit 7c84e3be18
1 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,11 @@ void setup() {
Serial.begin(115200);
delay(10);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
getOnline();
}
void getOnline(){
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(":) ");
}
@ -52,6 +56,7 @@ void setup() {
}
void loop() {
if(WiFi.status() != WL_CONNECTED) getOnline();
client.loop();
if (motorJammed == true) botMode = 3;
switch (botMode) {