-->
Page 1 of 3

ESP-01 won't connect to router using Arduino IDE

PostPosted: Thu Apr 16, 2015 10:39 pm
by Brad
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?

Re: ESP-01 won't connect to router using Arduino IDE

PostPosted: Fri Apr 17, 2015 10:46 am
by Brad
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.

Re: ESP-01 won't connect to router using Arduino IDE

PostPosted: Thu May 07, 2015 7:47 pm
by Brad
Still unable to get this to work. Anyone have any thoughts?

Re: ESP-01 won't connect to router using Arduino IDE

PostPosted: Thu May 07, 2015 11:35 pm
by Mikejstb
Don't know if this will help, but I've had connect problems to do with upper case vs lower case in my ssid.
My AP is "stb2008" but I can only connect if I use ""STB2008". Maybe try upper case?