Browse Source

feat (MDNS): added option for using mdns

- enabeled mdns can be uses for raching the tonuino over <hostname>.local
master
Mario Lukas 5 years ago
parent
commit
9ce03e0da1
  1. 12
      src/main.cpp
  2. 1
      src/settings.h

12
src/main.cpp

@ -25,6 +25,10 @@
#include <FastLED.h>
#endif
#ifdef MDNS_ENABLE
#include <ESPmDNS.h>
#endif
#if (LANGUAGE == 1)
#include "logmessages.h"
#include "websiteMgmt.h"
@ -2987,6 +2991,14 @@ wl_status_t wifiManager(void) {
} else { // Starts AP if WiFi-connect wasn't successful
accessPointStart((char *) FPSTR(accessPointNetworkSSID), apIP, apNetmask);
}
#ifdef MDNS_ENABLE
// zero conf, make device available as <hostname>.local
if (MDNS.begin(hostname.c_str())) {
MDNS.addService("http", "tcp", 80);
}
#endif
wifiNeedsRestart = false;
}

1
src/settings.h

@ -1,6 +1,7 @@
#include "Arduino.h"
//########################## MODULES #################################
//#define MDNS_ENABLE
#define MQTT_ENABLE // Make sure to configure mqtt-server and (optionally) username+pwd
#define FTP_ENABLE // Enables FTP-server
#define NEOPIXEL_ENABLE // Don't forget configuration of NUM_LEDS if enabled

Loading…
Cancel
Save