UDPSender

class ledwall.components.UDPSender(server='localhost', port=3548)

An UDPSender instance sends the frame data via UDP (surprise, surprise). UDP is a connectionless communication model. It is not guaranteed that the client will receive the packages in the correct order.

The UDPSender needs a server address (name or ip) and a port to send the data to. The port defaults to 3548.

In theory the maximum length of a UPD package is 65,535 bytes, because of the 16bit length field. In the real world there will be additional limitations. For a LED Panel with 2048 LEDs (which is not the smallest panel) we need 3*2,048 bytes plus 4 command bytes. So size shouldn’t be a limitation.

The good thing about UDP is, that it is a connectionless communication. So if the server, which is the panel, is temporarily not available, nothing will happen. As soon as the server is available again, it will continue to do display the frames.

Because the packages are send through the network, you will not have a stable or guaranteed transmission speed. So there may be a noticable delay between sending and receiving.

Parameters:
  • server (str) – Name or IP of the server to send the framedata to.
  • port (int) – Portnumber to send the data to. Defaults to 3548
init(panel)

Sets the associated display. This method will be called by the display, so don’t call this method directly. When update() is called, the implementation can access the display via the property ‘panel’. (I know, it’s confusing and will be changed in the future).

update()

This method will be called every time, the sender should update the physical led display and should be implemented in every derived class.