#!/bin/bash # Setup script for SPI testing on Raspberry Pi echo "Setting up SPI for testing..." # Enable SPI interface echo "Enabling SPI interface..." sudo raspi-config nonint do_spi 0 # Install required packages echo "Installing required packages..." sudo apt update sudo apt install -y python3-spidev python3-pip # Install Python dependencies using pipenv echo "Installing Python dependencies with pipenv..." cd .. pipenv install # Check SPI devices echo "Checking SPI devices..." ls -la /dev/spi* # Show GPIO configuration echo "GPIO Configuration:" echo " SCK: GPIO11 (Physical pin 23)" echo " MISO: GPIO9 (Physical pin 21)" echo " MOSI: GPIO10 (Physical pin 19)" echo " CS: GPIO8 (Physical pin 24)" echo "Setup complete!" echo "Run send-json with:" echo " pipenv run send-json --beat --brightness 128"