rpi_ws281x: Solution for RuntimeError: "ws2811_init failed with code -3 (Hardware revision is not supported)" | For Raspberry Pi 4 Model B Rev 1.5 and later
Hello,
if u try to run a Script from the Repo and you get the RuntimeError: “ws2811_init failed with code -3 (Hardware revision is not supported)” I found a solution for u =D
First open your shell, type in: cat /proc/cpuinfo or go to the Explorer, into “home/proc/cpuinfo” and open the File. At the Bottom will be a Part which looks like:
Hardware : BCM2711
Revision : b03115
Serial : 100000000ed9a28c
Model : Raspberry Pi 4 Model B Rev 1.5
Now open the shell, type in nano (or vim) rpi-ws281x/library/lib/rpihw.c and search for your Model.
If you cant find it, we will follow this Guide: https://github.com/rpi-ws281x/rpi-ws281x-python/issues/56#issuecomment-753320723
Open the shell,
first you uninstall the repo with sudo pip3 uninstall rpi_ws281x,
next you clone the git with git clone --recurse-submodules https://github.com/rpi-ws281x/rpi-ws281x-python,
after that you run nano (or vim) rpi-ws281x-python/library/lib/rpihw.c,
then you add:
{
.hwver = 0xb03115, (Based on the Revision found in cpuinfo)
.type = RPI_HWVER_TYPE_PI4,
.periph_base = PERIPH_BASE_RPI4,
.videocore_base = VIDEOCORE_BASE_RPI2,
.desc = "Pi 4 Model B - 2GB v1.5" (Based on the Model in cpuinfo)
},
after you made the changes, you change the Directory with cd rpi-ws281x-python/library/,
the last Command will be: sudo python3 setup.py install
I hope that helped, have a nice Day or Night =D
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 4
- Comments: 21 (3 by maintainers)
If you find a new, unsupported revision you should also raise a PR to support it 😄
Thank you! This worked like a charm.
One modification - since Easy Install is deprecated, running
sudo python3 setup.py installdidn’t work correctly for me.Instead, I needed to run
sudo pip3 install /path/to/home/rpi-ws281x-python/library