Wifi Connect / Disconnect detection

oxomoxo
Posts: 3
Joined: Tue Jan 22, 2019 9:03 pm

Wifi Connect / Disconnect detection

Postby oxomoxo » Mon Mar 18, 2019 2:43 pm

Hi there,

I'm having a hard time to understand some details about Wifi connections when it comes to state awareness.

Some context :

I have a client UDP connection (Wifi STA) that bombards an UDP server (Wifi AP) on two ESP32s, at quite a steady rate (50Hz) everything works fine so far, I'd say a little too well actually .. In order to toughen the client / server relation I'm testing some corner situations : press a hard reset on the server (server reboots, restarts Wifi + UDP), and ... nothing, the client keeps running straight spurring data in the void. If I touch nothing it takes a full 5 minutes to the client to even realize it was like shouting in outer space :P

I changed the CONFIG_IP_LOST_TIMER_INTERVAL value to 1 in the sdkconfig file (was 120), but that doesn't help, the client doesn't even notice the connection is toast ...

Is there some thing I can do in order to improve the awareness rate on Wifi state ?
Am I overlooking something obvious ?

Thanks for any advice / pointer ...
Lo.

littlesky
Posts: 51
Joined: Fri Jun 09, 2017 7:49 am

Re: Wifi Connect / Disconnect detection

Postby littlesky » Thu Mar 21, 2019 1:02 pm

oxomoxo wrote:
Mon Mar 18, 2019 2:43 pm
Hi there,

I'm having a hard time to understand some details about Wifi connections when it comes to state awareness.

Some context :

I have a client UDP connection (Wifi STA) that bombards an UDP server (Wifi AP) on two ESP32s, at quite a steady rate (50Hz) everything works fine so far, I'd say a little too well actually .. In order to toughen the client / server relation I'm testing some corner situations : press a hard reset on the server (server reboots, restarts Wifi + UDP), and ... nothing, the client keeps running straight spurring data in the void. If I touch nothing it takes a full 5 minutes to the client to even realize it was like shouting in outer space :P

I changed the CONFIG_IP_LOST_TIMER_INTERVAL value to 1 in the sdkconfig file (was 120), but that doesn't help, the client doesn't even notice the connection is toast ...

Is there some thing I can do in order to improve the awareness rate on Wifi state ?
Am I overlooking something obvious ?

Thanks for any advice / pointer ...
Lo.
You restart UDP server (WiFi AP). WiFi STA disconnect and reconnect after WiFi AP restarts. WiFi STA gets the same IP address. Then it continues sending UDP packets. It has no problem.
If you change the CONFIG_IP_LOST_TIMER_INTERVAL value to 1, power down UDP server (WiFi AP) for 10 seconds and then power up. WiFi STA will stop send UDP packets after 1 second and continue send UDP packets after 10 seconds.

oxomoxo
Posts: 3
Joined: Tue Jan 22, 2019 9:03 pm

Re: Wifi Connect / Disconnect detection

Postby oxomoxo » Tue Mar 26, 2019 3:59 pm

Hi @littlesky,
Thanks for your response and sorry for late reply (was my first post on the forum and it took sooooo long to get approved that I almost forgot I posted it), anyway :

The behavior that you are describing is what I actually expected (from the docs I read) AND it actually behaved that way for a while (the cut/reconnect/continue was actually pretty fast), but at some point (for the hell of me, I don't know what I did) that was not what I got anymore ... when I wrote "spurring data in the void" I was meaning, the client while pushing data like crazy without neconn reporting error, was not "heard" on the server side :/ and did go on that way a lot longer (around five full minutes) before it got the "link down" awareness/event/callback ...

Anyhow, I now have changed the layout and reversed the AP/STA and all "automagically" went back to normal ... (but I still don't know what happened).

Who is online

Users browsing this forum: KaosESP32 and 181 guests