Last active
June 19, 2024 17:13
-
-
Save oldmud0/4946228fc2e279932d06b32e0e23968d to your computer and use it in GitHub Desktop.
Revisions
-
oldmud0 revised this gist
Jun 19, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ constexpr auto WIFI_CHANNEL = 9; // Find a relatively quiet channel constexpr auto WIFI_DATA_RATE = WIFI_PHY_RATE_24M; void initFastWifi() { // Set up Wi-Fi with a faster data rate by disabling AMPDU -
oldmud0 created this gist
Jun 19, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ void initFastWifi() { // Set up Wi-Fi with a faster data rate by disabling AMPDU // and setting a very fast fixed rate. // https://www.esp32.com/viewtopic.php?t=9965 // We also need delays to work around races between each step: // https://esp32.com/viewtopic.php?t=2512 WiFi.disconnect(); vTaskDelay(100 / portTICK_RATE_MS); WiFi.mode(WIFI_STA); vTaskDelay(100 / portTICK_RATE_MS); ESP_ERROR_CHECK(esp_wifi_stop()); vTaskDelay(100 / portTICK_RATE_MS); ESP_ERROR_CHECK(esp_wifi_deinit()); vTaskDelay(100 / portTICK_RATE_MS); wifi_init_config_t initConfig = WIFI_INIT_CONFIG_DEFAULT(); initConfig.ampdu_tx_enable = false; ESP_ERROR_CHECK(esp_wifi_init(&initConfig)); ESP_ERROR_CHECK(esp_wifi_start()); ESP_ERROR_CHECK(esp_wifi_set_channel(WIFI_CHANNEL, WIFI_SECOND_CHAN_NONE)); ESP_ERROR_CHECK(esp_wifi_internal_set_fix_rate(WIFI_IF_STA, true, WIFI_DATA_RATE)); ESP_ERROR_CHECK(esp_now_init()); }