New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiFiEvent, disconnection not detected #3279
Comments
Question, when you disconnect the smartphone, how do you do this? Do you pull the battery out of the smartphone? |
No, i simply connect to another Wifi network. |
After some test, i realized that the esp do detect the disconnection but approximately 5 minutes after i power off the phone or the other esp. |
Right. Because when you switch to another network on the mobile phone, it first tells its current AP (in a simplified terms) "hey AP, i'm leaving". Then the AP knows that the client is about to disconnect. On the other hand if you yank the power cord, the client doesn't have time to notify the AP that it's leaving. There is a certain timeout that AP has before it will deauthenticate the station which hasn't sent even an empty frame in a while. This timeout depends on the AP. AFAIK, on the ESP8266 this timeout can not be modified by the application. If you need this feature, please post the enhancement request on bbs.espressif.com, asking to support this in the non-OS SDK. |
Sry to comment on a closed issue, but i use the onSoftAPModeStationConnected function in exactly the same way, but the build fails with the error message
|
Basic Infos
Hardware
Hardware: Wroom-02
Core Version: 2.3.0-rc2
I have two Wroom-02 : one is in the soft AP mode and the other in station mode. And i want to detect when the second one connect or disconnect to/from the AP of the first one. So, i am using WiFiEvents example.
When i power on the wroom 02 in station mode, the onStationConnected works and the connection is detected. But my problem is when i power off the wroom 02, the onStationDisconnected don't get called and the disconnection is not detected.
This problem only occur with two esp. When, i connect and disconnect using a smartphone it works great.
The code of the esp in ap mode :
The code of the esp in station mode :
The text was updated successfully, but these errors were encountered: