How to use NeoPixels with Rock Pi S?

Hello,

I’m trying to get a NeoPixels ring to work with a Rock Pi S, but no success so far.

When using the default Adafruit CircuitPython NeoPixel library I get a NotImplementedError: Board not supported error message and when trying to use the rpi_ws281x library (https://github.com/rpi-ws281x/rpi-ws281x-python) I get RuntimeError: ws2811_init failed with code -3 (Hardware revision is not supported).

What is the best way to get NeoPixels to work with a Rock Pi S?

Thanks in advance for any hint on this
Andreas

OK, after some more investigation I did actually get it to work now using SPI!

In case someone else needs this, in the following what you need to do.

First you need to enable SPI by modifying the /boot/uEnv.txt file like this:

verbosity=7
overlay_prefix=rockchip
rootfstype=ext4
fdtfile=rockchip/rk3308-rock-pi-s.dtb
overlays=rk3308-console-on-uart0 rk3308-spi-spidev
param_spidev_spi_bus=2
rootuuid=37055840-4ec4-444f-979b-9e47ee4bd848
initrdsize=0x64d1d4
kernelversion=4.4.143-47-rockchip-g495ff574976c
initrdimg=initrd.img-4.4.143-47-rockchip-g495ff574976c
kernelimg=vmlinuz-4.4.143-47-rockchip-g495ff574976c

Just add rk3308-spi-spidev and a new line param_spidev_spi_bus=2 thereafter.

Then you connect the NeoPixels 5V and ground accordingly as well as the data in pin to the Rock Pi S pin no. 19 (which supports SPI2_MOSI):
https://wiki.radxa.com/RockpiS/hardware/gpio#26-pin_Header_1_4

That’s it and running the neopixel_spi_simpletest.py should confirm everything is working fine. :slightly_smiling_face:

Hope this helps someone!

Best regards
Andreas

1 Like