APSTA Mode - STA connected but not accessible after random period of time

teckhaokoh
Posts: 34
Joined: Wed Sep 21, 2016 6:40 am

APSTA Mode - STA connected but not accessible after random period of time

Postby teckhaokoh » Fri May 01, 2020 9:31 am

Hi, I'm running a webserver in esp32 using APSTA mode.
As stated in the subject, after it's running for certain period of time, i found that it's not accessible through the STA, but I've checked the connection, it's still connected to my router, and my router still able to see the IP address.
I couldn't ping or access to my esp32 through STA (using PC), but it's fully operate if I'm connecting directly to the esp32's AP.

Below are summary of my problem:
WIFI mode : APSTA
Connection : Both AP and STA connected
ESP32 crash or reboot:
I'm sure that the esp32 never crash and reboot, as I got a timer counting the uptime, which I'm still able to see it through AP.

Access to web server:
AP fully accessible and operate as normal
STA not accessible, can't even ping

How to get it working again:
1. reboot my router
2. reboot my esp32

Anyone has similar experience?

teckhaokoh
Posts: 34
Joined: Wed Sep 21, 2016 6:40 am

Re: APSTA Mode - STA connected but not accessible after random period of time

Postby teckhaokoh » Thu May 14, 2020 3:02 am

Anyone know the meaning of each items and numbers in the wifi debug message below?


I (467626043) wifi: n:1 0, o:1 1, ap:1 1, sta:1 0, prof:1

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: APSTA Mode - STA connected but not accessible after random period of time

Postby WiFive » Thu May 14, 2020 3:25 am

Does it seem like the dhcp lease expires when it loses connection?

teckhaokoh
Posts: 34
Joined: Wed Sep 21, 2016 6:40 am

Re: APSTA Mode - STA connected but not accessible after random period of time

Postby teckhaokoh » Fri May 22, 2020 2:39 am

I spent quite some time to troubleshoot, I think it's the ARP table issue.
I found that after I switching the WIFI connections of my PC (my esp32 and PC connected to router by default) to esp32's AP, then back to router, the ARP table in my PC do not have the record of my esp.
If I add in the ARP entries manually, then the connection is resumed.

I've updated to the ESP-IDF 4.2 (previously 2.1), i think the gratuitous ARP solve the issue.
I still see the same issue today, but after a while (I think it's because the gratuitous ARP interval of 60s), I'm able to connect again.

awander
Posts: 2
Joined: Tue Nov 05, 2019 2:08 pm

Re: APSTA Mode - STA connected but not accessible after random period of time

Postby awander » Wed Jun 17, 2020 6:43 pm

I encountered similar problem too !
* I startup a TCP Socket Server at ESP32
* When I try to connect to the ESP32 from PC(Windows), it may cost more than 30s to establish the connection !
* If I ping the ESP32 continuously with a command "ping 192.168.0.xxx -t" on PC(Windows), then the connection can be established very quickly in few seconds !

While checking ARP table of the Windows ("arp -a"), I can find a dynamic ARP record of the ESP32.
If I stop the ping command and wait about 50 seconds, I can still see the ARP record of the ESP32.
STRANGE: But when I try to connect to the ESP32 again, I find that: the ARP record of the ESP32 is disappeared quickly !!! And the connection is blocked for long time to establish !!!

I have no idea how to resolve this problem now, can anybody give me some advises ?
Thanks !

liuzhifu
Posts: 39
Joined: Tue Dec 13, 2016 2:18 am

Re: APSTA Mode - STA connected but not accessible after random period of time

Postby liuzhifu » Mon Jul 06, 2020 5:02 am

Hi @awander, @teckhaokoh,
  • Is the problem easy or hard to be reproduced? About how long time for you to reproduce the issue?
  • How about configured the Router to open mode (Disable encryption mode)?
  • Does the issue still exist if change the Router to hotspot of phone?

Who is online

Users browsing this forum: Bing [Bot] and 59 guests