Port of a E1.31 Library could do with some help testing

I’m in the process of porting an E1.31 (sACN) library to run on my photon.

I’ve got the code working as stand alone app fine but the library version is doing some funky stuff, I’m sure I’ll figure it out eventually but if anyone has time to help out you can see my code over here:

Would love any help you guys can offer

1 Like

I would advise to rename E131.ino to prevent building conflicts.
Since .ino files get preprocessed for Wiring and consequently renamed to .cpp you’d be dealing with two E131.cpp files.

Ah, thanks I added it to the repo after testing it myself so I know that is not what was causing the issue but I’ve renamed it

OK, then what exactly does “some funky stuff” mean?

The data isn’t correct, it works fine in the standalone version but, I checked the first 3 channels and the first 2 are always 0 and the 3rd was reporting 2.
I’m sure I’m missing something but It hasn’t hit me yet

I might have miscounted but the struct in e131_packet_t is 639 byte but the raw array only features 638 bytes - but since that’s the case for both versions this shouldn’t make the class version break.
The bigger issue might be that you don’t set packet = &packetBuffer; in your first overload of E131::begin().

1 Like

Thanks
No you didn’t miscount, I based my code on a start someone else had made on porting the library and they had added uint8_t unknownValue; before the data values.
I suspect they did that to eat up the start Code that proceeds the DMX data, but didn’t reduce the properties value array by one to match.
It wouldn’t been an issue unless you decided to use the final channel in the universe then null reference, opps.

I’ve fixed that up so.

That was indeed the bit that was broken, I reckon I would have figured it out eventually but it always seems someone who isn’t familiar with the code will find it quicker.

Its working now, so I’ll publish it to the library database for everyone to use, and if anyone has any other feedback, suggestions or improvements let me know.
If you need details about E1.31 you can find the standard documented at http://tsp.esta.org/tsp/documents/docs/E1-31-2016.pdf

3 Likes

@AdmiralTH I am having trouble with my devices no longer responding to e.131 packets over time. maybe there is an overflow somewhere? The device still responds to cloud commands. I have the device constantly trying to parse e.131 with:

void loop()
{
      read131();
}

void read131(){
    int ledoffset =3;
    	    if(e131.parsePacket()) {

    	       int LedUniStart = ((e131.universe - FIRSTUNIVERSE)*510)/3;
            	for (int i = 0; i < 170; i++){
					int indexoffset = i * ledoffset;
					leds[i+LedUniStart].setRGB( e131.data[(indexoffset)+1], e131.data[(indexoffset)+2], e131.data[(indexoffset)+3]);
				}
                FastLED.show();
    }	
}

I also had the same issue with the neopixel library. so I believe the issue lies somewhere in the e.131 library? or some dumb mistake I’m making haha