WiFi.setCredential sometimes fail to set credential

photon
Tags: #<Tag:0x00007fe21fb57148>

#21

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:


#22

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);

#23

Please any can guide me on this?

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


#24

I tried same but it still stored previous wifi credentials.

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


#25

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


#26

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


#27

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


#28

Just tried. Not helpful. :disappointed:


#29

Hey

got solution.

WiFi.clearCredentials();
WiFi.disconnect();

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