I have the problem with a NodeMCU with an ESP8266 and the ArduinoIDE:
I want the to use a softAP and the password for this is supposed to be generated randomly everytime the devices is starting, it is supposed to be 8 digits long, just enough to be displayed on my 8digit 7segment display. I created a number that is being 8digits long and being converted to a String directly. Sadly, the "WiFi.softAP" command only accepts the variable type constant character, in brackets. How can I somehow get the string into a char with brackets or get WiFi.softAP to swallow a String type?
I am already this far:
MAX7219_7segment PWScreen(14,12,13);
String A,B,C;
const char *ssid = "Sellerie";
ESP8266WebServer server(80);
/* Just a little test message. Go to http://192.168.4.1 in a web browser
* connected to this access point to see it.
*/
void handleRoot() {
server.send(200, "text/plain", C);
}
void setup() {
int pw = random(10000000,99999999);
String spassword = String(pw);
//const char *password = spassword;
pinMode(0, INPUT); // D0
pinMode(5, INPUT); //D1
pinMode(LED_BUILTIN, OUTPUT);
pinMode(14, OUTPUT);
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
WiFi.softAP(ssid, spassword);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
PWScreen.write_number(pw);
Best regards Sellerie
const char *password = spassword.c_str();