kbox-firmware icon indicating copy to clipboard operation
kbox-firmware copied to clipboard

Use Bonjour to announce kbox on network

Open sarfata opened this issue 8 years ago • 1 comments

sarfata avatar Oct 15 '16 08:10 sarfata

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();
}

neftaly avatar May 24 '17 22:05 neftaly