esp_wifi_set_country returns ESP_ERR_WIFI_ARG

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Postby gatisp » Mon Oct 30, 2017 8:05 am

Hello,

I wanted to limit the possible channels the station is scanning when trying to connect using the esp_wifi_set_country API:

Code: Select all

    wifi_country_t country = {
	.cc = "EU",
	.schan = 3,
	.nchan = 1,
	.policy = WIFI_COUNTRY_POLICY_AUTO,
    };
    int ret = esp_wifi_set_country(&country); // returns ESP_ERR_WIFI_ARG
But esp_wifi_set_country seems to return ESP_ERR_WIFI_ARG for anything that specifies schan other than 1. Also the nchan does not seem to be respected, as the ESP32 still connects to APs outside of the channel range [schan, schan + nchan).

Could somebody please give an update on how this API is supposed to work?

Hope it is not a problem to ask questions about APIs in master branch!

Thanks for all the good stuff thats coming into the ESP-IDF!

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Postby WiFive » Mon Oct 30, 2017 9:02 am

Did you try WIFI_COUNTRY_POLICY_MANUAL? It may not be possible to use something that is not a known standard.

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

Re: esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Postby gatisp » Mon Oct 30, 2017 10:15 am

Same results with WIFI_COUNTRY_POLICY_MANUAL...

Who is online

Users browsing this forum: No registered users and 86 guests