Overview

This guide shows how to install and use a Raspberry Pi RGB LED matrix Web application. The application is a Web interface to the excellent rpi-rgb-led-matrix library from hzeller on Github.

The Adafruit RGB Matrix HAT + RTC for Raspberry Pi - Mini Kit is used to interface with the LED panel.

Required Parts

The following hardware is used in this project.

You can also get just about eveything you need in our Time Square Pi Pack!

Pi Powered Times Square Traveler Pack

PRODUCT ID: 3273
Some people might want to make the trek to NYC. But for those who want to skip out on the crowds and the cold, why not bring a little bit of the Big Apple into your home with this...
$89.95
OUT OF STOCK

Assemble the Pi HAT

Follow the Adafruit assembly guide for the RGB LED matrix Pi HAT, then come back here once all the pieces are soldered up

Software Prerequisites

rpi-rgb-led-matrix

This project uses a fork of the hzeller project on Github.  The fork only has changes to specify the scrolling text as a command line argument.  The main branch can be used once this pull request is accepted.

Use these commands to download the code to the Raspberry Pi and build the Web application's dependencies.

Download: file
// install dependencies for the scrolling text
sudo apt-get update

sudo aptitude install libgraphicsmagick++-dev libwebp-dev

sudo apt-get install libgraphicsmagick++-dev libwebp-dev -y

sudo apt-get install libwebp-dev

sudo apt-get install python2.7-dev python-pillow -y

// download the C++ project that drives the GPIO
git clone https://github.com/onebeartoe/rpi-rgb-led-matrix.git

// build the project, specifing the Adafruit HAT as the hardware profile
cd rpi-rgb-led-matrix
sudo HARDWARE_DESC=adafruit-hat make install-python

cd utils/
sudo make led-image-viewer

cd ../examples-api-use
make

Before continuing, be sure the following demo programs built into the rpi-rgb-led-matrix library run without errors and you see the LED panel lighting up.  

The first demo is the spinning square.

Download: file
$ cd rpi-rgb-led-matrix/examples-api-use 

$ sudo ./demo -D -m 0 --led-no-hardware-pulse --led-gpio-mapping=adafruit-hat

The second demo is scrolling test.

Download: file
cd python/samples/
sudo ./runtext.py

Payara (runs WAR files)

The Web application for this project uses JEE and is packaged as a WAR file.  Payara Server 4.1.x is used to run the Web app.

I tried Payara MicroProfile 164 from the main downlaods page, but it has issues running the WAR.  The prerelease seems stable while running this project.  See the following link and download JAR named "Payara-Micro (Web Profile Implementation)":

http://www.payara.fish/upstream_builds
             
Copy the JAR to the Raspberry Pi.  It is used later in the project.

Here is a local copy of the Payara JAR, in case the specific version used in this project is not available for some reason.

The following command can be used to download the local copy of JAR file.

Download: file
$ wget https://cdn-learn.adafruit.com/assets/assets/000/037/927/original/payara-micro-prerelease-2016-11-24.jar

Software

This application is packaged as a JEE WAR file.

The Payara JAR downloaded in the previous section is used to run the appication WAR.

Download/copy the WAR to the Raspberry Pi.

Download: file
$ wget https://cdn-learn.adafruit.com/assets/assets/000/040/940/original/rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT.war

Running the Application

Change directory (cd) into the directory where the Payara JAR and WAR file were downloaded.

To run the Raspberry Pi RGB LED matrix Web application, issue this command:

Download: file
$ java -jar payara-micro-prerelease-2016-11-24.jar --deploy rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT.war

A bunch of expected log messages are printed to the console as the Web server for the applcation starts.  You may even see a Java VM error about "UseCompressedOops" that is safely ignored.

After about 3-4 minutes (once the server initializes), the application is available at the following URL:

Download: file
http://raspberry-pi:8080/rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT/

Here is a screen shot of the Web application page for animations, after a few animations have been added:

Initially there are no available animations :(

But the good news is that Webapp allows the user to upload their own animations!

Just use the file selector and upload button.  The animation uploads are saved to the Raspberry Pi SD card.

The same applies for the Still Images page!

The Scrolling Text page has an input component to specify the text to scroll on the RGB LED panel.

 If you prefer to customize the installation, then see the Settings page.

Sample Images and Animations

Another RGB LED matrix project I love working on is PIXEL, from Al Linke.

That project has tons and tons of sample still images and animation art.

And he gave permission to use that art with this project!

Sample Art:

Resources

 

Going Further

The software for this project is open source.  Try adding a  feature. Possible features that come to mind are:

  • change scrolling text properties; color, speed, font

  • analog clock

  • current time as scrolling text
This guide was first published on Jan 02, 2017. It was last updated on Jan 02, 2017.