1

I'm using STM32 as the main microcontroller and an ESP-12F is connected to it via serial port. I'm controlling ESP with AT commands.

I want to figure out how many devices are connected to my ESP. How should I do that?

Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
M.Navidi
  • 113
  • 1
  • 10

1 Answers1

1

I assume your device is acting as an access point, meaning that you previously configured it in that whay with

AT+CWMODE=2

The command for obtaining the list of stations connected to the access point is AT+CWLIF:

AT+CWLIF

<IP device 1>,<MAC address device 1>
<IP device 2>,<MAC address device 2>
...
<IP device N>,<MAC address device N>

OK

So, basically, you will get a row containing the <IP>,<MAC address> couple for each connected station. Counting those lines will tell you how many devices are connected to your ESP.

Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39