mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
ESP32 mDNS registration for throttle autodiscovery
This commit is contained in:
parent
196a27a27a
commit
ec6e730559
|
@ -20,6 +20,7 @@
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
#include "ESPmDNS.h"
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "WifiESP32.h"
|
#include "WifiESP32.h"
|
||||||
|
@ -209,6 +210,15 @@ bool WifiESP::setup(const char *SSid,
|
||||||
// no idea to go on
|
// no idea to go on
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now Wifi is up, register the mDNS service
|
||||||
|
if(!MDNS.begin(hostname)) {
|
||||||
|
DIAG(F("Wifi setup failed to start mDNS"));
|
||||||
|
}
|
||||||
|
if(!MDNS.addService("withrottle", "tcp", 2560)) {
|
||||||
|
DIAG(F("Wifi setup failed to add withrottle service to mDNS"));
|
||||||
|
}
|
||||||
|
|
||||||
server = new WiFiServer(port); // start listening on tcp port
|
server = new WiFiServer(port); // start listening on tcp port
|
||||||
server->begin();
|
server->begin();
|
||||||
// server started here
|
// server started here
|
||||||
|
|
|
@ -173,6 +173,8 @@ board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = ${env.lib_deps}
|
lib_deps = ${env.lib_deps}
|
||||||
build_flags = -std=c++17
|
build_flags = -std=c++17
|
||||||
|
monitor_speed = 115200
|
||||||
|
monitor_echo = yes
|
||||||
|
|
||||||
[env:Nucleo-F411RE]
|
[env:Nucleo-F411RE]
|
||||||
platform = ststm32
|
platform = ststm32
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
|
|
||||||
#define VERSION "4.2.59"
|
#define VERSION "4.2.60"
|
||||||
|
// 4.2.60 - Add mDNS capability to ESP32 for autodiscovery
|
||||||
// 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_
|
// 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_
|
||||||
// 4.2.58 - Start motordriver as soon as possible but without waveform
|
// 4.2.58 - Start motordriver as soon as possible but without waveform
|
||||||
// 4.2.57 - New overload handling (faster and handles commonFaultPin again)
|
// 4.2.57 - New overload handling (faster and handles commonFaultPin again)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user