I have a wifi AP set to channel 13, and I use esp_wifi_set_country(WIFI_COUNTRY_US) to set ESP32 to US which has a channel range from 1 to 11. Then I perform a wifi active scan and expect it will not find the channel 13, but the result surprises me. It always find the channel 13's AP. Is it a bug?
Colman
esp_wifi_set_country() seems not working
Re: esp_wifi_set_country() seems not working
Its a good question. I don't know WiFi and radio rules but if you are saying that the US FCC only allows radio channel 1-11 to be used for WiFi in the US but outside the US other channels can be used ... then I would also have imagined that non-valid channels would not be shown based on the country setting.
It is, of course, one thing to "detect" an access point with a country invalid channel but another to be allowed to transmit on that channel. Have you tried setting the country code to be US and then trying to form a connection to the access point outside the valid range. I could imagine that a scan (which is passive) would not prevent detection of access points outside of the allowable range but an attempt to actually transmit on the invalid channel may be prevented.
It is, of course, one thing to "detect" an access point with a country invalid channel but another to be allowed to transmit on that channel. Have you tried setting the country code to be US and then trying to form a connection to the access point outside the valid range. I could imagine that a scan (which is passive) would not prevent detection of access points outside of the allowable range but an attempt to actually transmit on the invalid channel may be prevented.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: esp_wifi_set_country() seems not working
I am setting the wifi country to US, but it can still detect and connect to the AP outside the valid channel range. I don't agree with "a scan (which is passive) would not prevent detection of access points outside of the allowable range", it should not tune to any frequency outside the allowable range. So far, I haven't met any wifi chip that can detect an AP outside the valid channel range.
Re: esp_wifi_set_country() seems not working
Try it out, they have pathched it https://github.com/espressif/esp-idf/issues/1004.
Haven't tried it myself yet.
Haven't tried it myself yet.
Who is online
Users browsing this forum: No registered users and 40 guests