Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saved credentials problem and WPS eventually #3128

Open
maxdd opened this issue Apr 10, 2017 · 0 comments
Open

Saved credentials problem and WPS eventually #3128

maxdd opened this issue Apr 10, 2017 · 0 comments

Comments

@maxdd
Copy link

maxdd commented Apr 10, 2017

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

#include <Arduino.h>

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?

@maxdd maxdd mentioned this issue Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant