-
-
Notifications
You must be signed in to change notification settings - Fork 26
SPI Setup
The plugin uses the Raspberry Pi's SPI interface to push data to the LED strip, rather than PWM since it doesn't need to be run as root to use SPI.
As a result of this, there are a couple of OS level configuration items that need to be handled. Luckily for you, the plugin makes this very easy for you to do by providing a UI to run the commands.
Note: You may need to reload the web UI after installing the plugin, to get the wizard to show up. It will not display if all settings are correct.
-
Add the
pi
user to thegpio
group. Already configured on newer images. Means thepi
users can access the GPIO pins.- Runs
sudo adduser pi gpio
- Runs
-
Enable SPI. The plugin uses SPI to drive the LEDs, which is disabled by default and needs to be turned on.
- Adds
dtparam=spi=on
to/boot/config.txt
- Adds
-
Increase SPI buffer size. Whilst the plugin will work without this, it will only work well with a handful of LEDs.
- Adds
spidev.bufsize=32768
to the end of/boot/cmdline.txt
- Adds
-
Set compatible clock frequency - Raspberry Pi 3 or earlier only, not required for a Pi 4 The Pi 3's default internal clock frequency is not compatible with SPI, so it needs to be set to 250 to be compatible.
- Adds
core_freq=250
to/boot/config.txt
- Adds
-
Set a minimum clock frequency - Raspberry Pi 4 only On a Raspberry Pi 4, the clock frequency is dynamic and can change when the pi is 'idle' vs. 'working', which causes LEDs to flicker, change colour, or stop working completely. By setting a minimum the same as the max, we stop this dynamic clocking.
- Adds
core_freq_min=500
to/boot/config.txt
- Adds
At any time, you can run a test of the above settings, using the configuration test dialog. New in 0.6.0, you can access this in the settings page under 'Utilities'. When you run the test, it will tell you if all of the above steps are filled in correctly, and if they are not, prompt you to fix it with a handy button.
This data is also logged to octoprint.log
on startup, to help me with diagnosing issues reported to rule out this configuration.
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.