ESP-C3 40 MHz Bandwidth
Posted: Thu Apr 25, 2024 10:58 pm
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.
In addition, I can use the following code to check that the settings have been configured correctly.
Thanks in advance for your help and suggestions!
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());
Code: Select all
wifi_bandwidth_t bw;
esp_wifi_get_bandwidth(WIFI_IF_AP, &bw);
ESP_LOGI(TAG, "Bandwidth: %d", bw);