I'm spec'ing out a project to use a grid of addressable LED strips to build a pixel fireplace installation, and I'm working on how best to drive the fire graphics. I see there are python libraries for driving individual LEDs, so option 1 is simply writing some python to generate the graphics in a matrix of RGB values, and drive the LEDs.

However, there's already a really nice looking pixel fireplace simulator done here. https://hammertail.itch.io/pixel-fireplace. Is there a library that would let me map a grid of LEDs as a second display. Then I could tell the RPi to run the Pixel Fireplace program and output to display 2 that just happens to be 40x40 pixels?

I've seen packages that allow the mapping to play a given video file, but I haven't been able to find anything yet that maps as a live display.

2 Answers 2


Option 2 is to write a framebuffer kernel driver which sends the memory content to the LED matrix instead of HDMI / LCD. Python would be out of the question as you need to produce a .ko file which will be loaded into the Linux kernel. A prominent example of this approach is vesafb module in mainline Linux. Applications can use the framebuffer device directly, but often do so either via a library (e.g. SDL) or via the X window system.

Option 3 is to write an Xorg DRM library. This avoids dealing with the kernel, but still requires building a .so library file (AFAIK you could use Python code with C bindings, but writing it in C/C++ would be easier). You'll have to run the actual application via X windows system. An example of such library is xf86-video-fbturbo, which happens to use an existing kernel framebuffer device (and is often confusingly referred to as an Xorg framebuffer driver, while it is technically a library), but nothing prevents you from implementing Xorg graphics with a LED driver backend instead of a framebuffer.

If you're only proficient with Python, I'd stick to option 1: implement everything in Python as a userspace script which talks to the LED strip directly. With a resolution of 40x40 pixels you're unlikely to run into performance issues.


Assuming this isn't for a commercial solution, you might appreciate the flexibility of using something like xLights and Falcon Pi Player. You will get a fire display out of the box but you will also get a lot more should you want it. I use this approach to drive a 48x30 matrix that I can also reconfigure into 3 30x16 or a single 16x90. You may also want to consider one of the pixel driver hats (which typically give you a mosfet, fuse, and RTC).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.