Skip to content

Commit a439694

Browse files
committed
increase max. assumed packets to 9 in DDP for push
1 parent bed14e6 commit a439694

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

wled00/e131.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol) {
255255
{ //DDP
256256
realtimeIP = clientIP;
257257
int lastPushSeq = e131LastSequenceNumber[0];
258-
//reject late packets belonging to previous frame (assuming 4 packets max. before push)
258+
int sn = p->sequenceNum & 0xF;
259+
// reject late packets belonging to previous frame (assuming 9 packets max. before push (max ~4300 pixels))
259260
if (e131SkipOutOfSequence && lastPushSeq) {
260-
int sn = p->sequenceNum & 0xF;
261261
if (sn) {
262-
if (lastPushSeq > 5) {
263-
if (sn > (lastPushSeq -5) && sn < lastPushSeq) return;
262+
if (lastPushSeq > 8) {
263+
if (sn > (lastPushSeq - 8) && sn < lastPushSeq) return;
264264
} else {
265-
if (sn > (10 + lastPushSeq) || sn < lastPushSeq) return;
265+
if (sn > (15 - lastPushSeq) || sn < lastPushSeq) return;
266266
}
267267
}
268268
}
@@ -285,7 +285,6 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol) {
285285
ddpSeenPush |= push;
286286
if (!ddpSeenPush || push) { // if we've never seen a push, or this is one, render display
287287
e131NewData = true;
288-
int sn = p->sequenceNum & 0xF;
289288
if (sn) e131LastSequenceNumber[0] = sn;
290289
}
291290
return;

wled00/wled.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// version code in format yymmddb (b = daily build)
1111
#ifndef AUTOBUILD
12-
#define VERSION 2601310
12+
#define VERSION 2603290
1313
#else
1414
#define VERSION BUILD
1515
#endif
@@ -421,17 +421,17 @@ WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to f
421421
WLED_GLOBAL uint16_t DMXStart _INIT(10); // start address of the first fixture
422422
WLED_GLOBAL uint16_t DMXStartLED _INIT(0); // LED from which DMX fixtures start
423423
#endif
424-
WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consecutive universes)
425-
WLED_GLOBAL uint16_t e131Port _INIT(5568); // DMX in port. E1.31 default is 5568, Art-Net is 6454
426-
WLED_GLOBAL byte e131Priority _INIT(0); // E1.31 port priority (if != 0 priority handling is active)
427-
WLED_GLOBAL E131Priority highPriority _INIT(3); // E1.31 highest priority tracking, init = timeout in seconds
428-
WLED_GLOBAL byte DMXMode _INIT(DMX_MODE_MULTIPLE_RGB); // DMX mode (s.a.)
429-
WLED_GLOBAL uint16_t DMXAddress _INIT(1); // DMX start address of fixture, a.k.a. first Channel [for E1.31 (sACN) protocol]
430-
WLED_GLOBAL uint16_t DMXSegmentSpacing _INIT(0); // Number of void/unused channels between each segments DMX channels
431-
WLED_GLOBAL byte e131LastSequenceNumber[E131_MAX_UNIVERSE_COUNT]; // to detect packet loss
432-
WLED_GLOBAL bool e131Multicast _INIT(false); // multicast or unicast
433-
WLED_GLOBAL bool e131SkipOutOfSequence _INIT(false); // freeze instead of flickering
434-
WLED_GLOBAL uint16_t pollReplyCount _INIT(0); // count number of replies for ArtPoll node report
424+
WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consecutive universes)
425+
WLED_GLOBAL uint16_t e131Port _INIT(5568); // DMX in port. E1.31 default is 5568, Art-Net is 6454
426+
WLED_GLOBAL byte e131Priority _INIT(0); // E1.31 port priority (if != 0 priority handling is active)
427+
WLED_GLOBAL E131Priority highPriority _INIT(3); // E1.31 highest priority tracking, init = timeout in seconds
428+
WLED_GLOBAL byte DMXMode _INIT(DMX_MODE_MULTIPLE_RGB); // DMX mode (s.a.)
429+
WLED_GLOBAL uint16_t DMXAddress _INIT(1); // DMX start address of fixture, a.k.a. first Channel [for E1.31 (sACN) protocol]
430+
WLED_GLOBAL uint16_t DMXSegmentSpacing _INIT(0); // Number of void/unused channels between each segments DMX channels
431+
WLED_GLOBAL byte e131LastSequenceNumber[E131_MAX_UNIVERSE_COUNT] _INIT_N(({0})); // to detect packet loss; 1 mandatory for DDP
432+
WLED_GLOBAL bool e131Multicast _INIT(false); // multicast or unicast
433+
WLED_GLOBAL bool e131SkipOutOfSequence _INIT(false); // freeze instead of flickering
434+
WLED_GLOBAL uint16_t pollReplyCount _INIT(0); // count number of replies for ArtPoll node report
435435

436436
// mqtt
437437
WLED_GLOBAL unsigned long lastMqttReconnectAttempt _INIT(0); // used for other periodic tasks too

0 commit comments

Comments
 (0)