jgarff / rpi_ws281x

Userspace Raspberry Pi PWM library for WS281X LEDs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compute Module 4 latest version not supported

gecastan opened this issue · comments

Starting a basic test using rpi_ws281x lib raising ws2811_init failed with code -3 (Hardware revision is not supported) error :

python built-in-rgb-led-simple.py
This examples needs to be run as root (sudo)
Traceback (most recent call last):
  File "/home/pi/piunora-blinka-examples/built-in-rgb-led-simple.py", line 22, in <module>
    strip.begin()
  File "/home/pi/.local/lib/python3.9/site-packages/rpi_ws281x/rpi_ws281x.py", line 131, in begin
    raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp))
RuntimeError: ws2811_init failed with code -3 (Hardware revision is not supported)

Here is my brand new compute module 4 received this week :

cat /proc/cpuinfo
Hardware        : BCM2711
Revision        : b03141
Serial          :  XXXX
Model           : Raspberry Pi Compute Module 4 Rev 1.1

Quickly browsed the repository and found out that the hardware check is done here : rpi_ws281x and couldn't find a reference to the b03141 revision.

I m unfamiliar with this kind of stuff so I ll play around and test a bit to test it locally before submiting a MR.

I had the same error. I use the 'C' version and just had to add this to "rpihw.c", and now everything seems to be working.
//
// Compute Module 4
//
{ /// gerrie added this
.hwver = 0xb03141,
.type = RPI_HWVER_TYPE_PI4,
.periph_base = PERIPH_BASE_RPI4,
.videocore_base = VIDEOCORE_BASE_RPI2,
.desc = "Compute Module 4 v1.? eMMC Gerrie"
},

Merged a bumper PR of compute modules that should sort these out.