52Pi ZP-0128 ABSMiniTowerKit Ice Tower LED Fans Custom Color Python Script
-
Make sure you followed all steps in https://wiki.52pi.com/index.php?title=ZP-0128 to make it work first
-
Run "sudo pip install rpi_ws281x"
-
Place the pyledx.py file on a directory you'll remember, we'll use the following path
/home/surce/pyledx.py
-
Disable minitower_moodlight.service by using the following command
sudo systemctl disable minitower_moodlight.service
-
STOP minitower_moodlight.service by using the following command
sudo systemctl stop minitower_moodlight.service
-
Test the pyledx.py script by running the following command
sudo python3 pyledx.py -c --test
-
Confirm it's working
-
Find a color option which suits your needs by looking at the help dialog by typing
sudo python3 pyledx.py -h *Make sure you've stopped the minitower_moodlight.service before playing with the script or it may throw buggy results in the leds and could eventually freeze or hang them until next restart, if you've experienced this issue then reboot and start again
-
Modify the ExecStart from service minitower_moodlight.service
sudo nano /lib/systemd/system/minitower_moodlight.service
-
Comment the line ExecStart=sudo /usr/bin/moodlight & with an # before ExecStart, like this #ExecStart
-
Add the following ExecStart instead
ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --cyan &'
-
Enable minitower_moodlight.service by using the following command
sudo systemctl enable minitower_moodlight.service
-
Reboot to confirm it's working and enjoy!
-
You can also play with ExecStart by using:
ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --purple &' ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --white &' ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --purple --pulsate --pulsatevelocity 0.5 &' ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --complex_universe &' ExecStart=/bin/bash -c '/usr/bin/python3 /home/surce/pyledx.py -c --complex_hellsgate &'