From 81c810eba431c524e0452c19210f5c1f8b50a567 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Thu, 1 Nov 2018 16:16:38 +0100 Subject: [PATCH] Increased max. UDP leds from 341 to 490 MQTT now publishes state on connect --- wled00/data/settings_sync.htm | Bin 10136 -> 10148 bytes wled00/htmls01.h | 2 +- wled00/wled00.ino | 2 +- wled00/wled07_notify.ino | 17 ++++++++++------- wled00/wled17_mqtt.ino | 2 ++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index 9775ed680b545a0df0ec96a864c83e8241504dbf..aacc4311680b9873bca5faebee61c712b706ad84 100644 GIT binary patch delta 22 dcmbQ?zr=q7lQ3s7LkUA7LlHyC=Kn%7MF3Mu2S@+_ delta 12 TcmZ4DKf`|mlkjFf;b|fO9|!~< diff --git a/wled00/htmls01.h b/wled00/htmls01.h index 4497a699..36ced6af 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -237,7 +237,7 @@ Send notifications twice:
Receive UDP realtime:

E1.31 (sACN)
Use E1.31 multicast:
-E1.31 universe:
+E1.31 start universe:
Reboot required. Check out LedFx!

Timeout: ms
Force max brightness:
diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 102a8178..d156cd83 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -63,7 +63,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1811011 +#define VERSION 1811012 char versionString[] = "0.8.1"; diff --git a/wled00/wled07_notify.ino b/wled00/wled07_notify.ino index c4ed2622..367a9a97 100644 --- a/wled00/wled07_notify.ino +++ b/wled00/wled07_notify.ino @@ -3,6 +3,7 @@ */ #define WLEDPACKETSIZE 24 +#define UDP_IN_MAXSIZE 1472 void notify(byte callMode, bool followUp=false) { @@ -124,16 +125,16 @@ void handleNotifications() if (!packetSize && udpRgbConnected) { packetSize = rgbUdp.parsePacket(); if (!receiveDirect) return; - if (packetSize > 1026 || packetSize < 3) return; + if (packetSize > UDP_IN_MAXSIZE || packetSize < 3) return; realtimeIP = rgbUdp.remoteIP(); DEBUG_PRINTLN(rgbUdp.remoteIP()); - byte udpIn[packetSize]; - rgbUdp.read(udpIn, packetSize); + olen = 0; + rgbUdp.read(obuf, packetSize); arlsLock(realtimeTimeoutMs); uint16_t id = 0; for (uint16_t i = 0; i < packetSize -2; i += 3) { - setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0); + setRealtimePixel(id, obuf[i], obuf[i+1], obuf[i+2], 0); id++; if (id >= ledCount) break; } @@ -141,11 +142,13 @@ void handleNotifications() return; } - if (packetSize > 1026) return; + if (packetSize > UDP_IN_MAXSIZE) return; if(packetSize && notifierUdp.remoteIP() != WiFi.localIP()) //don't process broadcasts we send ourselves { - byte udpIn[packetSize]; - notifierUdp.read(udpIn, packetSize); + olen = 0; + notifierUdp.read(obuf, packetSize); + char* udpIn = obuf; + if (udpIn[0] == 0 && !realtimeActive && receiveNotifications) //wled notifier, block if realtime packets active { if (receiveNotificationColor) diff --git a/wled00/wled17_mqtt.ino b/wled00/wled17_mqtt.ino index 5b69ee51..63ddb0a0 100644 --- a/wled00/wled17_mqtt.ino +++ b/wled00/wled17_mqtt.ino @@ -93,6 +93,8 @@ bool reconnectMQTT() strcat(subuf, "/api"); mqtt->subscribe(subuf); } + + publishMQTT(); } return mqtt->connected(); }