Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Brad
#14760 Hi guys, I've been at this a couple of days now, but am at a loss. It all worked fine for a while, then just stopped after a recompile/upload a few nights ago. It worked fine one time, then wouldn't work the next. Now it just sits there printing dots.

It was working fine before, so I know it is working. I can blink an LED using uploaded code, and if I reflash the nodemcu firmware I can connect to the router right away. Can anyone help?

Code: Select all#include <ESP8266WiFi.h>

const char* ssid = "Test_Network";
const char* password = "password";

// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);

void setup() {
  Serial.begin(115200);
  delay(10000);
 
  // prepare GPIO2
  pinMode(2, OUTPUT);
  digitalWrite(2, 0);
 
  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }


As you can see, the code is exactly from the example except for the delay. I changed that so I could get the serial monitor open before the code executes on upload.

I've copied my network SSID and password directly from the lua files, and compared them many times. I know that part is correct.

Any ideas?
User avatar
By Brad
#14837 Did some more testing on this. I set up debug versions of ESP8266WiFi.h and ESP8266WiFi.cpp to provide more descriptive serial messages.

When trying to connect to my router with SSID broadcasting off, I get the status WL_NO_SSID_AVAIL returned. With SSID broadcasting turned on, I get the return status WL_CONNECT_FAILED.

In my debug files I split the following line so that connection and password are their own conditions.
Code: Select allelse if (status == STATION_CONNECT_FAIL || status == STATION_WRONG_PASSWORD)


I'm at a loss, but I'll keep digging. Any help would be appreciated.