WIFI re-connection issue

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

WIFI re-connection issue

Postby muris » Sat Nov 08, 2014 4:35 pm

ESP8266EX is in STATION mode. I am using 0.9.2 SDK and lubuntu to build.

1. When module connects to WIFI AP for the first time after power-up, everything works perfect.
2. When I shut down my WIFI AP the module detects and starts reconnecting internally...
3. When I turn my WIFI AP back ON, the module reconnects and detects that it is connected, and that it got IP again. All is good.
4. Now after ~59seconds the module looses WIFI connection and reconnects. This happens forever...

Did anybody try this? Is there some special procedure that needs to be carried on when ESP8266EX re-connects to WIFI AP? Maybe some internal timer to be cleared?

Thanks

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: WIFI re-connection issue

Postby costaud » Sat Nov 08, 2014 11:18 pm

Hey, could you please tell me which project did you build on , iot demo or AT demo?

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: WIFI re-connection issue

Postby muris » Sun Nov 09, 2014 1:44 am

Hi,

I built on IoT_Demo app. Actually I removed ALL code but left only the "check_ip" timer part.

You can try this very simple code on your ESP8266EX module and see what happens: http://www.elektronika.ba/wifi_problem.rar

It is a project that can be compiled on lubuntu environment with SDK 0.9.2. Test it out and see what happens. The WIFI connection will break after ~58 seconds once module re-connects to WIFI. If it only connects initially everything works, so after it initially connects, restart your AP and see what happens once module restores its WIFI connection to AP. You can see result on UART0 port.

Maybe there is a serious problem with this chip, but I hope I am just doing something wrong.

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: WIFI re-connection issue

Postby muris » Mon Nov 10, 2014 10:39 pm

@costaud, did you test this WIFI issue?

Thanks

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: WIFI re-connection issue

Postby costaud » Tue Nov 11, 2014 2:05 am

muris wrote:@costaud, did you test this WIFI issue?

Thanks

Can't download your project all the time , would you please upload it here ?
But we test the light demo within the SDK , it works properly when turning the AP on or off.

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: WIFI re-connection issue

Postby muris » Tue Nov 11, 2014 2:32 am

I uploaded it here also. Please check it out.

Maybe IoT_Demo doesn't require persistent constant TCP Socket connection with server, or your code is written in a way where re-connections are not a problem.

Please try my code and you will see that the problem is there. I will be waiting for your reply.

Set your WIFI SSID and PASS in ctrl_platform.c file:

Code: Select all

   os_sprintf(stationConf.ssid, "%s", "YOUR_WIFI_SSID");
   os_sprintf(stationConf.password, "%s", "YOUR_WIFI_PASSWORD");


and try this test:

1. When chip turns ON it will connect to WIFI and everything will be OK.
2. Turn your AP off. The ESP will detect WIFI connection break and try re-connecting.
3. Turn your AP on. The ESP will soon detect WIFI and connect.
4. Now, ESP will re-connect every ~58 seconds! That is a big problem.


Thanks!
Attachments
wifi_problem.zip
Code with WIFI problem with re-connect!
(37.61 KiB) Downloaded 639 times

jackon
Posts: 28
Joined: Thu Oct 23, 2014 9:05 am

Re: WIFI re-connection issue

Postby jackon » Tue Nov 11, 2014 7:41 pm

hi,muris
After you got ip, do you send any packets to AP?
If not, AP will deauth you after a specific time, the time depends on your AP's configration, in your case, it's 1min.
So, please make sure to send a packet out within this time limitation.
Have a try, and let me know.

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: WIFI re-connection issue

Postby muris » Wed Nov 12, 2014 2:13 am

Hello,

If my AP deauth's the ESP8266 on re-connect, how come it doesn't deauth on first connect even when I dont' send any data?

OK, I have tested it and it kills my connection even when I send TCP packets. It does that even faster, in only ~22 seconds when I send some TCP packets!

Here is my full code that you can try: https://github.com/elektronika-ba/ctrl-esp8266-test and watch UART0 for log. Just make sure you enter your WIFI SSID and PWD "/user/wifi_debug_params.h"

Anyway, here is the log file with TCP packets: http://www.ctrl.ba/20141105202427.txt search for string "WIFI CONNECTING" in the log and see what happens.

Thanks!

Who is online

Users browsing this forum: No registered users and 92 guests