esp8266 / esp8266/Arduino

Saved credentials problem and WPS eventually

Open
#3,128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

### Basic Infos

#### Hardware
Hardware: Amica NodeMCU ESP-12

### Description

Sometimes the modules doesn't connect.
A reset or a power off/on is requested.

### Sketch

```cpp

#include

void setup() {
WiFi.mode(WIFI_STA);
WiFi.begin(WiFi.SSID().c_str(),WiFi.psk().c_str()); // reading data from EPROM, last saved credentials
while (WiFi.status() != WL_CONNECTED) {
delay(1500);
Serial.print(".");
}

wl_status_t status = WiFi.status();
if(status == WL_CONNECTED) {
Serial.printf("\nConnected successfull to SSID '%s'\n", WiFi.SSID().c_str());
} else {
Serial.printf("\nCould not connect to WiFi. state='%d'", status);
Serial.println("Please press WPS button on your router.\n Press any key to continue...");
while(!Serial.available()) { ; }
if(!startWPSPBC()) {
Serial.println("Failed to connect with WPS :-(");
}
}
}

void loop() {

}
```

### Other

lots of dots on the serial console

Using the above code to switch to WPS in case credentials are not available, i've noticed that sometimes it works (right after 1-2 secs) sometimes it doesnt (keep showing dots).
Am i missing something? Why can't he find the credentials if after a simple reset it does?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.