Working with RGB LED matrices requires to install a base driver software. We are using the incredibly versatile rpi-rgb-led-matrix. Here are our development notes on installation.
Installation is perfectly covered on the main page of rpi-rgb-led-matrix. We have distilled our approach below. The guide installs rpi-rgb-led-matrix for use with Python 3 and our library for handling RGB matrices (coming soon)
Installing a new image
It's a good idea to start from a new image, when creating your RGB Panel thing. You can choose any recent distro of Raspbian. We will use Raspbian Lite, but if you wish to develop on your Pi directly, choose a heavier version. Our guide for setting up a headless Raspberry Pi can be a good start.
- install git (required on Raspbian Lite - in other images git is already included)
sudo apt install git
- Update All - see our guide Updating Raspberry Pi to learn more
- [Optional] You can install Samba, if you wish to access your Pi through a Windows network
- [Optional] If you have installed a full version of Raspbian, you might want to install
xrdpfor remote access through RDP to your development environment
- [Optional] Install Mosquitto if you wish to use our libraries for controlling the matrices (don't forget to include the paho Python libraries)
As mentioned, this guide covers a Python 3 installation. For 2.7, go to the original guide - rpi-rgb-led-matrix
# setup pre-requisites for rpi-rgb-led-matrix sudo apt-get update sudo apt install libgraphicsmagick++-dev libwebp-dev sudo apt install libwebp-dev # python2.7-dev required for the make process sudo apt install python2.7-dev -y sudo apt install python3-dev python3-pillow -y # download the project git clone https://github.com/hzeller/rpi-rgb-led-matrix # build the project using the standard hardware profile (change based on your hardware) cd rpi-rgb-led-matrix sudo HARDWARE_DESC=regular make install-python cd utils/ sudo make led-image-viewer cd ../examples-api-use make # compile for Python 3 (https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/bindings/python) cd ../bindings/python/ sudo make build-python PYTHON=$(which python3) sudo make install-python PYTHON=$(which python3)
Don't forget to disable the sound card!
To run the basic demo and test your installation (change the gpio mapping parameter based on your hardware). Please also notice the 'slowdown' parameter: on our Pi with a standard matrix hat, the Pi was too fast :)
cd ~/rpi-rgb-led-matrix/examples-api-use sudo ./demo -D -m 0 --led-no-hardware-pulse --led-gpio-mapping=regular --led-slowdown-gpio=2
Navigate to the project python folder to run Python demos
cd rpi-rgb-led-matrix/bindings/python/samples sudo ./runtext.py # run other demos available in this directory
Here is a bunch of links and descriptions for hardware: matrices and hats
- RGB Matrix RTC Hat - A Raspeberry Pi hat for HUB75 type RGB Matrices. Inclues Real Time Clock
- RGB Matrix Panl Drive for RPI - an improvement on original driver boards for HUB76 type RGB Matrices. Here is the related wiki page
- ACME Hat A3 - Another take on a Raspberry Pi Hat for matrix control
You might need some of the tools below to manage your development
- IrfanView - a lightweight image viewer. In our case, it supports PPM files. Both viewing and saving (save-as)
- Gimp - used to generate PPM files. If you take art creation seriously, this is the tool to use. For simple conversions,
IrfanViewshould be enough
Tools - Animated GIFs
Animated GIF images are a special category for our makerspace. We run those a lot. While it is true that the resolution of smaller RGB Matrices is simply not enough, there is still huge value using them. And with a bit of tweaking, the results are very, very good.
This section lists tools and sites which we use. If anything else, they are great for inspiration.
- ezGIF - a great online tool to edit and manipulate your animated GIFs
- Shadertoy - making GLSL shaders, and a great inspiration gallery
- GeeXLab - another tool to create and render animations. This tool can connect directly to RGB Matrices; see example use here
The library has some traction across the maker-verse. This section describes interesting applications, which expect rpi-rgb-led-matrix to be present as the display part, and which use it to create visual effects.
- Art-Net - Art-Net is the core protocol behind most of the solutions listed here. Not an application per-se, but instead a protocol wrapping rpi-rgb-led-matrix, as a network entry point.
- Jinx! - a free solution, allowing us to control RGB Matrices with this library and Art-Net, across the network. No source code available.
- Glediator - A Java based application, used to control RGB Matrices via Art-Net.
- GeeXLab - yet another great tool for 3D programming, creating demos etc. This one has RGB Matrix support as well
- node-red-contrib-easybotics-led-matrix - Control your matrix via node-red
- Adafruit Matrix Webapp Tutorial - Contains some good notes on rpi-rgb-led-matrix and allows you to interface it via a web server in Java (Payara)
- Hackster Tutorial
- Pixel - A Raspberry Pi Led Matrix / Bluetooth configuration. Check it out due to a big list of resources (images/animations)
- rpi-rgb-led-matrix-animator - A wealth of ideas and Python code to get inspired in your Led Matrix development. Or simply copy and re-use a ton of effects
- Getting Started With RGB Matrix Panel (Hackster) - See how to make an RSS Ticker with your panel(s)
- Guerilla Clock - A bus departure time ticker (Hackaday)
- Starboard Particle Generator (Instructables) - nice starry effect for your panel(s)
- Rendering OpenGL Shaders on a LED Cube - great inspiration for our RGB Panel projects
- Running code from FastLED and others on Raspberry Pi RGB Matrices - If you have arduino code, or animation code written for other libraries, this article to the rescue: you can run the existing code on the rpi-rgb-led-matrix