0

So using the ESP8266 in STA_AP mode, the amount of Stations connected to the AP can be figured out by running a WiFi.softAPgetStationNum() line. But let's say Alpha is my AP. And Bertha is a Client trying to connect to the AP. Before Bertha connected, Alpha said there are 0 stations connected. After Bertha connect, WiFi.softAPgetStationNum() tells me there is one station connected. But when Bertha disconnects the number won't change. And when she connects again the number also stays the same. But when I connect a new Station to the AP for example charlie, the number increases by one again? How can I make that number decrease when someone disconnects ? Or is there another way you can check the amount of Stations connected to your AP.

I researched a bit and couldn't find that much info

  • 1
    How long do you wait after disconnecting before deciding that it's never going to change? – Majenko Jan 5 at 21:24
  • Hm maybe that's the problem ye. Around like 30 sec. only. But I need it to be fast tho :/. How long does it usually take? – Zunzulla alagaty Jan 6 at 13:16
  • I have no idea. But I guess probably longer than 30 seconds. If it's tied to DHCP leases then it could take an hour. Experiment and see if it decreases after a time. – Majenko Jan 6 at 13:17
  • Ok I'll do that tomorrow. Gonna run a millis() and safe the time it took to actually become 0 connections again – Zunzulla alagaty Jan 6 at 17:21

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.