Skip to content

SPI Setup Running without root

cp2004 edited this page Jul 13, 2020 · 9 revisions

The initial setup wizard will do this all for you, but if you want to do it yourself or know what is going on, read this

  1. Add the Pi user to the gpio group. This means you can access the GPIO pins on the Raspberry Pi

    Run sudo adduser pi gpio to do so, or groups pi to check if Pi is already there

  2. Enable SPI, which is how the plugin will drive the LEDs.

    Can be done through raspi-config or by adding dtparam=spi=on to /boot/config.txt (Easier!)

  3. Increase the SPI Buffer size, so we can output more data. Needed to drive more than a handful of LEDs

    Add spidev.bufsiz=32768 to /boot/cmdline.txt.

  4. Set the correct clock frequency. Needed to get the correct signal frequency. On a Raspberry Pi 3, this should be 250, Pi 4 should be 500

    Add core_freq=250 or core_freq_min=500 to /boot/config.txt.

  5. Set a minimum clock frequency. Starting with the Raspberry Pi 4, the SPI frequency can change if the Pi is idling vs. 'working', which can cause the LEDs to misbehave and flicker, or change colour. Not required on earlier models.

    Set core_freq_min=500 in /boot/config.txt.

These options come from the rpi_ws281x library the plugin depends on, see more here

Heads up! This documentation has migrated to Gitbook! Find it here: https://cp2004.gitbook.io/ws281x-led-status/

Clone this wiki locally