Page 1 of 1

esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Posted: Mon Oct 30, 2017 8:05 am
by gatisp
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!

Re: esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Posted: Mon Oct 30, 2017 9:02 am
by WiFive
Did you try WIFI_COUNTRY_POLICY_MANUAL? It may not be possible to use something that is not a known standard.

Re: esp_wifi_set_country returns ESP_ERR_WIFI_ARG

Posted: Mon Oct 30, 2017 10:15 am
by gatisp
Same results with WIFI_COUNTRY_POLICY_MANUAL...