From 605eac89968a281e76ba85f9279ddfa43238483d Mon Sep 17 00:00:00 2001 From: Vegar Westerlund Date: Fri, 7 Jun 2019 22:51:00 +0200 Subject: [PATCH] Minor Wifi feather updates --- .../WifiFeatherRestBridge/WifiFeatherRestBridge.ino | 10 ++++------ Arduino Code/WifiFeatherRestBridge/arduino_secrets.h | 6 +++--- Arduino Code/WifiFeatherRestBridge/wifi_client.ino | 2 ++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Arduino Code/WifiFeatherRestBridge/WifiFeatherRestBridge.ino b/Arduino Code/WifiFeatherRestBridge/WifiFeatherRestBridge.ino index 0ec37bc5..f3e652be 100644 --- a/Arduino Code/WifiFeatherRestBridge/WifiFeatherRestBridge.ino +++ b/Arduino Code/WifiFeatherRestBridge/WifiFeatherRestBridge.ino @@ -28,13 +28,11 @@ void setup() { delay(100); // Initialize serial and wait for port to open: - Serial.begin(9600); - while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only - } + //Serial.begin(9600); + //while (!Serial) ; // wait for serial port to connect. Needed for native USB port only // Uncomment to debug over uart - debugger = &Serial; + //debugger = &Serial; if (debugger) debugger->print("Unwantingly wait 5"); // Allow programming during restart delay(1000); @@ -62,7 +60,7 @@ void setup() { while (true); } - //connect_wifi(); + connect_wifi(); hanReader.setup(&Serial1, debugger); diff --git a/Arduino Code/WifiFeatherRestBridge/arduino_secrets.h b/Arduino Code/WifiFeatherRestBridge/arduino_secrets.h index 2b6787e9..2cc94a7d 100644 --- a/Arduino Code/WifiFeatherRestBridge/arduino_secrets.h +++ b/Arduino Code/WifiFeatherRestBridge/arduino_secrets.h @@ -1,3 +1,3 @@ -#define SECRET_SSID "" -#define SECRET_PASS "" -#define AUTH_HEADER "Basic [base64-user:pass-string]" +#define SECRET_SSID "flyndrefisken" +#define SECRET_PASS "dzwe.lzgq.ztzs" +#define AUTH_HEADER "Basic dmVnYXJ3ZTpmaXNrZW4=" diff --git a/Arduino Code/WifiFeatherRestBridge/wifi_client.ino b/Arduino Code/WifiFeatherRestBridge/wifi_client.ino index b49cceb9..287c38ac 100644 --- a/Arduino Code/WifiFeatherRestBridge/wifi_client.ino +++ b/Arduino Code/WifiFeatherRestBridge/wifi_client.ino @@ -36,6 +36,7 @@ void connect_wifi() { Serial.print("Attempting to connect to SSID: "); Serial.println(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: + WiFi.disconnect(); int status = WiFi.begin(ssid, pass); if (status == WL_CONNECTED) { @@ -45,6 +46,7 @@ void connect_wifi() { // wait 1 seconds for connection: Serial.print("Waiting 1 before trying again. status: "); Serial.println(status); + yield(); delay(1000); }