Created
September 30, 2015 12:55
-
-
Save michaelsarduino/da09a68907064d0cf0e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <WiFiServer.h> | |
#include <WiFiUdp.h> | |
#include <ESP8266mDNS.h> | |
#include <ESP8266WebServer.h> | |
ESP8266WebServer server(80); | |
MDNSResponder mdns; | |
void setup() { | |
WiFi.softAP("esp8266_ap", "michaelsarduino"); | |
Serial.begin(115200); | |
if (mdns.begin("esp8266", WiFi.localIP())) { | |
Serial.println("MDNS responder started"); | |
} | |
server.on("/", handleRoot); | |
server.on("/inline", [](){ | |
server.send(200, "text/plain", "Funktioniert"); | |
}); | |
server.begin(); | |
} | |
void loop() { | |
server.handleClient(); | |
mdns.update(); | |
} | |
void handleRoot() { | |
server.send(200, "text/html", "<html> <h2>ESP NETWORK</h2> schamlose Eigenwerbung: <b>michaelsarduino.blogspot.de/</b> </html>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment