I have two P2 and one Argon board that somehow got damaged. Everything seems to work fine, except they won't take any WiFi credentials.
The Argon is on OS 4.0.2 and the P2s on 5.3.1. The example below is taken from a P2, but the same is happening with the Argon
Attempting to set credentials over CLI fails with a time-out error:
> particle serial wifi
? Should I scan for nearby Wi-Fi networks? Yes
? SSID XXXXXX
? Security Type WPA2
? Cipher Type AES
? Wi-Fi Password xxxx
! Something went wrong: Serial timed out
Attempting to set up the credentials in code like this:
Serial.println("Checking for credentials");
WiFi.disconnect();
for(uint32_t ms = millis(); millis() - ms < 5000; Particle.process());
if (!WiFi.hasCredentials()){
Serial.println("No Credentials. Setting up new credentials");
if (WiFi.clearCredentials()){
Serial.println("Credentials cleared successfully");
}else{
Serial.println("Failed to clear credentials!");
}
if (WiFi.setCredentials("XXXXXXX","xxxxxxx")){
Serial.println("New credentials set successfully");
}else{
Serial.println("Failed to set new credentials!");
}
for(uint32_t ms = millis(); millis() - ms < 2000; Particle.process());
}
//Do we have WiFi credentials?
if (WiFi.hasCredentials()){
Serial.println("Trying to connect");
tryToConnect(20);//First attempt, try for 20 seconds
if (Particle.connected()){
Serial.println("Connected");
}else{
Serial.println("Could not connect");
}
}else{
Serial.println("No WiFi credentials");
}
Also fails. Output on terminal is:
Checking for credentials
No Credentials. Setting up new credentials
Failed to clear credentials!
Failed to set new credentials!
No WiFi credentials
The WiFi module seems to be working, as I can scan the visible SSIDs over Bluetooth, but it also fails to retrieve the list of networks over Serial in the CLI
Questions:
Is there a way to recover these boards?
What could have caused this to happen?