How do I know to which WiFi channel is the particle connected to?

Hello,
After connection to WiFi, which API should I use to get the information about the channel I am connected to?

Thanks
Dheeraj

The reference docs don’t mention anything, so you are out of luck currently with the standard firmware!

@dheerajdake, did you ever work out how to do this?

No. I’m not working on particle anymore.

Oh!

This question never appears to have been answered or rather the answer was not documented. I need to diagnose some Photon based device issues (hang when waking from sleep) which appear to only occur in environments where there are many WAPs with the same SSID name and setup on different channels. I want to record when a device connects to a WAP which channel it is using. Like there is WiFi.localIP() - is there a way to WiFi.channel()? A scan for visible WAPs returns channel but then needs to be filtered to the connected WAP. Any other ideas?

There’s not an easy way to do it but it can be done if you have some time and patience. Use WiFi.BSSID() to get the MAC address of the base station you are connected to. Then you could use WiFi.scan() to get a list of all access points. It includes the BSSID and the channel. Then you can compare the BSSIDs and determine the channel.

4 Likes

Thanks for a quick response and confirmation of the approach. :wink:

1 Like