My system consists of several ESP8266 based 'stations', which are synchronised in a way that all of them go into deep sleep and wake up on the same schedule. All stations are WiFi clients. All stations run on batteries and energy saving is critical.

One of the stations is a Master. It contains a modem/router that serves as AP to all stations. The AP is switched OFF during the sleep phase. When a Master wakes up it switches on the AP and thus starts a communication session available to all stations. When all stations have their data sessions completed and disconnect from AP, the Master switches off the modem/router and goes to sleep.

My question is about the Master being informed that there are no other clients actively connected to the AP. My current solution is WAN based - each station reports to the Web Service on the start and end of their connection. Is it possible to achieve the same result locally - by a request from the WiFi client to the Access Point?

  • You likely could simply probe the network you are on. In Linux you would use the nmap command. Model your code after that command. – st2000 Jan 30 '18 at 1:42
  • 3
    I'm voting to close this question as off-topic because the actual question has absolutely nothing to do with Arduino. The reality of the situation is entirely dependent on the unspecified capabilities of the AP and the other clients. – Chris Stratton Jan 30 '18 at 3:43
  • You can avoid these kinds of questions by reading the documentation or by checking the header files. – tttapa Jan 30 '18 at 14:41
  • What reseache have you done on this topic? Example using a search enginee and searched for "esp8266 show clients connected"? Questions that show no research is normaly closed. – MatsK Jan 31 '18 at 5:25
  • It seems you failed to read and/or understand the question. The system described is successfully implemented at several remote outback locations where it runs on solar power unattended for months. To ensure smooth failover all units are interchangeable, the system has no server, all ESPs are WiFi clients. I challenge you to find a solution to my question thru your 'research'. Anyway, I am happy with this question being closed. Thank you. – Alcher Feb 1 '18 at 1:13

Use WiFi.softAPgetStationNum() to return the number of clients connected to an ESP8266 AP.

| improve this answer | |
  • Thanks a lot, dandavis! Exactly what I was looking for. – Alcher Jan 30 '18 at 8:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.