jgarff / rpi_ws281x

Userspace Raspberry Pi PWM library for WS281X LEDs
BSD 2-Clause "Simplified" License
1.78k stars 622 forks source link

Raspi 4b 2GB rev 1.4 support #420

Closed Josh-Tucker closed 3 years ago

Josh-Tucker commented 3 years ago

Hi,

I have been having some issues with a unicornhat on a raspberry Pi 4b 1.4 2GB and believe I have tracked this down to the new revision not being present in the rpihw.c file https://github.com/jgarff/rpi_ws281x/blob/master/rpihw.c

Currently these run up to Pi 4 Model B - 8GB v1.2 while the cpuinfo for my model shows the below:

Hardware : BCM2711 Revision : b03114 Serial : 10000000d223f467 Model : Raspberry Pi 4 Model B Rev 1.4

I would create a pull request but am not confident if any other details also need to be changed, as far as I can tell adding the below to the rpihw file should add the support.

{ .hwver = 0xb03114, .type = RPI_HWVER_TYPE_PI4, .periph_base = PERIPH_BASE_RPI4, .videocore_base = VIDEOCORE_BASE_RPI2, .desc = "Pi 4 Model B - 2GB v1.4" },

Thanks in advanced for your assistance, love these peripherals and really appreciate the support! JT

Error Message:

sudo python detect.py Traceback (most recent call last): File "detect.py", line 3, in <module> import unicornhat as unicorn File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 35, in <module> ws2812.begin() File "/usr/local/lib/python2.7/dist-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) Segmentation fault

Gadgetoid commented 3 years ago

This is odd! I didn't know rev 1.3 boards existed, much less 1.4- looks like we might have be missing the 4GB and 8GB versions of this revision if it's across the whole range.