From a93e046117abce6dea48fede83507dea1571dafa Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 6 May 2025 04:32:36 +0300 Subject: [PATCH] Make sending udp packets much faster Turns out parsing IP address string is very slow --- flix/wifi.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flix/wifi.ino b/flix/wifi.ino index 5343433..4872ef2 100644 --- a/flix/wifi.ino +++ b/flix/wifi.ino @@ -11,7 +11,6 @@ #define WIFI_SSID "flix" #define WIFI_PASSWORD "flixwifi" -#define WIFI_UDP_IP "255.255.255.255" #define WIFI_UDP_PORT 14550 WiFiUDP udp; @@ -23,7 +22,7 @@ void setupWiFi() { } void sendWiFi(const uint8_t *buf, int len) { - udp.beginPacket(WIFI_UDP_IP, WIFI_UDP_PORT); + udp.beginPacket(WiFi.softAPBroadcastIP(), WIFI_UDP_PORT); udp.write(buf, len); udp.endPacket(); }