AP+STA connectivity loss.

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

AP+STA connectivity loss.

Postby iothing » Thu Jul 02, 2015 8:22 am

There seems to be a bug in the AP+STA mode. When the ap the esp8266 is connected to as client stops operation/is turned off the clients that are connected to the esp8266 AP lose reliable connectivity also. Sometimes it works for a second, then the connection is dropped.

The problem seems to be that the esp8266 tries to reconnect in 1s intervals:

Code: Select all

398728> Wifi disconnected from ssid lambda, reason beacon_timeout (200)
398728> f -240, scandone
400861> Wifi disconnected from ssid lambda, reason no_ap_found (201)
400861> no lambda found, reconnect after 1s
400963> reconnect
400963> f 0, scandone
403094> Wifi disconnected from ssid lambda, reason no_ap_found (201)
403094> no lambda found, reconnect after 1s
403196> reconnect
403196> f -240, scandone
405327> Wifi disconnected from ssid lambda, reason no_ap_found (201)
405328> no lambda found, reconnect after 1s
405429> reconnect
405430> f 0, scandone
407568> Wifi disconnected from ssid lambda, reason no_ap_found (201)
407568> no lambda found, reconnect after 1s
407670> reconnect
407670> f -240,


Maybe it is possible to set the interval to a higher value? The SDK documentation did not help, and I also do not want to completely disable reconnects by means of wifi_station_set_reconnect_policy();

The idea is that the user can reconfigure/fix wifi settings by connecting to the esp8266 AP. But we also do not want to switch to AP-only mode because it may still be possible that the AP is just temporary off the grid.

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

Re: AP+STA connectivity loss.

Postby ESP_Faye » Thu Jul 02, 2015 9:56 am

Hi,

Sorry for the inconvenience.

Please use SDK_v1.1.2 and update to this patch http://bbs.espressif.com/viewtopic.php?f=5&t=608 , try again if your problem is solved or not.

Thanks for your interest in Espressif Systems and ESP8266 !

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

Re: AP+STA connectivity loss.

Postby iothing » Thu Jul 02, 2015 11:31 am

Hey, I use both already :)

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

Re: AP+STA connectivity loss.

Postby iothing » Thu Jul 02, 2015 11:37 am

Btw: When the password of the ap that esp8266 tries to connect to is incorrect it takes more time for the esp8266 to notice: here the connectivity of clients connected to esp8266 is more stable. Maybe too many interrupts due to intense scan activity?

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

Re: AP+STA connectivity loss.

Postby ESP_Faye » Thu Jul 02, 2015 11:55 am

Hi,

Sorry that I can‘t duplicate your problem..

Could you provide more details about your test steps and offer your test code ?

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

Re: AP+STA connectivity loss.

Postby iothing » Fri Jul 03, 2015 11:10 pm

Hmm maybe I was not very clear:

Definition:
ap1: a normal accesspoint with wpa2 security enabled.
ap2: the ap of the esp8266 in AP+STA mode.
client1: some smartphone or computer

Steps to reproduce:

1. Set up esp8266 esp-01 in AP+STA mode, wifi_station_set_reconnect_policy(true)
2. Let esp8266 connect to ap1 successfully
3. Use a smartphone or computer to connect to ap2
4. Remove power from ap1
5. client1 gets disconnected from ap2 over and over, interval ~1 second.

More info: If power is applied again to ap1, client1 has again stable connection to ap2

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

Re: AP+STA connectivity loss.

Postby ESP_Faye » Mon Jul 06, 2015 1:57 pm

Hi,

According to the log you provided, it seems that your router's SSID is "lambda"

Case 1 ESP8266 station connect to AP

Code: Select all

405328> no lambda found, reconnect after 1s

This means ESP8266 station can't find router "lambda", ESP8266 station is trying to reconnect to the router every 1s

Case 2 a station connect to ESP8266 softAP

Code: Select all

station: 88:70:8c:41:4f:59 join, AID = 1

This log will mean a station connected to ESP8266 softAP, I think this will be the client 1 connect to ap2, in your example. And

Code: Select all

station: 88:70:8c:41:4f:59 leave, AID = 1

This log will mean a station disconnected from ESP8266 softAP.

There is no case 2 sentence in your log,did you misunderstand the disconnect between case 1 and case 2 ?

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

Re: AP+STA connectivity loss.

Postby iothing » Mon Jul 06, 2015 7:28 pm

Hi,

client1 is not deassociated from ap2 but sending and receiving data (esp-link httpd) is not possible or very slow. That was what is described as "lose reliable connectivity". Sorry if this was not clear.

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

Re: AP+STA connectivity loss.

Postby ESP_Faye » Tue Jul 07, 2015 10:31 am

Hi,

You mean TCP connection or UDP transmission ?

Yes,it may happen. This is the limitation that even though ESP8266 can work in station+softAP mode, it actually only has one hardware channel.

So when ESP8266 station is trying to find a target AP, it will scan on every channel, that means ESP8266 station is changing its channel to scan. This makes the channel of ESP8266 softAP is keep changing too..

So the connection may break..

You can set a timer to disable the reconnect of ESP8266 station, call wifi_station_disconnect it will stop connecting. Or call wifi_station_set_reconnect_policy and wifi_station_set_auto_connect to disable reconnect.

iothing
Posts: 8
Joined: Thu Jul 02, 2015 8:08 am

Re: AP+STA connectivity loss.

Postby iothing » Tue Jul 07, 2015 8:35 pm

It's tcp. What you suggested I did already as a workaround. Could you kindly add a function wifi_station_set_reconnect_interval(seconds) so that we don't need this workaround?

Who is online

Users browsing this forum: No registered users and 2 guests