Userspace WS281x Control on the Raspberry Pi 5 Inches Closer with New Python Library Release

Beta release of both the driver and its Python bindings now available, for testers and early adopters.

Embedded software developer Philip Howard has announced a beta release of a Python library for handling WS281x "NeoPixel" addressable RGB LEDs on a Raspberry Pi — delivering support for the Raspberry Pi 5 and its newly-driven general-purpose input/output (GPIO) pins.

"Another new test release of the rpi_ws281x Python bindings for Raspberry Pi 5," Howard writes on Mastodon of the new beta software. "Thanks to a herculean effort by Jeremy [Garff], and with a bit of kernel module/dtoverlay fiddling, you can now drive WS281x "NeoPixels" on the [Raspberry] Pi 5."

If you've got a Raspberry Pi 5 and a need to control WS281x-family RGB LEDs, the software for it is right around the corner. (📷: Gareth Halfacree)

"Due to significant changes in the Raspberry Pi hardware, namely the RP1 chipset, a kernel module is now required," Garff explains of the complexities in getting the software running properly on a Raspberry Pi 5. "There has been significant demand for this feature. I wanted to get something out as soon as I could, so not all features (all channels, inverted signal, etc.) are working yet."

The rpi_ws281x driver allows Raspberry Pi single-board computers to drive WS281x-family addressable RGB LEDs from their GPIO pins — but the release of the Raspberry Pi 5 brought a complication in the form of the RP1, an in-house "southbridge" chip that takes over responsibility for the GPIO pins from the system-on-chip. It's an approach with benefits, but one which means projects interacting with the GPIO pins at a low level — like rpi_ws281x — need updating accordingly.

Garff has been working on getting rpi_ws281x itself up and running with the Raspberry Pi 5, releasing an initial test version last week; Howard's work brings that new library to Python. The new build is now available in the rpi-ws281x-python GitHub repository, alongside the source code under the permissive BSD two-clause license; the upstream library is available in a separate repository.

Main article image courtesy of Adafruit.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles