We have a device where we would like to always have a default wifi network configured. On the P1 we can do this:
// Check that default WiFi is configured
WiFiAccessPoint ap[5];
int found = WiFi.getCredentials(ap, 5);
bool defaultWifiOK=false;
for (int i = 0; i < found; i++) {
if (strcmp(ap[i].ssid,prefix)==0) defaultWifiOK=true;
}
if (!defaultWifiOK) {
WiFi.setCredentials(prefix, prefix, WPA2, WLAN_CIPHER_AES_TKIP);
}
On the P2, i can not get this to work.
How many networks can we store in the P2? In the P1 i believe it was 5.
How can i make sure that the default wifi is always configured, and still have room for at least 1 other network?