WiFi AP not found

deadmetaphor
Posts: 6
Joined: Tue Aug 11, 2015 2:41 pm

WiFi AP not found

Postby deadmetaphor » Mon Aug 31, 2015 8:09 pm

I am unable to connect to my WiFi AP, as I keep getting the following error:

Code: Select all

f 0, scandone
no AP1 found, reconnect after 1s
reconnect
f 0, scandone
no AP1 found, reconnect after 1s
reconnect
f -180, scandone


Note: AP1 is the AP name

I used the scan APIs to specifically search for this SSID, and strangely it does see the AP

Code: Select all

add if0
f 0, scandone
f 0, scandone
DEBUG: (3,"AP1",-52,"12:34:56:78:90:ab",1)
f -180, reconnect
scandone
f 0, scandone
no AP1 found, reconnect after 1s
reconnect


I have previously connected to the same AP, using the same code (although I had used several other firmwares on the same chip). I even tried the AT firmware, and I am able to scan for and connect to this particular AP.

Code: Select all

void user_init(void) {
   // Configure the UART
   uart_init(BIT_RATE_115200, BIT_RATE_115200);
   os_printf("\r\nDEBUG: SDK version:%s\n", system_get_sdk_version());
   os_printf("DEBUG: Autoconnect: %u\n", wifi_station_get_auto_connect());
   char ssid[32] = SSID;
   char password[64] = SSID_PASSWORD;
   struct station_config stationConf;

   //Set station mode
   wifi_set_opmode(STATION_MODE);

   //Set ap settings
   os_memcpy(&stationConf.ssid, ssid, 32);
   os_memcpy(&stationConf.password, password, 64);
   stationConf.bssid_set = 0;
   wifi_station_set_config(&stationConf);

   system_init_done_cb(user_scan);
}


The user_scan function is same as the second listing in http://bbs.espressif.com/viewtopic.php?f=21&t=229

WiFi status returned by wifi_station_get_connect_status() is STATION_NO_AP_FOUND

The serial output when it used to connect successfully is as follows (I am putting it here assuming that it might help Espressif guys)

Code: Select all

f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
pm open phy_2,type:2 0 0
cnt

connected with AP1, channel 1
dhcp client start...
ip:192.168.0.101,mask:255.255.255.0,gw:192.168.0.1
Mon Aug 31 16:33:15 2015


Any help will be useful :)

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: WiFi AP not found

Postby kolban » Mon Aug 31, 2015 9:32 pm

Hello there,
I had exactly the same thing happen to me over the weekend and I hunted to see what had changed. I spent a good long time on the puzzle but couldn't find any obvious reasons. On a wild hunch, I powered down my WiFi access point and then powered it back up. At that point, all started to work again. I'm not saying for one moment this will work for you, but it did for me ... and left me with an unresolved mystery.

deadmetaphor
Posts: 6
Joined: Tue Aug 11, 2015 2:41 pm

Re: WiFi AP not found

Postby deadmetaphor » Tue Sep 01, 2015 12:46 pm

Thanks kolban!

I reflashed esp_init_data_default.bin and restarted my router...and I was able to connect.

But on subsequent attempts I still have the same problem :?

I am guessing some setting is off somewhere, need to experiment a little more.

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: WiFi AP not found

Postby kolban » Tue Sep 01, 2015 12:59 pm

Does it work after a router restart?

deadmetaphor
Posts: 6
Joined: Tue Aug 11, 2015 2:41 pm

Re: WiFi AP not found

Postby deadmetaphor » Tue Sep 01, 2015 1:52 pm

It works sometimes after router restart (twice in 7 restarts).

But, I think I found the actual problem:

I flashed blank.bin to 0x7e000 and restarted. So far, I have been able to restart the chip twice and connect successfully. I even flash another firmware and it is working still. I'll test a few other scenarios just to be sure it is actually solved ;)

Was I always supposed to do this? (I mean, do it every time I flash a firmware)

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: WiFi AP not found

Postby ESP_Faye » Thu Sep 10, 2015 9:57 am

Hi,

blank.bin has to be downloaded into Flash as initialization.

Thanks for your interest in ESP8266 !

Daven007
Posts: 5
Joined: Mon Sep 07, 2015 3:47 pm

Re: WiFi AP not found

Postby Daven007 » Tue Nov 03, 2015 5:39 pm

Hi, I had a very similar problem when I upgraded my router (EE Brightbox). None of the ESPs would connect to the new router but had been working for months with the old one (NB other items such as laptop and android phones connected OK to this new router).

I have just reinitialised, as suggested, a test projectthat had also stopped working; and that now works. It would be very helpful if you could explain why we need to reinitialise as I now need to go round and reprogramme several systems and would like to avoid having to do this again by dealing with the issue in software.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: WiFi AP not found

Postby ESP_Faye » Wed Nov 04, 2015 2:13 pm

Hi,

Here is an example of ESP8266 station connects to router http://bbs.espressif.com/viewtopic.php?f=31&t=228.

Please notice to set the parameter stationConf.bssid_set to be 0, otherwise it will check the MAC address of AP.

Who is online

Users browsing this forum: No registered users and 139 guests