Skip to content

Instantly share code, notes, and snippets.

@soldair
Last active August 29, 2015 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soldair/4612ecc9745bbb91b368 to your computer and use it in GitHub Desktop.
Save soldair/4612ecc9745bbb91b368 to your computer and use it in GitHub Desktop.
install pinccio cli on pi
# to setup pinoccio bridge on boot
# this starts bridge and keeps it running if it crashes.
# if there are no scouts connected it will retry once per second.
# log data is written to /var/log/pinoccio-bridge.log
# for verbose logging change `pinoccio bridge` to `pinoccio bridge -v`
echo "while [ 1 ]\
do\
pinoccio bridge\
sleep 1\
done;" > pinoccio-bridge.sh
chmod +x pinoccio-bridge.sh
if [ -f "/etc/rc.local.orig" ]; then
echo "backup already made."
else
sudo cp /etc/rc.local /etc/rc.local.orig
fi
# remove any old pinoccio bridge lines
cat /etc/rc.local | grep -v pinoccio-bridge > rc.local.tmp
# delete the last line in the file it's "exit 0"
cat rc.local.tmp | sed '$ d' >> rc.local.tmp2
mv rc.local.tmp2 rc.local.tmp
# add the code to start bridge on boot
echo "su pi -c'/home/pi/pinoccio-bridge.sh < /dev/null 2>>1 1>> /var/log/pinoccio-bridge.log &'" >> rc.local.tmp
# add the exit 0 back to the file
echo "exit 0" >> rc.local.tmp
# make a backup
sudo cp /etc/rc.local /etc/rc.local.bak
# put new changes in place
sudo mv rc.local.tmp /etc/rc.local
sudo chmod +x /etc/rc.local
echo "to see your changes you have to reboot. you can run 'sudo reboot' to reboot"
# this installs node 10.26 which is the latest pre-compiled binary as of 11-7-2014 and the pinccio cli!
curl http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz \
| sudo tar xzvf - --strip-components=1 -C "/usr/local/"
sudo npm install -g pinoccio
# plug in a scout and try
pinoccio serial
# for some reason the interactive prompt for password isn't working so to login
pinoccio login --email youremail --password yourpassword
# to make sure you got logged in try
pinoccio who
#and use the pi as a bridge!!
pinoccio bridge
@soldair
Copy link
Author

soldair commented Nov 7, 2014

this replaces your version of node. This is ok to run again if you tried and had issues installing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment