Raspberry Pi RGB Xmas Tree
curl -s https://raw.githubusercontent.com/modem7/rgbxmastree/master/install.sh | sudo bash
Install required packages:
sudo apt update && \
sudo apt install -y python3-gpiozero python3-pigpio git
cd /home/pi
git clone https://github.com/modem7/rgbxmastree.git
Copy across any scripts (.py
) from the examples
directory you wish, into the /home/pi/rgbxmastree
directory and make them executable.
E.g.
cd /home/pi/rgbxmastree
cp examples/randomsparkles.py ./
sudo chmod +x *.py
Edit as required.
sudo tee /etc/systemd/system/rgbxmastree.service << EOF
# rgbxmastree.service
[Unit]
Description=PiHut RGB Christmas tree
[Service]
WorkingDirectory=/home/pi/rgbxmastree
Type=simple
User=pi
ExecStart=/usr/bin/python3 randomsparkles.py
[Install]
WantedBy=multi-user.target
EOF
Enable the service:
sudo systemctl daemon-reload && \
sudo systemctl enable --now rgbxmastree
If you wish to edit the service (to change the script for example):
sudo nano /etc/systemd/system/rgbxmastree.service
Make your modifications, then restart the service with:
sudo systemctl restart rgbxmastree.service