diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 2acb92f..a2e292d 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -31,7 +31,13 @@ #include "CommandDistributor.h" #include "WiThrottle.h" #include "DCCTimer.h" -#if __has_include ( "MDNS_Generic.h") + +#include "EXmDNS.h" +#define DO_MDNS +EthernetUDP udp; +MDNS mdns(udp); + +#if 0 //#if __has_include ( "MDNS_Generic.h") #include "MDNS_Generic.h" #define DO_MDNS EthernetUDP udp; @@ -124,11 +130,9 @@ void EthernetInterface::setup() outboundRing=new RingStream(OUTBOUND_RING_SIZE); #ifdef DO_MDNS - mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME); // hostname - udp.begin(IPAddress(224, 0, 0, 251), 5353, true); - mdns.addServiceRecord(WIFI_HOSTNAME "._withrottle", IP_PORT, MDNSServiceTCP); -// mdns.setServiceFoundCallback(serviceFound); -// mdns.startDiscoveringService("_withrottle", MDNSServiceTCP, 0); + if (!mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME)) + DIAG("mdns.begin fail"); // hostname + mdns.addServiceRecord(WIFI_HOSTNAME, IP_PORT, MDNSServiceTCP); // Not sure if we need to run it once, but just in case! mdns.run(); #endif diff --git a/STM32lwipopts.h b/STM32lwipopts.h index d4053e8..24a3fae 100644 --- a/STM32lwipopts.h +++ b/STM32lwipopts.h @@ -57,8 +57,8 @@ a lot of data that needs to be copied, this should be set high. */ #define MEM_SIZE (10*1024) // Could be better or worse, needs more tests -//#define MEM_LIBC_MALLOC 1 -//#define MEMP_MEM_MALLOC 1 +#define MEM_LIBC_MALLOC 1 // critical, fixes heap trashing +#define MEMP_MEM_MALLOC 1 // uses malloc which means no pools which means slower but not mean 32KB up front /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application sends a lot of data out of ROM (or other static memory), this