Page 1 of 1

Controlling of connected station to softAP

Posted: Tue Oct 17, 2017 6:04 pm
by ukrsms
Hi, All
I'm using the ESP8266 module for WIFI communications but there is one thing caused a great problem for our device. We use Soft AP to set credentials for the ESP to connect it to a router. But the problem is that we use open WIFI net without security and sometimes all available channels become busy :x before I started to connect to AP. I looked through the documentation but haven't found any information how could ESP itself disconnect some station from its WIFi. Could someone help me to solve the problem?

Re: Controlling of connected station to softAP

Posted: Wed Oct 18, 2017 9:09 pm
by blubb
Maybe just use a default password? 12345678 or the like? That does not provide real security but prevents auto connections.

Re: Controlling of connected station to softAP

Posted: Fri Oct 20, 2017 8:37 pm
by ukrsms
Of course, it could be done so, but is not convenient to enter a long password every time a user wants to connect to device's Net. It would be easier just to select open WIFI net and if the user is not authorized then the device could disconnect it.

Re: Controlling of connected station to softAP

Posted: Sat Oct 21, 2017 1:49 am
by blubb
AFAIK there is no API for this. I don't know why. I once read that you needed to send a "deauth" packet and this had to be generated manually. In any case there is no easy solution.
Maybe you should open a request here:
https://github.com/espressif/ESP8266_NONOS_SDK/issues

On the other hand even just a very short password should do the job for you...

Re: Controlling of connected station to softAP

Posted: Sat Oct 28, 2017 5:13 am
by blubb
Actually, in libmain there seems to be a wifi_softap_deauth function... but since it is not in any .h file, I am not sure how to use it.
Maybe Espressif could elaborate on this.

Re: Controlling of connected station to softAP

Posted: Sun Oct 29, 2017 4:59 pm
by ukrsms
blubb wrote:Actually, in libmain there seems to be a wifi_softap_deauth function... .


Well done, blubb! It seems it is what I was looking for. I found the prototype for the function:

Code: Select all

bool wifi_softap_deauth(uint8 mac[6]);

I've just tried it - it works fine. So the function provides us a possibility to disconnection of some station from our AP if it is necessary.