WiFi driver must be managed by arduino, use arduino to init the driver for esp32 core.

This commit is contained in:
Rick Watson 2019-06-07 20:14:55 +01:00
parent cf2a20fbd4
commit 61f046c185

View File

@ -44,14 +44,15 @@ void setup() {
// Disable wifi config persistance and auto reconnect // Disable wifi config persistance and auto reconnect
WiFi.persistent(false); WiFi.persistent(false);
WiFi.setAutoReconnect(false); WiFi.setAutoReconnect(false);
#if defined(ESP_PLATFORM) #if defined(ESP_PLATFORM)
// Init the wifi driver on ESP32 // Init the wifi driver on ESP32
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_err_t err = esp_wifi_init(&cfg); esp_err_t err = esp_wifi_init(&cfg);
if(err){ if(err){
log_e("esp_wifi_init %d", err); log_e("esp_wifi_init %d", err);
} }
#endif #endif
Serial.begin(SERIAL_BAUD_RATE); Serial.begin(SERIAL_BAUD_RATE);