mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-17 09:02:11 +00:00
Minor Wifi feather updates
This commit is contained in:
parent
643c9a5e20
commit
605eac8996
@ -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);
|
||||
|
||||
|
||||
@ -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="
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user