# HG changeset patch # User Michiel Broek # Date 1697810276 -7200 # Node ID 86b275481021cc21aa7f497b16d286c589363e7b # Parent 913eb9ca40b1a0497f936722a98135d3b7f7c341 Added framework for the DCF77 transmitter. Added two debug LEDs. diff -r 913eb9ca40b1 -r 86b275481021 .hgignore --- a/.hgignore Thu Oct 19 17:32:16 2023 +0200 +++ b/.hgignore Fri Oct 20 15:57:56 2023 +0200 @@ -1,4 +1,6 @@ sdkconfig.old +dependencies.lock syntax: glob build/* +managed_components/* diff -r 913eb9ca40b1 -r 86b275481021 main/CMakeLists.txt --- a/main/CMakeLists.txt Thu Oct 19 17:32:16 2023 +0200 +++ b/main/CMakeLists.txt Fri Oct 20 15:57:56 2023 +0200 @@ -1,4 +1,4 @@ -set(srcs dcf77tx.c task_wifi.c ) +set(srcs dcf77tx.c task_wifi.c task_dcf.c ) idf_component_register(SRCS "${srcs}" INCLUDE_DIRS ".") diff -r 913eb9ca40b1 -r 86b275481021 main/Kconfig.projbuild --- a/main/Kconfig.projbuild Thu Oct 19 17:32:16 2023 +0200 +++ b/main/Kconfig.projbuild Fri Oct 20 15:57:56 2023 +0200 @@ -16,34 +16,9 @@ help WiFi WPA2/WPA3 password to use. - choice ESP_WIFI_SCAN_METHOD - prompt "scan method" - default WIFI_FAST_SCAN - help - scan method for the esp32 to use - config WIFI_FAST_SCAN - bool "fast" - config WIFI_ALL_CHANNEL_SCAN - bool "all" - endchoice - - config ESP_FAST_SCAN_MINIMUM_SIGNAL - int "WiFi fast scan minimum RSSI" - range -127 0 - default -96 - help - RSSI minimum reliable level to connect to an AP - - config ESP_WIFI_ROAMING_LEVEL - int "WiFi RSSI level for alternative AP" - range -96 -50 - default -67 - help - RSSI level to start looking for a better AP - endmenu - config ANTENNA + config ANTENNA_PIN int "Pin to drive the DCF77 antenna" range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 10 if IDF_TARGET_ESP32C3 @@ -51,5 +26,21 @@ help GPIO number (IOxx) to connect to the DCF77 antenna. + config LED1_PIN + int "LED 1 port pin" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX + default 1 if IDF_TARGET_ESP32C3 + default 1 + help + Output LED 1, default GPIO port 1 + + config LED2_PIN + int "LED 2 port pin" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX + default 0 if IDF_TARGET_ESP32C3 + default 0 + help + Output LED 2, default GPIO port 0 + endmenu diff -r 913eb9ca40b1 -r 86b275481021 main/dcf77tx.c --- a/main/dcf77tx.c Thu Oct 19 17:32:16 2023 +0200 +++ b/main/dcf77tx.c Fri Oct 20 15:57:56 2023 +0200 @@ -7,6 +7,7 @@ static const char *TAG = "dcf77tx"; static TaskHandle_t xTaskWifi = NULL; +static TaskHandle_t xTaskDCF = NULL; char hostname[32]; int Main_Loop = ML_INIT; @@ -15,6 +16,9 @@ extern WIFI_State *wifi_state; ///< WiFi state extern bool _wifi_ScanDone; extern int8_t _wifi_RSSI; +extern SemaphoreHandle_t xSemaphoreDCF; +extern DCF_State *dcf_state; ///< DCF77 state +extern bool System_TimeOk; void app_main(void) @@ -38,30 +42,30 @@ esp_efuse_mac_get_default(mac_addr); sprintf(hostname, "dcf77tx-%02x%02x%02x", mac_addr[3], mac_addr[4], mac_addr[5]); + setenv("TZ", "CET-01CEST-02,M3.4.0,M10.4.0", 1); + tzset(); + esp_log_level_set("wifi", ESP_LOG_ERROR); xTaskCreate(&task_wifi, "task_wifi", 4096, NULL, 3, &xTaskWifi); + xTaskCreate(&task_DCF, "task_DCF", 4096, NULL, 4, &xTaskDCF); int wait = 150; while (wait) { vTaskDelay(100 / portTICK_PERIOD_MS); if (ready_WiFi()) { - ESP_LOGI(TAG, "Online in %.1f seconds", (150 - wait) / 10.0); - wait = 0; + ESP_LOGI(TAG, "Online in %.1f seconds", (150 - wait) / 10.0); + wait = 0; } else { - wait--; - if (wait < 1) - ESP_LOGE(TAG, "Timeout network connection"); + wait--; + if (wait < 1) + ESP_LOGE(TAG, "Timeout network connection"); } } - time_t now; struct tm timeinfo; char strftime_buf[64]; time(&now); - // Set timezone to Central Europe Time and print local time - setenv("TZ", "CET-01CEST-02,M3.4.0,M10.4.0", 1); - tzset(); localtime_r(&now, &timeinfo); strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); ESP_LOGI(TAG, "The current date/time in Amsterdam is: %s", strftime_buf); @@ -74,14 +78,38 @@ case ML_INIT: if (ready_WiFi() ) { Main_Loop = ML_SYNC; ESP_LOGI(TAG, "ML_INIT -> ML_SYNC"); + gpio_set_level(CONFIG_LED1_PIN, 1); } else { Main_Loop = ML_CONNECT; ESP_LOGI(TAG, "ML_INIT -> ML_CONNECT"); } break; - case ML_CONNECT: break; - case ML_SYNC: break; - case ML_RUN: break; + case ML_CONNECT: if (System_TimeOk) { + Main_Loop = ML_SYNC; + ESP_LOGI(TAG, "ML_CONNECT -> ML_SYNC"); + } + break; + case ML_SYNC: if (System_TimeOk == false) { + Main_Loop = ML_CONNECT; + ESP_LOGI(TAG, "ML_SYNC -> ML_CONNECT"); + } + time(&now); + localtime_r(&now, &timeinfo); + if (timeinfo.tm_sec == 0) { + Main_Loop = ML_RUN; + ESP_LOGI(TAG, "ML_SYNC -> ML_RUN"); + request_DCF(true); + gpio_set_level(CONFIG_LED2_PIN, 1); + gpio_set_level(CONFIG_LED1_PIN, 0); + } + break; + case ML_RUN: if (System_TimeOk == false) { + Main_Loop = ML_CONNECT; + ESP_LOGI(TAG, "ML_RUN -> ML_CONNECT"); + request_DCF(false); + gpio_set_level(CONFIG_LED2_PIN, 0); + } + break; } vTaskDelay(10 / portTICK_PERIOD_MS); diff -r 913eb9ca40b1 -r 86b275481021 main/dcf77tx.h --- a/main/dcf77tx.h Thu Oct 19 17:32:16 2023 +0200 +++ b/main/dcf77tx.h Fri Oct 20 15:57:56 2023 +0200 @@ -34,6 +34,7 @@ #include "task_wifi.h" +#include "task_dcf.h" typedef enum { diff -r 913eb9ca40b1 -r 86b275481021 main/idf_component.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/idf_component.yml Fri Oct 20 15:57:56 2023 +0200 @@ -0,0 +1,2 @@ +dependencies: + espressif/led_strip: "^2.0.0" diff -r 913eb9ca40b1 -r 86b275481021 main/task_dcf.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/task_dcf.c Fri Oct 20 15:57:56 2023 +0200 @@ -0,0 +1,72 @@ +/** + * @file task_dcf.c + * @brief DCF77 task. + */ + + +#include "dcf77tx.h" + + +static const char *TAG = "task_dcf"; + + +SemaphoreHandle_t xSemaphoreDCF = NULL; ///< Semaphore DCF task. +EventGroupHandle_t xEventGroupDCF; ///< Events DCF task. +DCF_State *dcf_state = NULL; ///< Public state for other tasks. + +#define LED1 CONFIG_LED1_PIN +#define LED2 CONFIG_LED2_PIN + + +const int TASK_DCF_REQUEST_START = BIT0; +const int TASK_DCF_REQUEST_STOP = BIT1; + +const int TASK_DCF_RUN = BIT2; + + +bool ready_DCF(void) +{ + return dcf_state->DCF_running; +} + + + +void request_DCF(bool run) +{ +} + + + +void task_DCF(void *pvParameters) +{ + ESP_LOGI(TAG, "Starting DCF77"); + + xEventGroupDCF = xEventGroupCreate(); + xSemaphoreDCF = xSemaphoreCreateMutex(); + dcf_state = malloc(sizeof(DCF_State)); + memset(dcf_state, 0x00, sizeof(DCF_State)); + + gpio_reset_pin(LED1); + gpio_reset_pin(LED2); + gpio_set_direction(LED1, GPIO_MODE_OUTPUT); + gpio_set_direction(LED2, GPIO_MODE_OUTPUT); + + xEventGroupClearBits(xEventGroupDCF, TASK_DCF_RUN); + EventBits_t uxBits; + + for (;;) { + uxBits = xEventGroupWaitBits(xEventGroupDCF, TASK_DCF_REQUEST_START | TASK_DCF_REQUEST_STOP, pdFALSE, pdFALSE, portMAX_DELAY ); + + if (uxBits & TASK_DCF_REQUEST_START) { + if (dcf_state->DCF_running) { + /* Already running */ + xEventGroupClearBits(xEventGroupDCF, TASK_DCF_REQUEST_START); + } + + } else if (uxBits & TASK_DCF_REQUEST_STOP) { + + } + } /* for(;;) */ +} + + diff -r 913eb9ca40b1 -r 86b275481021 main/task_dcf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/task_dcf.h Fri Oct 20 15:57:56 2023 +0200 @@ -0,0 +1,39 @@ +/** + * @file task_dcf.h + * @brief DCF77 task. Run transmitter. + */ + +#ifndef _TASK_DCF_H +#define _TASK_DCF_H + + +/** + * @brief Structure containing the information of the driver task. + */ +typedef struct { + bool DCF_running; ///< If driver is running. +} DCF_State; + + + +/** + * @brief Test if transmitter is running. + * @return Return true if transmitting. + */ +bool ready_DCF(void); + + +/** + * @brief Request transmitter state + */ +void request_DCF(bool run); + + +/** + * @brief Main task for the dcf77 transmitter. + * @param pvParameters Parameters for the task. + */ +void task_DCF(void *pvParameters); + + +#endif diff -r 913eb9ca40b1 -r 86b275481021 main/task_wifi.c --- a/main/task_wifi.c Thu Oct 19 17:32:16 2023 +0200 +++ b/main/task_wifi.c Fri Oct 20 15:57:56 2023 +0200 @@ -13,24 +13,20 @@ SemaphoreHandle_t xSemaphoreWiFi = NULL; ///< Semaphore WiFi task. EventGroupHandle_t xEventGroupWifi; ///< Events WiFi task. -uint16_t ap_num = MAX_AP_NUM; ///< Scan counter. -wifi_ap_record_t *accessp_records; ///< [MAX_AP_NUM] records array with scan results. wifi_config_t *task_wifi_ConfigSTA = NULL; ///< Current STA configuration. WIFI_State *wifi_state = NULL; ///< Public state for other tasks. esp_netif_t *sta_netif = NULL; ///< Station interface -wifi_scan_config_t scan_config = { ///< WiFi scanner configuration. - .ssid = (uint8_t *)CONFIG_ESP_WIFI_SSID, - .bssid = 0, - .channel = 0, - .show_hidden = false -}; +//wifi_scan_config_t scan_config = { ///< WiFi scanner configuration. +// .ssid = (uint8_t *)CONFIG_ESP_WIFI_SSID, +// .bssid = 0, +// .channel = 0, +// .show_hidden = false +//}; -bool _wifi_ScanDone = false; ///< Scan ready -bool _wifi_BetterAP = false; ///< If better AP available. +bool System_TimeOk = false; ///< True if online and sntp sync. int8_t _wifi_RSSI = -127; ///< Latest RSSI level. -uint16_t _wifi_Scanned = 0; ///< Total scanned APs. extern char hostname[]; ///< Generated hostname @@ -38,8 +34,6 @@ const int TASK_WIFI_REQUEST_STA_DISCONNECT = BIT0; ///< When set, means a client requested to disconnect from currently connected AP. const int TASK_WIFI_REQUEST_STA_CONNECT = BIT1; ///< When set, means a client requested to connect to an access point. -const int TASK_WIFI_REQUEST_STA_SCAN = BIT2; ///< When set, means a client requested a AP scan. -const int TASK_WIFI_REQUEST_STA_STATUS = BIT3; ///< When set, means a client requested to update the connection status. const int TASK_WIFI_HAS_IP = BIT4; ///< Indicate that we have an IP address const int TASK_WIFI_STA_FAILED = BIT5; ///< Indicate that we could not get a connection to AP as station. @@ -66,25 +60,12 @@ -void status_WiFi(void) -{ - xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_STATUS); -} - - - void request_WiFi(void) { xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_CONNECT); } -void scan_WiFi(void) -{ - xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_SCAN); -} - - void disconnect_WiFi(void) { xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_DISCONNECT); @@ -114,38 +95,12 @@ { switch (event_id) { - case WIFI_EVENT_SCAN_DONE: - { - /* Get the results so the memory used is freed. */ - ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&ap_num, accessp_records)); - ESP_LOGI(TAG, "Event wifi Scane done, %d records", ap_num); - _wifi_BetterAP = false; - for (int i = 0; i < ap_num; i++) { - wifi_ap_record_t ap = accessp_records[i]; - ESP_LOGI(TAG, "AP:%d bssid:%02x:%02x:%02x:%02x:%02x:%02x ssid:%s ch:%d rssi:%d", - i, ap.bssid[0], ap.bssid[1], ap.bssid[2], ap.bssid[3], ap.bssid[4], ap.bssid[5], - ap.ssid, ap.primary, ap.rssi); - if (ap.rssi > CONFIG_ESP_WIFI_ROAMING_LEVEL && ap.rssi > (_wifi_RSSI + 3)) { - _wifi_BetterAP = true; - ESP_LOGI(TAG, "AP:%d is a better AP", i); - } - } - _wifi_Scanned = ap_num; - _wifi_ScanDone = true; - if (_wifi_BetterAP) { - ESP_LOGI(TAG, "Disconnect current AP"); - disconnect_WiFi(); - } - break; - } - case WIFI_EVENT_STA_START: { ESP_LOGI(TAG, "Event wifi START"); // Set the configured hostname for the dhcp client. ESP_ERROR_CHECK(esp_netif_set_hostname(sta_netif, hostname)); esp_wifi_connect(); - _wifi_BetterAP = false; break; } @@ -168,7 +123,6 @@ ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_STA_CONNECTED"); } print_servers(); - _wifi_BetterAP = false; xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED); xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED); break; @@ -188,7 +142,7 @@ } else { ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_STA_DISCONNECTED"); } - _wifi_BetterAP = false; + System_TimeOk = false; xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED); xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED); break; @@ -236,6 +190,7 @@ } else { ESP_LOGE(TAG, "got_ip_event_handler() lock error IP_EVENT_STA_LOST_IP"); } + System_TimeOk = false; break; case IP_EVENT_AP_STAIPASSIGNED: @@ -261,11 +216,12 @@ if (rc == SNTP_SYNC_STATUS_COMPLETED) { time(&now); localtime_r(&now, &timeinfo); -// System_TimeOk = true; + System_TimeOk = true; strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); ESP_LOGI(TAG, "NTP time is set: %s", strftime_buf); } else { ESP_LOGI(TAG, "NTP unknown time sync event rc=%d", rc); + System_TimeOk = false; } } @@ -314,7 +270,6 @@ /* * memory allocation of objects used by the task */ - accessp_records = (wifi_ap_record_t*)malloc(sizeof(wifi_ap_record_t) * MAX_AP_NUM); xSemaphoreWiFi = xSemaphoreCreateMutex(); wifi_state = malloc(sizeof(WIFI_State)); memset(wifi_state, 0x00, sizeof(WIFI_State)); @@ -331,14 +286,9 @@ .sta = { .ssid = CONFIG_ESP_WIFI_SSID, .password = CONFIG_ESP_WIFI_PASSWORD, -#if CONFIG_WIFI_ALL_CHANNEL_SCAN - .scan_method = WIFI_ALL_CHANNEL_SCAN, -#elif CONFIG_WIFI_FAST_SCAN .scan_method = WIFI_FAST_SCAN, -#endif .failure_retry_cnt = 3, .sort_method = WIFI_CONNECT_AP_BY_SIGNAL, - .threshold.rssi = CONFIG_ESP_FAST_SCAN_MINIMUM_SIGNAL, .threshold.authmode = WIFI_AUTH_WPA2_PSK, }, }; @@ -354,9 +304,7 @@ for(;;) { /* actions that can trigger: request a connection, a scan, or a disconnection */ - uxBits = xEventGroupWaitBits(xEventGroupWifi, - TASK_WIFI_REQUEST_STA_CONNECT | TASK_WIFI_REQUEST_STA_DISCONNECT | TASK_WIFI_REQUEST_STA_SCAN | TASK_WIFI_REQUEST_STA_STATUS, - pdFALSE, pdFALSE, portMAX_DELAY ); + uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_CONNECT | TASK_WIFI_REQUEST_STA_DISCONNECT, pdFALSE, pdFALSE, portMAX_DELAY ); if (uxBits & TASK_WIFI_REQUEST_STA_DISCONNECT) { /* @@ -383,37 +331,6 @@ xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_FAILED); } uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED, pdFALSE, pdFALSE, 5000 / portTICK_PERIOD_MS); - - } else if (uxBits & TASK_WIFI_REQUEST_STA_STATUS) { - /* - * Request WiFi update status, refresh the rssi. - */ - ESP_LOGD(TAG, "Request STA status"); - xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_STATUS); - wifi_ap_record_t ap_info; - esp_wifi_sta_get_ap_info(&ap_info); - ESP_LOGI(TAG, "Event STA status, ssid:%s, bssid:" MACSTR ", rssi: %d", ap_info.ssid, MAC2STR(ap_info.bssid), ap_info.rssi); - _wifi_RSSI = ap_info.rssi; - _wifi_BetterAP = false; - if (xSemaphoreTake(xSemaphoreWiFi, 35) == pdTRUE) { - wifi_state->STA_rssi = ap_info.rssi; - wifi_state->STA_channel = ap_info.primary; - snprintf(wifi_state->STA_bssid, 18, "%02x:%02x:%02x:%02x:%02x:%02x", - ap_info.bssid[0], ap_info.bssid[1], ap_info.bssid[2], ap_info.bssid[3], ap_info.bssid[4], ap_info.bssid[5]); - xSemaphoreGive(xSemaphoreWiFi); - } else { - ESP_LOGE(TAG, "lock error TASK_WIFI_REQUEST_STA_STATUS"); - } - - } else if (uxBits & TASK_WIFI_REQUEST_STA_SCAN) { - - ESP_LOGI(TAG, "Request STA scan"); - xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_SCAN); - /* safe guard against overflow */ - ap_num = MAX_AP_NUM; - _wifi_ScanDone = false; - _wifi_BetterAP = false; - ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, false)); } } /* for(;;) */ diff -r 913eb9ca40b1 -r 86b275481021 main/task_wifi.h --- a/main/task_wifi.h Thu Oct 19 17:32:16 2023 +0200 +++ b/main/task_wifi.h Fri Oct 20 15:57:56 2023 +0200 @@ -32,24 +32,12 @@ /** - * @brief Signal to update the WiFi rssi status. - */ -void status_WiFi(void); - - -/** * @brief Request a WiFi connection. */ void request_WiFi(void); /** - * @brief Request a WiFi scan. - */ -void scan_WiFi(void); - - -/** * @brief Request WiFi disconnect. */ void disconnect_WiFi(void); diff -r 913eb9ca40b1 -r 86b275481021 sdkconfig --- a/sdkconfig Thu Oct 19 17:32:16 2023 +0200 +++ b/sdkconfig Fri Oct 20 15:57:56 2023 +0200 @@ -395,13 +395,11 @@ # CONFIG_ESP_WIFI_SSID="MBSE_WLP" CONFIG_ESP_WIFI_PASSWORD="abcjkltuv" -CONFIG_WIFI_FAST_SCAN=y -# CONFIG_WIFI_ALL_CHANNEL_SCAN is not set -CONFIG_ESP_FAST_SCAN_MINIMUM_SIGNAL=-96 -CONFIG_ESP_WIFI_ROAMING_LEVEL=-67 # end of WiFi settings -CONFIG_ANTENNA=10 +CONFIG_ANTENNA_PIN=10 +CONFIG_LED1_PIN=1 +CONFIG_LED2_PIN=0 # end of DCF77tx configuration # @@ -761,8 +759,8 @@ # CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=13 +CONFIG_ESP_PHY_MAX_TX_POWER=13 CONFIG_ESP_PHY_REDUCE_TX_POWER=y CONFIG_ESP_PHY_ENABLE_USB=y # CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set @@ -1062,8 +1060,8 @@ # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_COLORS=y -CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y -# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# CONFIG_LOG_TIMESTAMP_SOURCE_RTOS is not set +CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM=y # end of Log output # @@ -1595,8 +1593,8 @@ CONFIG_ESP32C3_RTC_CLK_CAL_CYCLES=1024 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=13 +CONFIG_ESP32_PHY_MAX_TX_POWER=13 CONFIG_REDUCE_PHY_TX_POWER=y CONFIG_ESP32_REDUCE_PHY_TX_POWER=y CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y