Skip to content

Commit

Permalink
ESP: Using crutch from esp8266/Arduino#6886 (sending ARP broadcasts e…
Browse files Browse the repository at this point in the history
…very second)
  • Loading branch information
Tsar committed Sep 10, 2021
1 parent 67d25d2 commit 29d5ea4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ESP8266_Firmware/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <ESP8266WiFi.h>
#include <ESP8266WiFiGratuitous.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include <lwip/igmp.h>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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!");
}
Expand Down

0 comments on commit 29d5ea4

Please sign in to comment.