1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00
This commit is contained in:
John Doe
2015-06-29 02:27:14 +03:00
parent 466b56641c
commit 25aa2cdc08
4 changed files with 448 additions and 179 deletions

View File

@ -23,9 +23,6 @@
const char* ssid = "............";
const char* password = "..............";
// multicast DNS responder
MDNSResponder mdns;
// TCP server at port 80 will respond to HTTP requests
WiFiServer server(80);
@ -53,7 +50,7 @@ void setup(void)
// the fully-qualified domain name is "esp8266.local"
// - second argument is the IP address to advertise
// we send our IP address on the WiFi network
if (!mdns.begin("esp8266", WiFi.localIP())) {
if (!MDNS.begin("esp8266", WiFi.localIP())) {
Serial.println("Error setting up MDNS responder!");
while(1) {
delay(1000);
@ -64,6 +61,9 @@ void setup(void)
// Start TCP (HTTP) server
server.begin();
Serial.println("TCP server started");
// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);
}
void loop(void)