Skip to content

Instantly share code, notes, and snippets.

@dwblair
Created May 16, 2015 05:24
Show Gist options
  • Save dwblair/991615140ed54b223857 to your computer and use it in GitHub Desktop.
Save dwblair/991615140ed54b223857 to your computer and use it in GitHub Desktop.
copy and rename as autorun.sh in /boot directory -- loading arduino files from https://github.com/openpipekit on the moteinos
#!/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/openpipekit/opk-soil-moisture-adafruit.git
git clone https://github.com/open-eio/opk-phant-json.git
# jack in the box
cd /boot
mv autorun.sh autoran.sh
touch autorun.sh
chmod 755 autorun.sh
# regular autorun.sh
echo '#!/bin/sh' > /boot/autorun.sh
echo '' >> /boot/autorun.sh
echo 'cd /boot' >> /boot/autorun.sh
# note: '-n10' on the next line refers to the number of seconds between commands. should be > 9 seconds for phant.
echo 'watch -n20 "/root/opk-soil-moisture-adafruit/pull-all -p /dev/ttyUSB0 | /root/opk-phant-json/push -v"' >> /boot/autorun.sh
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment