From 29d5ea430c0016b283f9064f9999d8f8898d17c8 Mon Sep 17 00:00:00 2001 From: Ioann Volkov Date: Sat, 11 Sep 2021 01:45:23 +0300 Subject: [PATCH] ESP: Using crutch from https://github.com/esp8266/Arduino/issues/6886 (sending ARP broadcasts every second) --- ESP8266_Firmware/src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ESP8266_Firmware/src/main.cpp b/ESP8266_Firmware/src/main.cpp index 2b52f11..fb5c515 100644 --- a/ESP8266_Firmware/src/main.cpp +++ b/ESP8266_Firmware/src/main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -255,6 +256,9 @@ bool connectToWiFi(const char* ssid, const char* passphrase, bool connectInfinit Serial.printf("Connected, IP: %s\n", ip.toString().c_str()); digitalWrite(LED_BUILTIN, HIGH); + // This should partly help for quick responses, details: https://github.com/esp8266/Arduino/issues/6886 + experimental::ESP8266WiFiGratuitous::stationKeepAliveSetIntervalMs(); + const bool listeningMulticast = udp.beginMulticast(ip, UDP_MULTICAST_IP, UDP_MULTICAST_PORT); if (listeningMulticast) { Serial.printf("Started listening UDP multicast on %s:%d\n", UDP_MULTICAST_IP.toString().c_str(), UDP_MULTICAST_PORT); @@ -541,7 +545,7 @@ void setup() { WiFi.softAPdisconnect(true); isAccessPointEnabled = false; - // This should help for quick responses, details: https://github.com/esp8266/Arduino/issues/6886 + // This should partly help for quick responses, details: https://github.com/esp8266/Arduino/issues/6886 if (!WiFi.setSleepMode(WIFI_NONE_SLEEP)) { Serial.println("Failed to set wi-fi sleep mode to None!"); }