#include <ESP8266WiFi.h>
const char* ssid = "........";
const char* password = "........";
IPAddress addr = { 192, 168, 4, 1 };
WiFiServer server(80);
void setup() {
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(addr, addr, {255, 255, 255, 0});
WiFi.softAP(ssid, password);
server.begin();
delay(25);
}
void loop() {
WiFiClient client = server.available();
if (!client) { delay(500); return; }
client.flush();
String response = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nHello";
client.print(response);
delay(1);
}
I took exactly your code (simply adding some ssid/pw) and try it out ! It worked !
Bad news : so, why it doesn't work on your side ? ...
Which version of ArduinoIDE-ESP are you using ?
Mine is 1.6.5-947-g39819f0 .
But I figured out the issue; I had a couple of _s in the ssid, which apparently causes problems somewhere along the line. Changing it from 'ESPN8266_The_Ocho' to 'ESPN8266TheOcho' makes it work correctly.
So for anyone else running into this issue, try removing special characters from the ssid. Thanks for the help!
Maybe you can submit bug about "underscores in SSID" to Espressif Bug Bounty program, you can get some rewards $$$ ...