Code: Select all
void setup()
{
Serial.begin(115200);
pinMode(5, OUTPUT); // set the LED pin mode
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
[b]WiFi.begin(ssid, password);[/b]
Code: Select all
static bool _esp_wifi_started = false;
static bool espWiFiStart(){
if(_esp_wifi_started){
return true;
}
if(!wifiLowLevelInit()){
return false;
}
[b]esp_err_t err = esp_wifi_start();[/b]
if (err != ESP_OK) {
log_e("esp_wifi_start %d", err);
wifiLowLevelDeinit();
return false;
}
_esp_wifi_started = true;
return true;
}