Last active
August 29, 2015 14:21
-
-
Save treehouse-su/7cbd172e2b0c567885bd to your computer and use it in GitHub Desktop.
1wire temp OPK script
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
#!/bin/sh | |
# configure pirateship image | |
sudo pirateship rename onewire | |
sudo pirateship adapter pirate.sh/ip "" none | |
sudo ifdown wlan0 | |
sudo ifup wlan0 | |
# install opk drivers | |
# NOTE: must manually copy phant 'keys_*.json' file to /boot directory | |
cd /root | |
git clone https://github.com/open-eio/opk-phant-json.git | |
git clone https://github.com/open-eio/opk-wrap.git | |
git clone https://github.com/open-eio/opk-1wire-temp.git | |
cp /boot/config.txt /boot/config.txt.orig | |
echo "dtoverlay=w1-gpio" >> /boot/config.txt | |
# jack in the box | |
cd `dirname "$0"` | |
mv $0 autoran.sh | |
touch $0 | |
chmod 755 $0 | |
# regular autorun.sh | |
echo '#!/bin/sh' > $0 | |
echo '' >> $0 | |
echo 'cd `dirname "$0"`' >> $0 | |
echo '# note: "-n10" refers to the number of seconds between commands. should be > 9 seconds for phant.' >> $0 | |
echo 'watch -n10 "/root/opk-1wire-temp/pull | /root/opk-wrap/wrap -s JSON -k temp | /root/opk-phant-json/push"' >> $0 | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment