Anybody managed to get tpm2 working on an arduino with fastled?

Anybody managed to get tpm2 working on an arduino with fastled?

What’re you referring to by Tpm2?

It’s a lighting protocol to control lights similar to Dmx, it has a 5 byte header then up to 1700 bytes of rgb data, like artnet but lots more channels and udp based

Even with that detail - it’s a pain trying to find info on it. Poor choice of name (do a google search for just “tpm2” and you’ll see what I mean - tpm2 protocol isn’t much better, courtesy of the trusted computing group.

Is it just a protocol or is it also a physical wire specification (or both, like DMX)?

sorry I couldn’t reply properly earlier, 2001 things going on all at once unfortunately just before a show too :confused:

I’ll attach a pastebin of the sketch I am going to try and convert to fastled, this one uses the ws2801 library but I want to fastled it as it is more flexible far more LED’s to be controlled rather than artnet which only allows 512 channels of rgb, I’m using jinx to send my data and this allows 4800 channels to be sent over the LAN, my project sits somewhere between this and artnet at 320 pixels. this is the code for an arduino tpm2 reciever
http://pastebin.com/R5YJfzuX

I’m assuming you’re going to be using a teensy or a due for this (at 4805 bytes/TPM2 packet)?

Given that bringing that much data in is almost certainly going to want interrupt handling, you should use LPD8806 or APA102’s for your leds. WS2811 and friends are just going to be a lot of pain for you.

Aaaaaaand I just read my reply which didnt answer your question Daniel lolol, tpm2 is basically a network protocol that encapsulates the channel values in to a UDP datagram, very similar to artnet but with lots more channels.

I’m only using a strip with 510 LED’s so it’s considerably bigger than artnet can handle

Just been given this link from the guy that wrote jinx, http://www.tpm2.de/ my german is terrible but somebody here may find this helpful/useful

Sadly, my german is limited to Einstürzende Neubauten and KMFDM lyrics.

That said - if you treat it like the code that’s out there for reading data from, say, a serial port, you shouldn’t have any problems with it. Just mind the interrupts for the networking hardware that you’re using (which again, pitching a vote for LPD8806 or APA102s)

KMFDM? good choice sir :wink:

This is what I’ve got http://pastebin.com/PQxgy4c5 to start with, I’ve got a load of network stuff to add and some LCD stuff, how would I go about converting this to fastled, i get the changes needed for the library and selecting the strip in the setup, it’s the actual displaying the leds i’m struggling with.

Under “// calculate offset” replace that code with:

uint16_t currentLed = packetNumberPIXELS_PER_PANEL;
int x=TPM2NET_HEADER_SIZE;
memcpy(leds + (currentLed
3), packetBuffer + TPM2NET_HEADER_SIZE, frameSize * 3);

LEDS.show();

Sooooo close lolol, this http://pastebin.com/Umtd7c7D gives me this error

tpm2net.ino: In function ‘void setup()’:
tpm2net:98: error: ‘leds’ was not declared in this scope
tpm2net.ino: In function ‘void loop()’:
tpm2net:152: error: ‘leds’ was not declared in this scope

In my last project I had to define an alias or something (cant remember what it was for though) lolol

you need to define your leds array:

CRGB leds[NUM_LEDS];

before either setup or loop

yup it was simple wasnt it :confused:

ta daaaaaaa

http://pastebin.com/LcyVYW8v

I dont have an arduino to hand till tomorrow, hows this looking? I’ve followed my code through and canr see any problems, it doesnt chuck any errors on compile either, the only concern I have is the time it will take for memcopy to run for the amount of LED’s I have, the last sketch I did iterated through the bytes one at a time and wrote them out, is this method quicker?

Memcpy will definitely be faster than you doing it by hand. Some day I will release my DMA accelerated versions for teensy3x and due :slight_smile:

I still want to have a play with a teensy, I’m still using up bits and pieces around the place (and a load of 2812 that a friend got cheap even though I prefer lpd8806), the trouble I seemed to have more was buffer sizes due to the amount of LED’s I’ve been using in my projects, this ones going to be sitting on some 2560’s so should be plenty of space :slight_smile:

Hello

I would also try a protocol TPM2.net but I’ve never worked with him so I want to ask whether this your sketch will work properly and that if it will work with Arduino mega2560 thanks.

http://pastebin.com/LcyVYW8v#