Post topics, source code that relate to the Arduino Platform

User avatar
By Luc Volders
#52425 Hi there,

I have a question which may not easily be solved but here we go.

One of the first test programs for any ESP is the wifi-scan program:

Code: Select all   
-- print ap list
    function listap(t)
          for ssid,v in pairs(t) do
            authmode, rssi, bssid, channel =
              string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)")
            print(ssid,authmode,rssi,bssid,channel)
          end
    end
         
    wifi.sta.getap(listap)


This Lua code not only shows the name of the Access Point but also the MAC adress.

Now I know there is an equivalent in Arduino code however that does not display the MAC adress.

Anybody has a solution for this, as I really could use this for a project.

Luc
User avatar
By martinayotte
#52503 It is existing in Arduino :

Code: Select all    int n = WiFi.scanNetworks();
    for (int i = 0; i < n; i++) {
      Serial.print(WiFi.SSID(i));
      Serial.print(" / ");
      Serial.print(WiFi.RSSI(i));
      Serial.print(" / ");
      Serial.println(WiFi.BSSIDstr(i));
    }