Page 1 of 1

ESP-C3 40 MHz Bandwidth

Posted: Thu Apr 25, 2024 10:58 pm
by rolandlintz
Hello,

I am using the ESP32-C3 for FTM. My problem is that I cannot set the bandwidth to 40 MHz when using wifi. When I check the bandwidth on the spectrum analyzer I only receive 20 MHz bandwidth and not 40 MHz. I am using the following code for wifi initialization.

Code: Select all

    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));

    // configure AP
    wifi_config_t ap_config = {};
    memcpy(ap_config.ap.ssid, AP_SSID, strlen(AP_SSID));
    ap_config.ap.channel = AP_CHANNEL;
    ap_config.ap.authmode = WIFI_AUTH_OPEN;
    ap_config.ap.max_connection = MAX_STA_CONN;
    ap_config.ap.ssid_hidden = false;
    ap_config.ap.ftm_responder = true;

    // set AP configuration
    ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &ap_config));
    esp_wifi_set_bandwidth(WIFI_IF_AP, WIFI_BW_HT40);
    ESP_ERROR_CHECK(esp_wifi_start());
In addition, I can use the following code to check that the settings have been configured correctly.

Code: Select all

wifi_bandwidth_t bw;
esp_wifi_get_bandwidth(WIFI_IF_AP, &bw);
ESP_LOGI(TAG, "Bandwidth: %d", bw);
Thanks in advance for your help and suggestions!

Re: ESP-C3 40 MHz Bandwidth

Posted: Fri Apr 26, 2024 2:59 am
by ESP_krzychb
Hello rolandlintz,
Check https://github.com/espressif/esp-idf/issues/8518
It looks like a similar issue.

Re: ESP-C3 40 MHz Bandwidth

Posted: Fri Apr 26, 2024 11:14 am
by rolandlintz
Thanks for your reply.
However, the problem is not that the function esp_wifi_set_bandwidth() does not work. I can also use esp_wifi_get_bandwidth() to check that the bandwidth has been successfully set to 40 MHz. My problem is that with both the 20 MHz and 40 MHz settings, I get a bandwidth of 20 MHz on the spectrum analyzer, which is connected to the ESP32-C3 via a cable.