-
Notifications
You must be signed in to change notification settings - Fork 7
How to setup a Raspberry Pi Zero W and PGSparkLite from scratch
Rich Tamblyn edited this page May 6, 2024
·
19 revisions
- Raspberry Pi Zero W
- MicroSD card (minimum 4GB)
- Suitable standalone 5V power supply or PC USB port and micro USB cable
- Download and install Raspberry Pi Imager software (https://www.raspberrypi.org/software/)
- Burn the latest image of Raspberry Pi OS Lite to the micro SD card
- Before inserting microSD card into the Pi:
- For headless setup, SSH should be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD Card.
- Follow the instructions here to configure WiFi on the Pi - https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-headless-raspberry-pi
- Insert the microSD card and power up the Pi
- If necessary download and install an SSH client application (Putty is a good one, https://putty.org)
- SSH to the Pi using the address
raspberrypi.local
and login using the default credentials (change these ASAP)
- Execute the following commands;
sudo apt update
sudo apt upgrade -y
sudo apt install git pi-bluetooth python3-bluez python3-pip -y
There can be a noticeable lag between changes made on the amp and updates to the web interface. This can be reduced by installing Eventlet to handle the socket communications. NOTE: Do not install Eventlet if you plan to debug the codebase in the future.
sudo pip3 install eventlet
- Execute the following command. This will open the Bluetooth configuration file in the nano text editor;
sudo nano /etc/bluetooth/main.conf
- Page down to the bottom of the file and add the following statement on a new line:
DisablePlugins = pnat
- Press
Enter
to add a line to the end of file - Press
Ctrl+O
, then press Enter to save the changes - Press
Ctrl+X
to exit the nano text editor
- Execute the following commands to download the latest version of PGSparkLite to
/home/pi/PGSparkLite
;
cd ~
git clone https://github.com/richtamblyn/PGSparkLite.git
- Install the application dependencies by executing the following commands;
cd PGSparkLite
sudo pip3 install -r requirements.txt --break-system-packages
- Execute the following commands to allow the PGSparkLite startup script to run;
sudo chmod +x pgsparklite.sh
- Enter the following command to copy the PGSparkLite service to the system directory;
sudo cp pgsparklite.service /etc/systemd/system/pgsparklite.service
sudo systemctl enable pgsparklite.service
- Execute the following command to restart the Pi and start the PGSparkLite server;
sudo reboot
- Turn on your Positive Grid Spark 40 amp
- Open a web browser on a networked PC and enter
http://raspberrypi.local:5000
into the address bar - The PGSparkLite home page should now load
- Click the 'Connect' button to establish communication to your amp
- If connection is successful the controls page should now be shown
- To remove the need to specify the web port (default is 5000), look at installing nginx to reverse proxy the service to a common port.