wifi state change will reset my tcp server

aureoleday
Posts: 22
Joined: Wed Dec 19, 2018 2:10 am

wifi state change will reset my tcp server

Postby aureoleday » Wed Dec 16, 2020 2:33 am

I run a TCP server on esp32, esp32 connect to a AP as a station. But the wifi state always change from run to init, and it will reset my Tcp server. System log shows:

I (270506) wifi:state: run -> init (ce00)
I (270506) wifi:pm stop, total sleep time: 63165857 us / 205445718 us
I (270506) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
E (270516) TCP_SRV: Error occurred during receiving: errno 113
I (270526) TCP_SRV: Socket listening
I (271866) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (271866) wifi:state: init -> auth (b0)
I (271866) wifi:state: auth -> assoc (0)
I (271876) wifi:state: assoc -> run (10)

Is there any way to prevent wifi state change impact my tcp server

axellin
Posts: 200
Joined: Mon Sep 17, 2018 9:09 am

Re: wifi state change will reset my tcp server

Postby axellin » Wed Dec 16, 2020 2:45 am

aureoleday wrote:
Wed Dec 16, 2020 2:33 am
I run a TCP server on esp32, esp32 connect to a AP as a station. But the wifi state always change from run to init, and it will reset my Tcp server. System log shows:

I (270506) wifi:state: run -> init (ce00)
The disconnect reason code (0xce00) is: WIFI_REASON_AP_TSF_RESET.
What is your esp-idf version?
Maybe you need to update your esp-idf since it's fixed.
https://github.com/espressif/esp-idf/issues/5915

aureoleday
Posts: 22
Joined: Wed Dec 19, 2018 2:10 am

Re: wifi state change will reset my tcp server

Postby aureoleday » Wed Dec 16, 2020 2:55 am

thank you for ur reply.
I will update to v4.2 to see how it goes

Who is online

Users browsing this forum: snutw_ and 97 guests