esp_wifi_set_country() seems not working

colman
Posts: 37
Joined: Mon May 30, 2016 7:41 am

esp_wifi_set_country() seems not working

Postby colman » Fri Jun 09, 2017 9:44 am

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

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: esp_wifi_set_country() seems not working

Postby kolban » Tue Jun 13, 2017 4:11 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

colman
Posts: 37
Joined: Mon May 30, 2016 7:41 am

Re: esp_wifi_set_country() seems not working

Postby colman » Wed Jun 14, 2017 9:51 am

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.

jakkra
Posts: 7
Joined: Mon Sep 11, 2017 12:49 pm

Re: esp_wifi_set_country() seems not working

Postby jakkra » Mon Oct 09, 2017 2:30 pm

Try it out, they have pathched it https://github.com/espressif/esp-idf/issues/1004.
Haven't tried it myself yet.

Who is online

Users browsing this forum: No registered users and 51 guests