TPM2.net Raspberry Pi

  • Hat jemand zufällig schon eine Anleitung wie ich TPM2.net mit des Raspberry empfangen kann?

    Mein Plan ist es dann mit dem Raspberry WS2812B LED´s zu steuern. Dies funktoniert auch Perfekt.

    Der Raspberry soll die Daten dann über Jinx von einen Seperaten Rechner über TPM2.net emfpangen.

    Ich bin für jeden Tipp Dankbar :)

  • Hallo Thismalor,


    ich hatte ebenfalls diese Idee und wollte mich nach dem aktuellen erkundigen.

    Hast Du in der Zwischenzeit Fortschritte erzielt?

    Ich selbst bin noch am Zusammentragen von Informationen.


    Grüße, rinsin

  • Hat jemand zufällig schon eine Anleitung wie ich TPM2.net mit des Raspberry empfangen kann?

    Mein Plan ist es dann mit dem Raspberry WS2812B LED´s zu steuern. Dies funktoniert auch Perfekt.

    Der Raspberry soll die Daten dann über Jinx von einen Seperaten Rechner über TPM2.net emfpangen.

    Ich bin für jeden Tipp Dankbar :)

    Hi Thismalor,

    have you found any solution?

    I am also very interested in this.

    I suppose you have a decently large LED-matrix, so you have to transfer the huge data with TPM2.net. Mine is 64x32 and I am thinking of doing bigger (the effects are greater with big matrixes, but the number of LEDs grows even faster)


    What I do so far:

    My idea is, that the CPU-workload for big matrixes makes it impractical or even impossible to use Python. Therefor I use C in Raspberry. Since I have very good experience with Glediator protocol (it is even faster, than TPM2, because it uses 1000000 BAUD), I have written a serial Glediator protocoll receiver in C for Raspberry.


    I found a sketch for ESP8266 that receives TPM2.net from Jinx! on Windows PC over Wifi and controls LED-strip directly. I rewrote this, so that it converts TPM2.net to Glediator protocol. Actually the ESP8266 was too busy to make it, so I adapted the sketch for ESP32 and use both CPU-cores in parallel (one for receiving from Wifi and the other for sending the serial data). ESP32 is known for unexplained issues of interrrupt problems, which makes it less suitable for the time critical control of LED-stripes. So one has to accept a few glitches in the movie. But since the glitches come in the Glediator protocoll, you are not jeopardizing the LEDs!

    The difference to do it this way instead of letting Jinx! output the Glediator protocol directly is, that Glediator protocol (and probably any other serial protocol over 1 line) slows Jinx! down to lower framerate.


    In this temporary solution I wish to replace the ESP32 with a C routine in Raspberry, that would receive the TPM2.net directly over LAN instead of Wifi. I have a program example (see here) how to comunicate from a LAN-client with Raspberry as LAN-server, but I am not capable enough to adapt it for receiving TPM2.net protocoll. It's not the TPM2.net protocoll itself (which is quite simple) but it is the one way LAN communication, that I am not successful with. I can see the LAN packets comming to Raspberry at the flashing connection lamp, but I don't know, how to read the packets. May be, someone here could help(?)

  • it is even faster, than TPM2, because it uses 1000000 BAUD“ - the protocol has nothing to do with the baud rate. You can send both tpm2 and glediator-protocol with various baudrates. I use tpm2 with 1,25 Mbit/s


    But, simple calculation, for a matrix with 64x32 with 25 fps, even this is not enough, as you would need about 1,55 Mbit/s


    So the solution is, to not use seriell interface, but LAN. Means, tpm2.net or Artnet. I myself can not write programs for Pi (except Python), so i didn‘t implement tpm2.net on any device.


    Even though i‘m the creator of tpm2, i would suggest Artnet here. Just because you get more resources for it. tpm2 is in good use, but nearly noone uses tpm2.net...

    It's only light - but we like it!


    Da es sich in letzter Zeit häuft: Ich beantworte keine PNs mit Fragen, die sich auch im Forum beantworten lassen!
    Insbesondere solche von Mitgliedern mit 0 Beiträgen, die dann meist auch noch Sachen fragen, die bereits im entsprechenden Thread beantwortet wurden.
    Ich bin keine private Bastler-Hotline, technische Tipps etc. sollen möglichst vielen Lesern im Forum helfen!

  • Hi Pesi,

    finaly it seems - which is very nice and welcome - that someone with genuine technical knowledge (and not only trivial questions) participates...

    Creator of tpm2 - Germany must be mother of LED-science. Maybe you know your colleges - creators of Glediator or Jinx! and wake them from the dead :-) Sorry if it happens to be you. Being foreigner, I do not know the historical background so well :-) It is hapening me all the time. I was having a great discussion with a guy about problems with FastLED library, suggesting other libraries, untill I after many contributions found, that he was the creator of FastLED...


    You are right about the speed of serial link - my mistake. When you come to 25frames/s, the serial is out for big matrixes. And you still do not include the time for displaying the received matrix before next frame arrives unless you can use DMA technique. But this is the world of a desperat user, when he is not capable to use the wired LAN.


    Lately I have been able to write a program to receive TPM2.net over LAN on Raspberry, beautifully smootly displaying 64x32 effects which is a great anouncement, because it was really hard for a person not familiar with sockets programming etc. I also stumbled over the peculiarity (excuse me) having two different START bytes (C9 for TPM2 as opposed to 9C for TPM2.net) which almost made me to give up, when I (by obvious mistake) could not recognize the packets.

    Well, my solution now works with Windows Jinx! directly LAN-onnected to Raspberry and I am working on getting it to receive TPM2.net from Glediator (the patching there is a terrible experience). I will also investigate it's limits when it comes to even bigger matrixes.


    Thank you for discurraging me from using TPM2.net - It is obviously too late now :-) I have chosen it, because of lost packets when trying to use Artnet over Wifi. The Artnet packets are short (max 512) so that you have to send many, which increases the chance for loosing one. For a couple of decades it might work well, but in today's city apartment with so many Wifi networks arround, there is terrible queue in the air for each packet. It is interesting how old predictions of eathernets insufficience for realtime control came true even in home-environment. I still do not understand, why and how Jinx! splits the packets into shorter (1410 long) frames (universes) and why it doesn't use the capability of much larger packets in TPM2.net. But development of Jinx! is obviously dead, which is a great shame.

  • Has anyone happened to have instructions on how to receive TPM2.net with the Raspberry?

    My plan is to control it with the Raspberry WS2812B LED. This also works perfectly.

    The Raspberry should then receive the data via Jinx from a separate computer via TPM2.net.

    I am grateful for every tip :)

    Hi again Thismalor,

    have a look at https://www.sfml-dev.org/tutorials/2.5/network-socket.php

    It is what you are looking for.

  • Thanks! 😊 tpm2 is not rocket science, it‘s just a simple protocol for controlling LEDs and other stuff.


    I „invented“ it because of the Limitations of other protocols, which were always based on fixed frames like 512 (DMX, Artnet, etc.), so i could control larger matrices with only one Frame. Over serial connection, this was enough for me. I asked the creators of Jinx! etc. to implemet it in there SW, and they did, about which i‘m thankful 😊


    Then they would like to have it over ethernet, so we made tpm2.net - here the Start Byte is 9C, to seperate it from tpm2, because the header is different...


    Fun fact: i chose C9 as start byte for tpm2, because it‘s binary 11001001, which is the title of a star trek episode (i‘m a fan) 😅


    Regarding: „I still do not understand, why and how Jinx! splits the packets into shorter (1410 long) frames (universes) and why it doesn't use the capability of much larger packets in TPM2.net“ - that‘s because limitations of ethernet, you can have only frames with 1410 Bytes payload - unless you use „jumbo frames“, but not every HW can handle this.


    So, in bigger installations, you always have to segment the Data, and if you have to do this, you can also use Artnet 😉


    tpm2 only has advantages, if you use serial connection, because there you can use frames of any size, in opposite to DMX, miniDMX or other protocols...


    P.S.: unfortunately, i didn‘t hear anything from seddie etc. For a long time... seems, they‘re not here anymore. In former times, this was a forum for „Bastler“, but the last years it‘s mostly „how can i get my stripes working“, „which power supply do i need“ etc.

    It's only light - but we like it!


    Da es sich in letzter Zeit häuft: Ich beantworte keine PNs mit Fragen, die sich auch im Forum beantworten lassen!
    Insbesondere solche von Mitgliedern mit 0 Beiträgen, die dann meist auch noch Sachen fragen, die bereits im entsprechenden Thread beantwortet wurden.
    Ich bin keine private Bastler-Hotline, technische Tipps etc. sollen möglichst vielen Lesern im Forum helfen!

    Einmal editiert, zuletzt von Pesi ()