LED Panel: Difference between revisions

From The Munich Maker Lab's Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
|name        = LED Panel
|name        = LED Panel
|status      = beta
|status      = beta
|image      =  
|image      = LED Panel2.jpg
|description = Displays a ticker on the LED Panel in the space
|description = Displays a ticker on the LED Panel in the space
|author      = [[User:siedi|Matthias]]
|author      = [[User:siedi|Matthias]]
|username    =  
|username    =  
|version    =  
|version    =  
|update      =  
|update      = [[User:Meier|Meier]] 28.04.2021
|platform    =  
|platform    =  
|license    =  
|license    =  
Line 13: Line 13:
}}
}}
The LED Panel actually consists 2 32x128 LED matrixes with a HUB75 connected to a Raspberry Pi 1. The panels are provided by [[User:jorgen|Jorgen]], the pi by [[User:siedi|Matthias]] The custom software can retrieve messages via MQTT (what else) and display them in two rows. The first row is the "larger" one, the second row the smaller one. The content and format of the text can be heavily customized via MQTT (see below).
The LED Panel actually consists 2 32x128 LED matrixes with a HUB75 connected to a Raspberry Pi 1. The panels are provided by [[User:jorgen|Jorgen]], the pi by [[User:siedi|Matthias]] The custom software can retrieve messages via MQTT (what else) and display them in two rows. The first row is the "larger" one, the second row the smaller one. The content and format of the text can be heavily customized via MQTT (see below).
== Update ==
The sign is now running the software version from https://github.com/TheMeier/rpi-led-mqtt/. The daemon is started via systemd and installed in /usr/local/bin. The source is checked out at /home/pi/TheMeirr/rpi-led-mqtt on the embedded rasberrypi.


== Software ==
== Software ==
Line 24: Line 27:


The program needs to run as root to access the gpios. Without any parameters, it will start with the defaults configured in the source code.
The program needs to run as root to access the gpios. Without any parameters, it will start with the defaults configured in the source code.
The working directory must contain the fonts folder.
<code>
sudo systemctl start led-mqtt
</code>


  sudo ./led-mqtt
For parameters see <code>led-mqtt --help</code>
 
The following command line parameters are available:
 
{| class="wikitable"
! parameter
! description
|-
| -S <xxx>
| Set MQTT server
|}
 


== MQTT topics & commands ==
== MQTT topics & commands ==
Line 86: Line 82:


== Software Compilation ==
== Software Compilation ==
See https://github.com/TheMeier/rpi-led-mqtt/blob/master/README.md


In case you need to setup a new system and compile the software again, here are some hints.
In case you need to setup a new system and compile the software again, here are some hints.
Line 96: Line 94:
   git https://github.com/eclipse/paho.mqtt.c
   git https://github.com/eclipse/paho.mqtt.c
   cd paho.mqtt.c
   cd paho.mqtt.c
  cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SAMPLES=TRUE ${CROSS_COMPILE_ARG}
   make
   make
   sudo make install
   sudo make install
Line 101: Line 100:
   git clone https://github.com/eclipse/paho.mqtt.cpp
   git clone https://github.com/eclipse/paho.mqtt.cpp
   cd paho.mqtt.cpp
   cd paho.mqtt.cpp
  cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE \
        -DPAHO_MQTT_C_PATH=../paho.mqtt.c/ -DPAHO_MQTT_C_LIB=../paho.mqtt.c/src/libpaho.mqtt3as-static.a ${CROSS_COMPILE_ARG}
   make
   make
   sudo make install
   sudo make install
  sudo ldconfig




Line 110: Line 112:
   cd rpi-led-mqtt
   cd rpi-led-mqtt
   make
   make


[[Category: Project]]
[[Category: Project]]

Latest revision as of 10:38, 30 April 2021

   
LED Panel

Release status: beta [box doku]

LED Panel2.jpg
Description Displays a ticker on the LED Panel in the space
Author(s)  Matthias

The LED Panel actually consists 2 32x128 LED matrixes with a HUB75 connected to a Raspberry Pi 1. The panels are provided by Jorgen, the pi by Matthias The custom software can retrieve messages via MQTT (what else) and display them in two rows. The first row is the "larger" one, the second row the smaller one. The content and format of the text can be heavily customized via MQTT (see below).

Update

The sign is now running the software version from https://github.com/TheMeier/rpi-led-mqtt/. The daemon is started via systemd and installed in /usr/local/bin. The source is checked out at /home/pi/TheMeirr/rpi-led-mqtt on the embedded rasberrypi.

Software

  • Based on the RPI-RGB-LED-Matrix project from hzeller [1].
  • Uses the C++ MQTT Paho library (needs to be compiled and installed to /usr/local/lib & /usr/local/include accordingly)
  • The Code is located here https://github.com/siedi/rpi-led-mqtt
  • The LED software is automatically launched on startup via the crontab of the pi user and running in the background.

Run it

The program needs to run as root to access the gpios. Without any parameters, it will start with the defaults configured in the source code. The working directory must contain the fonts folder. sudo systemctl start led-mqtt

For parameters see led-mqtt --help

MQTT topics & commands

The topic structure is <prefix>/<command>/<parameter>, e.g. mumalab/room/ledpanel/set/once1

  • prefix: as give by the command line
  • command: "set" to set a value. There are currently no other commands implemented (like get)
  • parameter: see table below
  • payload: the value to set
topic parameter description value example
text1 Sets the text of the ticker in the first, upper line. Welcome to the MuMaLab!
text2 Sets the text of the ticker in the second, lower line. We love LEDs!
once1 Interrupts the current ticker in the first line and displays this ticker once. Afterward displays the old text1 ticker. ALARM!!!
once2 Interrupts the current ticker in the second line and displays this ticker once. Afterward displays the old text2 ticker. Let's go!
color1 The RGB value of the first line, as a string, comma separated. 255,0,128
color2 The RGB value of the second line, as a string, comma separated. 255,0,128
font1 Name of the font file as on the server for the first text line. 9x18.bdf
font2 Name of the font file as on the server for the second text line. 5x8.bdf

Software Compilation

See https://github.com/TheMeier/rpi-led-mqtt/blob/master/README.md

In case you need to setup a new system and compile the software again, here are some hints.

You might need to install the one or the other Debian package (e.g. build-essential libssl-dev libjsoncpp-dev). You will find out when the compilation fails :-).

  • Install the PAHO MQTT libraries:
 # Install the c client first
 git https://github.com/eclipse/paho.mqtt.c
 cd paho.mqtt.c
 cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SAMPLES=TRUE ${CROSS_COMPILE_ARG}
 make
 sudo make install
 cd ..
 git clone https://github.com/eclipse/paho.mqtt.cpp
 cd paho.mqtt.cpp
 cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE \
       -DPAHO_MQTT_C_PATH=../paho.mqtt.c/ -DPAHO_MQTT_C_LIB=../paho.mqtt.c/src/libpaho.mqtt3as-static.a ${CROSS_COMPILE_ARG}
 make
 sudo make install
 sudo ldconfig


  • Install led-mqtt:
 git clone -recursive https://github.com/siedi/rpi-led-mqtt.git
 cd rpi-led-mqtt
 make