I am running this program on a Photon with firmware v0.6.0, and two of the wifi credentials fail to save. It seems like entering in an SSID, password, and specifying WEP works just fine. However, negating the third option or replacing it with WPA2 causes it to fail. If you only specify an SSID it works fine, and if you specify a cipher for WPA2 it seems to also work. This problem also occurs with system mode AUTOMATIC. I tried to use as much demo code from the reference guide as possible.
My demo code as follows:
void setup()
{
delay(2000);
WiFi.on();
WiFi.clearCredentials();
WiFi.setCredentials("My_Router_Is_Big"); //stored
WiFi.setCredentials("My_Router1", "mypasswordishuge"); //failed
WiFi.setCredentials("My_Router2", "wepistheworst", WEP); //stored
WiFi.setCredentials("My_Router3", "wepistheworst", WPA2); //failed
WiFi.setCredentials("SSID", "PASSWORD", WPA2, WLAN_CIPHER_AES); //stored
Serial.begin(9600);
WiFiAccessPoint ap[5];
int found = WiFi.getCredentials(ap, 5);
Serial.printlnf("Stored Credentials: %d", found);
for (int i = 0; i < found; i++)
{
Serial.print("ssid: ");
Serial.println(ap[i].ssid);
// security is one of WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA, WLAN_SEC_WPA2
Serial.print("security: ");
Serial.println(ap[i].security);
// cipher is one of WLAN_CIPHER_AES, WLAN_CIPHER_TKIP
Serial.print("cipher: ");
Serial.println(ap[i].cipher);
}
}
void loop()
{
}
Here is the output of the code above:
ssid: SSID
security: 3
cipher: 1
ssid: My_Router2
security: 1
cipher: 0
ssid: My_Router_Is_Big
security: 0
cipher: 0
Thanks for the help!