Created
May 4, 2016 14:48
-
-
Save brianehlert/1082f38565d62d6cb9508ad847549ed5 to your computer and use it in GitHub Desktop.
Gateblu-Forever on Raspian Jessie
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
Node and Node ARM have been updated. | |
Node 4 requires updated gcc binaries. | |
If on Wheezy follow the instructions at the node-arm project: | |
https://github.com/nathanjohnson320/node_arm | |
The instructions here assume the latest Raspian Jessie image (RaspberryPi.org/downloads) | |
To set Raspian to boot without a GUI desktop (and get a bit more performance): | |
sudo raspi-config | |
Boot options | |
B1 or B2 console option | |
Ensure you have enough space so expand the image that you flashed | |
Expand Filesystem | |
reboot | |
1) Update gcc (required for node 4) | |
sudo apt-get update | |
sudo apt-get install -y gcc-4.8 g++-4.8 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 | |
2) Install node for ARM | |
echo "deb http://node-arm.herokuapp.com/ /" | sudo tee --append /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install node -y --force-yes | |
node -v | |
3) Update npm | |
sudo npm -g update npm | |
4) set git to use https instead: of git: (for port blocking of git port 9418) | |
sudo git config --global url.https://.insteadOf git:// | |
5) Global install of node-gyp for modules | |
sudo npm install -g -y node-gyp node-pre-gyp | |
6) Node-gyp requires python 2.7 (only) and Raspian Jessie has multiple version of python installed. | |
If calling node-gyp directly use the environment variable declaration: node-gyp --python /usr/bin/python2.7 | |
npm config set python /usr/bin/python2.7 | |
7) To support direct attached USB devices with Gateblu (such as Blink(1), webcam) | |
sudo apt-get install -y libusb-1.0-0-dev libudev-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev | |
sudo npm install -g -y node-hid --unsafe-perm | |
There is still an install error reported when installing node-hid this way, but node-hid reports as being installed. Not installing it this way but as part of meshblu-blink1 node-hid is reported as not being installed. | |
8) Install Gateblu Service | |
sudo npm install -g gateblu-forever --unsafe-perm | |
sudo curl -o /etc/init.d/gateblu-service https://raw.githubusercontent.com/octoblu/gateblu-forever/master/.installer/raspbian/init.d/gateblu-service | |
sudo chmod +x /etc/init.d/gateblu-service | |
sudo update-rc.d gateblu-service defaults | |
9) Start Gateblu | |
sudo service gateblu-service start | |
10) Find the UUID and token | |
Wait a minute or two after starting Gateblu. We need it to generate an identity and write the meshblu.json file. | |
cd gateblu-service | |
Do an ls a couple times until the meshblu.json configuration file is written. | |
Nano meshblu.json | |
*you will need to copy and paste the uuid and token | |
11) Claim the Gateblu instance | |
Open Things, Scroll down to Octoblu, Select Gateblu, select Connect Gateblu, select Already Downloaded, select Claim an Existing Thing, add a name and paste the uuid and token, select Connect Gateblu | |
Additional Notes: | |
basic Start / Stop Gateblu | |
sudo service gateblu-service start | |
sudo service gateblu-service stop | |
Blink1: | |
Due to udev permissions issues, you need to follow this step to allow the pi user to have write access to the blink1. | |
sudo curl -o /etc/udev/rules.d/51-blink1.rules https://raw.githubusercontent.com/todbot/blink1/master/linux/51-blink1.rules | |
sudo udevadm control --reload-rules | |
Unplug and re-plug the Blink(1) | |
basic File Locations | |
You can find: | |
• debug log at: /home/pi/gateblu-service/gateblu.log | |
• meshblu.json file at: /home/pi/gateblu-service/meshblu.json | |
To update (you must reinstall): | |
sudo npm update -g gateblu-forever --unsafe-perm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment