Skip to content

Instantly share code, notes, and snippets.

@treehouse-su
Created May 15, 2015 00:29
Show Gist options
  • Save treehouse-su/4cb012e95a1d5ca31848 to your computer and use it in GitHub Desktop.
Save treehouse-su/4cb012e95a1d5ca31848 to your computer and use it in GitHub Desktop.
yoctopuce temp OPK script
#!/bin/sh
# configure pirateship image
sudo pirateship rename temper
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 --recursive https://github.com/treehouse-su/opk-yoctopuce-temp.git
# 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-yoctopuce-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