Determining WiFi channel connected to

Is there a function (or workaround) that enables the WAP channel connected to be determined like SSID using WiFi.SSID()?

No, but you can do a WiFi.scan(). The scan results include the BSSID, channel, SSID, and RSSI. Just find the BSSID that you are connected to in the results.

I created a library that can get the channel number and convenience methods to determine if it's 2.4 GHz or 5 GHz. It's hacky and ridiculous (it determines the current BSSID, then does a WiFi.scan() to find the channel number corresponding to that BSSID) but it seems to work.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.