mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 12:08:38 +00:00
Fix WiFi if NVS failed to initialize
This commit is contained in:
@@ -179,7 +179,10 @@ void WiFiComponent::wifi_pre_setup_() {
|
||||
#endif // USE_WIFI_AP
|
||||
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
// cfg.nvs_enable = false;
|
||||
if (global_preferences->nvs_handle == 0) {
|
||||
ESP_LOGW(TAG, "NVS failed to initialize, starting WiFi with NVS disabled");
|
||||
cfg.nvs_enable = false;
|
||||
}
|
||||
err = esp_wifi_init(&cfg);
|
||||
if (err != ERR_OK) {
|
||||
ESP_LOGE(TAG, "esp_wifi_init failed: %s", esp_err_to_name(err));
|
||||
|
||||
Reference in New Issue
Block a user