7 years, 7 months ago.  This question has been closed. Reason: Off Topic

ESP8266 - How to get AP List?

Hi mbed friends,

For below examples, I use a Nucleo-F746ZG board.

Using the ESP8266 library, I try to get a list with APs. https://developer.mbed.org/teams/components/code/ESP8266/

I can connect to WiFi with it and I could retrieve the NTP time, so the module works with this library. When I tried to make a function getAPList() containing the AT command is "AT+CWLAP", I could see the APs in the debug output (debug = true). It returned something like:

+CWLAP:(4,"SSID1",-63,"20:aa:4b:04:14:b8",1,5,0)
+CWLAP:(4,"Ssid123",-81,"9c:80:df:0a:15:56",4,-11,0)

The getAPList() function could be similar to the getIPAddress() function. However, the below code filters out one line only, but is it possible to get all AP's in the output?

const char *ESP8266::getIPAddress(void)
{
    if (!(_parser.send("AT+CIFSR")
        && _parser.recv("+CIFSR:STAIP,\"%[^\"]\"", _ip_buffer)
        && _parser.recv("OK"))) {
        return 0;
    }

    return _ip_buffer;
}

Kind regards, Jack.

I wrote my own, which worked.

posted by Jack Berkhout 20 Nov 2016