Skip to content

Commit 5fa96a0

Browse files
committed
enable SPI in installation scripts
fixes #38
1 parent 550237e commit 5fa96a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

install/install_dependencies.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ main(){
1010
trap 'fail $? $LINENO' ERR
1111

1212
updateAndInstallPackages
13+
enableSpi
1314
installLedDriver
1415
clearYoutubeDlCache
1516
installNode
@@ -45,6 +46,17 @@ updateAndInstallPackages(){
4546
sudo python3 -m pip install --upgrade youtube_dl yt-dlp numpy pytz websockets simpleaudio pygame pyjson5
4647
}
4748

49+
enableSpi(){
50+
if [ "$(sudo raspi-config nonint get_spi)" = "1" ]; then
51+
info "Enabling SPI..."
52+
# https://raspberrypi.stackexchange.com/a/96679
53+
sudo raspi-config nonint do_spi 0
54+
touch $RESTART_REQUIRED_FILE
55+
else
56+
info "SPI was already enabled."
57+
fi
58+
}
59+
4860
installLedDriver(){
4961
info "Installing LED driver..."
5062
local led_driver

0 commit comments

Comments
 (0)