-
-
Notifications
You must be signed in to change notification settings - Fork 26
SPI Setup
The plugin utilises the Raspberry Pi's SPI interface to push data to the LEDs, so that we don't have to run OctoPrint as root. There are a couple of things that need to be taken care of for using the plugin, so helpfully I have created a setup wizard that will do all the heavy lifting for you. All you need is the password for your Raspberry Pi (if you haven't changed this, it is the default raspberry
- though you really should do for security!).
If you want to find out more about the actions it performs, or troubleshoot them then they are listed below.
Here's the wizard in action:
Please note that you may have to reload the web interface after a restart of OctoPrint, to get the wizard to show up. It won't show up if all of the settings are already correct, but you should see a lightbulb in the navbar if the plugin is working as expected.
Add the pi
user to the gpio
group. This means you can access the GPIO pins on the Raspberry Pi. Already configured on many newer OctoPi images.
Run sudo adduser pi gpio
to do so, or groups pi
to check if Pi is already there.
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!). Requires root access.
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 the end of /boot/cmdline.txt. Requires root access.
Raspberry Pi 3 or earlier only. Should be removed for Pi 4.
Set the correct clock frequency. Needed to get the correct signal frequency. On a Raspberry Pi 3, this should be 250. This step is not required on a Pi4, it should be removed from the config
Add core_freq=250
to /boot/config.txt
. Requires root access.
Raspberry Pi 4 only. Should be removed for all others.
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. Requires root access.
These settings are suggested by the rpi_ws281x
library that the plugin depends on, you can see more here about running the library on the various Pi models.
If you have any questions, please don't hesitate to get in touch! You can:
- Open an issue with the question template
- Get support on the OctoPrint Discord @cp2004
- Get support on the Community Forums @Charlie_Powell
I developed the plugin in my free time, so if you have enjoyed the plugin, you can sponsor its development here from as little as $1
The plugin is licensed under the terms of the AGPLv3 License. The author (Charlie Powell) assumes no liability for it's usage and the plugin comes with no warranty.