Page 1 of 1

Remove a connected station

Posted: Wed Feb 28, 2018 9:35 pm
by Fugazi
Any ideas how to forceably remove a connected wifi station ?

Thanks

Re: Remove a connected station

Posted: Wed Feb 28, 2018 10:09 pm
by vibnwis
The following code is not fully tested.

static void stop_wifi(){

esp_wifi_disconnect();
esp_wifi_stop();
esp_wifi_deinit();

}

Re: Remove a connected station

Posted: Wed Feb 28, 2018 10:41 pm
by Fugazi
Thanks, but isnt that to disconnect the esp32 from an access point, not disconnect a station connected to the access point? I want to keep the wifi up on the esp32, just disconnect one of the connected stations

Re: Remove a connected station

Posted: Thu Mar 01, 2018 3:16 am
by vibnwis
My application is a webRadio. It connects to an AP. I wanted to stop/remote WiFi completely which I think it is better to start fresh. I don't quite understand your applications and your definition of the term station.

Re: Remove a connected station

Posted: Thu Mar 01, 2018 7:57 am
by Fugazi
A station is a device that connects to the esp32 access point on wifi.

Basically theres an issue with the esp32 that if a station connects to it when the wifi is coming up an IP is not assigned and left as 0.0.0.0, if theres 1 second delay and then connect, an ip is assigned.

I wanted to disconnect any station which hasnt been assigned a valid ip, so it will reconnect and be assigned a proper IP.

Just a way around the issue.....

Any other ideas would be appreciated or how to fix the issue !

Thanks

Re: Remove a connected station

Posted: Thu Mar 01, 2018 8:09 am
by vibnwis
The logic I used for my application is reverse the process. If you have an event handler for each connection, then you should able to reverse the process disconnecting it.

Re: Remove a connected station

Posted: Thu Mar 01, 2018 11:43 am
by Fugazi
Thank you for the reply, not sure what you mean by reversing the process, thought the event handler notified us of the wifi events?

How do I reverse this and disconnect the station ?

Thanks

Re: Remove a connected station

Posted: Thu Mar 01, 2018 7:27 pm
by vibnwis
Sorry, those are beyond my knowledge. Good luck

Re: Remove a connected station

Posted: Mon Mar 12, 2018 8:45 pm
by kolban
It may be a call to esp_wifi_deauth_sta may be what we seek.