WiFi.setCredential sometimes fail to set credential

Tags: #<Tag:0x00007fe21fb57148>


Breathing green means that your device is connected to WiFi but hasn’t attempted to connect to the cloud yet - you need to issue a Particle.connect() command.

Blinking cyan is not connected but connecting :wink:


One of MiFi box security is set to “WPA2 Personal PSK(AES)”.

So Does it must require to pass this command?

WiFi.setCredentials("SSID", "PASSWORD", WPA2, WLAN_CIPHER_AES);

Using below command sometimes it works and sometimes it gives error of fail to set credential.

WiFi.setCredentials(ssid, password);


Please any can guide me on this?

Because same network work with SSID, PASSWORD but some times not.


I tried same but it still stored previous wifi credentials.

Do you think it’s good option to use EEPROM.clear() before credentials clear?


No EEPROM.clear() has nothing to do with wifi credentials.


then Is there any option to clear credential from short term memory without power on reset?


You can try adding WiFi.off(); delay(500); WiFi.on(); delay(500); before your WiFi.clearCredentials() call.


Just tried. Not helpful. :disappointed:



got solution.


It require wifi disconnect after clear credentials by that way it will clear credentials from short term memory also.