A general repository to collect, store and distribute all code used in the proot project
Find a file
2023-07-01 22:19:30 +02:00
ESP/mqtt_test changed pin number to index instead of esp specific number 2023-05-31 18:50:35 +02:00
faces Added two more graphics 2023-06-09 11:14:34 +02:00
rpi change mqqt broker to localhost 2023-07-01 22:19:30 +02:00
faceTest.py initial dump of all files already worked on 2023-05-18 09:51:21 +02:00
imageFader.py comming for merge 2023-05-21 23:28:03 +02:00
minDistance.py Moved ProotState to own file. 2023-05-29 20:09:29 +02:00
point_array_cache.json uploading pre parsed images 2023-05-29 20:19:14 +01:00
README.md Update 'README.md' 2023-06-08 10:32:16 +02:00
testImg1.png added new render mode test, and added code for the esp to handle multiple pin shorts 2023-05-22 21:41:27 +02:00
testImg2.png added new render mode test, and added code for the esp to handle multiple pin shorts 2023-05-22 21:41:27 +02:00
visual.py initial dump of all files already worked on 2023-05-18 09:51:21 +02:00

test message

For using the: RGB-Matrix-P3-64x32 by Wavshare with driver chips: FM6047 In order to set up the pi in such a way that the RGB LED matrixes can operate at their rated brightness a init script from the screen manuafacturer needs to be ran. A guide on how to is on the following webpage: https://www.waveshare.com/wiki/RGB--Matrix-P3-64x32-Reginit

RGB Matrix Display with MQTT Control (roy-test.py)

This script uses the RGBMatrix library to control an RGB matrix display. It also connects to an MQTT broker to receive messages and toggle the display color. Requirements

Python 3.x
rgbmatrix library
paho.mqtt.client library
PIL library

Installation

Clone or download the script.
Install the required libraries by running the following command:

pip install rgbmatrix paho-mqtt Pillow

Usage

Connect your RGB matrix display to your device.
Update the configuration options in the script to match your display specifications (rows, columns, chain length, etc.).
Modify the MQTT broker address in the client.connect line to match your MQTT broker's address.
Run the script using the following command:

python rgb_matrix_mqtt.py

Description

This script sets up an RGB matrix display using the RGBMatrix library. It also creates an offscreen canvas that can be written to and then displayed on the matrix asynchronously.

The script connects to an MQTT broker using the paho.mqtt.client library. It subscribes to the "test" topic and listens for incoming messages. When a message is received, it toggles the display color between white, red, and an image loaded from a file.

The image is loaded using the PIL library and resized to fit the matrix display. The pure_pil_alpha_to_color_v2 function converts an RGBA image to RGB format by applying an alpha composite with a specified color.

To use this script, you need to provide the appropriate configuration for your RGB matrix display, including the number of rows, columns, chain length, and hardware mapping. You also need to specify the MQTT broker's address to connect to. License

python numpy and scipy can directly be install on an rpi zero (without increasing swap memory or building) by getting the packages using apt-get:

sudo apt-get install python3-matplotlib python3-numpy python3-scipy python3-opencv python3-pandas python3-dev