#include #include #ifndef APSSID #define APSSID "Hubert" //SSID (selbst einsetzen) #define APPSK "123456789" //Passwort(selbst vergeben) #endif const char *ssid = APSSID; const char *password = APPSK; const int ap_channel = 6; const boolean ap_hidden = false; IPAddress local_ip(192,168,4,100); //IP des AP (selbst vergeben) IPAddress gateway(192,168,4,254); //IP des Gateway falls Internetverbindung IPAddress netmask(255,255,255,0); ESP8266WebServer server(80); static const char StartPage[] PROGMEM = R"EOF(

ESP8266 Web Server

Mein eigener Text, der frei gestaltet werden kann.

)EOF"; // ##### Setup void setup() { Serial.begin(115200); Serial.println(); Serial.println("Setting IP Address"); WiFi.softAPConfig(local_ip, gateway, netmask); Serial.print("IP Address: "); Serial.println(WiFi.softAPIP()); Serial.println("Starting Access Point"); boolean result = WiFi.softAP(ssid, password, ap_channel, ap_hidden); if (result == true) { Serial.println("Access Point Ready"); Serial.print("SSID: "); Serial.println(ssid); Serial.print("Channel: "); Serial.println(ap_channel); server.on("/", handleRoot); server.onNotFound(handleNotFound); server.begin(); Serial.println("Web Server Started"); } else { Serial.println("Failed!"); } } // ##### Loop void loop() { server.handleClient(); } // ##### Functions void handleRoot() { server.send(200, "text/html", StartPage); } void handleNotFound() { server.send(404, "text/plain", "404 Not found"); }