Hey Im making a cool item. The thing that has stopped me to continue is that I cant use string as the ssid and password for wifi.begin!
I really wanna use string for it becuase it will be hard to convert string to const char*.
So if any of you geniuses know how I can do it?
This is the error:
no matching function for call to 'ESP8266WiFiClass::begin(String&, String&)'
The section of it:
if (myFile.find("SSID: \"")) {
String ssidName = myFile.readStringUntil('"');
Serial.println("SSID: " + ssidName);
if (myFile.find("Password: \"")) {
String passwordName = myFile.readStringUntil('"');
Serial.println("Password: " + passwordName);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssidName);
WiFi.begin(ssidName, passwordName);
while (WiFi.status() != WL_CONNECTED) {
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
delay(166);
digitalWrite(greenPin, LOW);
digitalWrite(yellowPin, HIGH);
delay(166);
digitalWrite(yellowPin, LOW);
digitalWrite(redPin, HIGH);
delay(166);
Serial.print(".");
}
}
}
Thank you so much! Or you can tell me how I make it into const char*