Remove a connected station

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Remove a connected station

Postby Fugazi » Wed Feb 28, 2018 9:35 pm

Any ideas how to forceably remove a connected wifi station ?

Thanks

vibnwis
Posts: 89
Joined: Thu Aug 24, 2017 1:13 am

Re: Remove a connected station

Postby vibnwis » Wed Feb 28, 2018 10:09 pm

The following code is not fully tested.

static void stop_wifi(){

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

}

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: Remove a connected station

Postby Fugazi » Wed Feb 28, 2018 10:41 pm

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

vibnwis
Posts: 89
Joined: Thu Aug 24, 2017 1:13 am

Re: Remove a connected station

Postby vibnwis » Thu Mar 01, 2018 3:16 am

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.

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: Remove a connected station

Postby Fugazi » Thu Mar 01, 2018 7:57 am

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

vibnwis
Posts: 89
Joined: Thu Aug 24, 2017 1:13 am

Re: Remove a connected station

Postby vibnwis » Thu Mar 01, 2018 8:09 am

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.

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: Remove a connected station

Postby Fugazi » Thu Mar 01, 2018 11:43 am

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

vibnwis
Posts: 89
Joined: Thu Aug 24, 2017 1:13 am

Re: Remove a connected station

Postby vibnwis » Thu Mar 01, 2018 7:27 pm

Sorry, those are beyond my knowledge. Good luck

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Remove a connected station

Postby kolban » Mon Mar 12, 2018 8:45 pm

It may be a call to esp_wifi_deauth_sta may be what we seek.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: No registered users and 292 guests