-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update configuration for raspbian 9 + systemctl set up unit tests
- Loading branch information
Ellery Newcomer
committed
Nov 10, 2018
1 parent
19247db
commit ea3e1d8
Showing
25 changed files
with
424 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
Based on https://github.com/tinue/APA102_Pi | ||
|
||
# Prerequisites | ||
|
||
see above, but basically | ||
|
||
* pi should have raspbian 9 on it | ||
|
||
* pi should have SPI enabled | ||
|
||
``` | ||
raspi-config | ||
# Interfacing Options > SPI | ||
reboot | ||
``` | ||
|
||
* Adafruit_Python_GPIO should be installed | ||
|
||
see https://github.com/adafruit/Adafruit_Python_GPIO, but basically | ||
|
||
``` | ||
apt-get install build-essential python3-pip python3-dev python3-smbus git | ||
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git | ||
cd Adafruit_Python_GPIO | ||
python setup.py install | ||
``` | ||
|
||
for testing on a not-raspberry pi this seemed to work: | ||
``` | ||
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git | ||
python setup.py install | ||
``` | ||
|
||
|
||
# Deploy | ||
|
||
``` | ||
python deploy.sh | ||
``` | ||
|
||
will push code and restart the script. To make it run on boot up, you will have to run | ||
|
||
``` | ||
systemctl enable lightshow.service | ||
``` | ||
|
||
manually on the pi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PIDFILE=/var/run/lightshow.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: lightshow | ||
# Required-Start: | ||
# Required-Stop: | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: led service | ||
# Description: leds! | ||
### END INIT INFO | ||
|
||
source /etc/default/lightshow | ||
|
||
startthings() { | ||
echo "starty $(date)" >> /home/pi/lighty | ||
start-stop-daemon --pidfile=$PIDFILE -b -m --start --exec /usr/bin/python3 /home/pi/squiggly/src/run.py | ||
} | ||
|
||
stopthings() { | ||
start-stop-daemon --pidfile=$PIDFILE --stop && rm -f $PIDFILE | ||
} | ||
|
||
case "$1" in | ||
start) | ||
startthings | ||
;; | ||
stop) | ||
stopthings | ||
;; | ||
force-reload|restart|reload) | ||
stopthings | ||
startthings | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=leds! | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/usr/bin/python3 run.py | ||
WorkingDirectory=/home/pi/squiggly/src | ||
StandardOutput=inherit | ||
StandardError=inherit | ||
Restart=always | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pyfrc | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
echo $PYTHONPATH | ||
export PYTHONPATH=$(pwd)/src | ||
|
||
echo $PYTHONPATH | ||
python -m pytest tests |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.