Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.

64x64 LED Matrix + Bonnet for MQTT Connection
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

64x64 LED Matrix + Bonnet for MQTT Connection

by ss2432 on Wed Jan 27, 2021 1:34 am


I am working on a project to control a led matrix through a Unity mobile application.
I was able to write a C++ program to control the led matrix as I wanted. (Thanks to the Adafruit supports!)

Pretty much all the components I used in this project are from here. (Please see the image attached)

1. Raspberry Pi 4 Model B
2. LED Matrix (64x64 RGB LED Matrix - 2.5mm Pitch)
3. Adafruit RGB Matrix Bonnet for Raspberry Pi
4. hzeller/rpi-rgb-led-matrix library

My goal is to control this matrix with a mobile device anywhere through an MQTT connection.
In terms of a server and clients, I am thinking of making both my led matrix (with RPi+RGBBonnet) and the mobile app as clients that subscribe to an MQTT broker for bi-directional communication. (publishing animation status and users changing the animation properties) Starting with 1 matrix and 1 user, but later, I want to add more led matrixes to the MQTT server.

First of all, I would like to know if I can do this with the Adafruit MQTT broker. (RPi/RGB Bonnet <-> Adafruit MQTT Broker <-> Mobile App)

One difficulty I am having right now is that most of the MQTT tutorials for RPi are with Python. But my program is written in C++.
So I tried to find possible ways to implement this MQTT system with the C++ program in RPi. Here are a few options that I think might work.

1. Adding Paho MQTT C++ Client code to my led control C++
2. IPC between Python (Python for MQTT client) and C++ (Cpp for LED matrix control)
3. Wired-communication (Serial- with Multimasters) between EPS8266 (Python for MQTT Client) and RPi+RGB Bonnet (Cpp for LED matrix control)

I am pretty new to this. So please bear with me if none of the options above makes sense.
If all feasible, 1. and 2. are good because I don't need any additional hardware. But I am worried about getting flickering/noise in my led matrix if the RPi processes something other than the led matrix. 3. could be good because I see a lot of tutorials using EPS8266 with Python for MQTT. I can use the Adafruit ESP8266 MQTT library. Plus, since the MQTT processing is separated from the main RPi (Master), I might not have any performance issues in my led matrix. (I also have two of

I might also try C++ WebSocket communication since I see more threads online regarding this method. But for the expandability and later IoT integration, I want to try MQTT this time if possible.
Please let me know your thought on this and if you have any suggestions or references, I would love to hear from you.
Again, I am not really experienced, so ease of implementation is important, too.

Thanks a lot!
KakaoTalk_20210126_223535176.jpg (120.11 KiB) Viewed 121 times

Posts: 5
Joined: Mon Jul 27, 2020 3:02 pm

Please be positive and constructive with your questions and comments.