Page 1 of 1

esp_wifi_set_country() seems not working

Posted: Fri Jun 09, 2017 9:44 am
by colman
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

Re: esp_wifi_set_country() seems not working

Posted: Tue Jun 13, 2017 4:11 pm
by kolban
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.

Re: esp_wifi_set_country() seems not working

Posted: Wed Jun 14, 2017 9:51 am
by colman
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

Posted: Mon Oct 09, 2017 2:30 pm
by jakkra
Try it out, they have pathched it https://github.com/espressif/esp-idf/issues/1004.
Haven't tried it myself yet.