You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I've noticed that if my router is power cycled that the PicoPi either doesn't reconnect to the router or HA (not sure which yet). Not sure if this issue is best addressed by this project or the upstream arduino-home-assistant project.
The text was updated successfully, but these errors were encountered:
Entirely possible this implementation doesn't handle reconnects well, but impossible to say more without some basic investigation legwork done first. With the device connected to your machine so you can view the console, add some logging around the various network events. You can also enable debug logging for arduino-home-assistant:
#defineARDUINOHA_DEBUG
Add that BEFORE the a-h-a library is imported.
Then deliberately power cycle your router and see what happens.
I have a solution to this issue, I'm not sure if its the best way to do it but it seems to be working. I modified Network.cpp so that is looks like this:
#include<WiFi.h>
#include"Network.h"
#include"Credentials.h"uint8_t status;
voidNetwork::connect() {
do {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(WIFI_SSID);
// Connect to WPA/WPA2 network:
status = WiFi.begin(WIFI_SSID, WIFI_PASSWORD); //Set these credentials// wait to connect:delay(5000);
} while (status != WL_CONNECTED);
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
}
voidNetwork::disconnect() {
do {
Serial.println("Attempting to disconnect from WiFi");
status = WiFi.disconnect();
delay(1000);
} while (status != WL_DISCONNECTED);
Serial.print("Disconnected from ");
Serial.println(WIFI_SSID);
}
Recently I've noticed that if my router is power cycled that the PicoPi either doesn't reconnect to the router or HA (not sure which yet). Not sure if this issue is best addressed by this project or the upstream arduino-home-assistant project.
The text was updated successfully, but these errors were encountered: