From 61f046c1852e404c0cd2282b483b53cb16726109 Mon Sep 17 00:00:00 2001 From: Rick Watson Date: Fri, 7 Jun 2019 20:14:55 +0100 Subject: [PATCH] WiFi driver must be managed by arduino, use arduino to init the driver for esp32 core. --- src/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9d90008..029092c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,14 +44,15 @@ void setup() { // Disable wifi config persistance and auto reconnect WiFi.persistent(false); WiFi.setAutoReconnect(false); - + #if defined(ESP_PLATFORM) // Init the wifi driver on ESP32 - wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); - esp_err_t err = esp_wifi_init(&cfg); - if(err){ - log_e("esp_wifi_init %d", err); - } + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + esp_err_t err = esp_wifi_init(&cfg); + if(err){ + log_e("esp_wifi_init %d", err); + } + #endif Serial.begin(SERIAL_BAUD_RATE);