I stumbled upon an AT command for the ESP8266 that I really need. The following command is "AT+CWLAP", but I have no idea how to use it. I can't seem to find any resource on how to implement it.

I need the SSID, RSSI, and MAC addresses of the AP and pretty much use those data internally. For example (not necessarily doing this but you get the point), depending on the signal strength, choose the best option and print the SSID of the AP.

Is it even possible?

  • It's not clear exactly what you are asking. You have discovered a command that you want to use it. If you have a problem using it, please note that in your question. – jose can u c Sep 11 '17 at 12:52
  • @jose sorry about that. Edited to clarify. – Display name Sep 11 '17 at 13:10

The command is documented in the ESP8266 AT Command Reference, with a non-PDF option at https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/#AT+CWLAP

The response from the AT+CWLAP is a series of lines listing available access points, and for each, you are given their encryption method, SSID, RSSI, MAC, and the channel (or frequency offset and a calibration value).

It would be up to the you to parse the resulting strings to obtain the APs, sort by signal strength, and decide what to do with that information.


Because you are using the Arduino environment/core to write code for the ESP8266, you won't be able to use the AT command set. The AT Commands are available when the ESP8266 has the EspressIF firmware loaded to it, and thus the ESP8266 module is intended to be a peripheral device to some other controller; contrast with your use, where the ESP8266 is the only controller, with the WiFi ability baked in.

In this case, you will need to examine the features of the Arduino ESP8266 core, especially the ESP8266WiFi library, which gives an example sketch for scanning the available WiFi networks.

  • I learned quite a bit about AT command now. However I'm still having a hard time actually inputting the command. A lot of other sites uses SoftwareSerial to communicate with the module (correct me if I'm wrong). I'm using Wemos D1 Mini, which already includes the esp8266 with the micro controller. Can I get by using "SoftwareSerial ESP8266(10,11)" *I'm assuming those are the rx tx pins. – Display name Sep 11 '17 at 14:52
  • The AT commands only work if the original Espressif firmware is loaded, and which is likely not the case with the Wemos D1 Mini. Unless, you mean you have a Wemos D1 and another ESP8266. You can update your question to describe your environment (which hardware, connected to what, using which software.) – jose can u c Sep 11 '17 at 14:56
  • Okay, are there any other ways to get SSID, RSSI of all detected APs without flashing the original firmware? If not, I found a way to flash the original firmware. wiki.wemos.cc/tutorials:get_started:revert_to_at_firmware – Display name Sep 11 '17 at 15:06
  • That depends on what firmware you are using. There is an Arduino core, MicroPython, etc. To what is the Wemos connected? On what pins? Details please! – jose can u c Sep 11 '17 at 15:16
  • This is the exact one I got. I don't know what firmware I'm using, but I'm using Arduino to code right now. Anything else? amazon.com/HiLetgo-ESP8266-NodeMcu-bytes-Development/dp/… – Display name Sep 11 '17 at 15:54

Your Answer

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

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