sarfata / kbox-firmware

Open-source electronics for your boat
https://www.tindie.com/products/sarfata/kbox-open-source-boat-gateway/
Other
47 stars 20 forks source link

Use Bonjour to announce kbox on network #24

Open sarfata opened 8 years ago

neftaly commented 7 years ago

Flyweb also uses mDNS:

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

ESP8266WebServer server(80);

void handleRequest() {
  String html = "<h1>Hello FlyWeb from ESP8266!</h1>";
  server.send(200, "text/html", html);
}

void setup() {
  String accessPointName = "FlyWeb AP";
  WiFi.mode(WIFI_AP);
  WiFi.softAP(accessPointName.c_str());
  server.on("/", handleRequest);
  server.begin();
  MDNS.begin("Hello FlyWeb");
  MDNS.addService("flyweb", "tcp", 80);
}

void loop() {
  server.handleClient();
}