Skip to content

Instantly share code, notes, and snippets.

@brianehlert
Created October 21, 2015 15:02
Show Gist options
  • Save brianehlert/5c4f3a5d1cae27c27917 to your computer and use it in GitHub Desktop.
Save brianehlert/5c4f3a5d1cae27c27917 to your computer and use it in GitHub Desktop.
Installing Gateblu Linux on RaspberryPi Jessie
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
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
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))
sudo apt-get install -y libusb-1.0-0-dev libudev-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:
meshblu.json and /boot
If you place a meshblu.json file in your /boot partition and it is newer than what is found in ~/gateblu-service/meshblu.json, it will be copied to ~/gateblu-service/meshblu.json when the service starts.
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
Origional From <https://gateblu.octoblu.com/docs/raspberry-pi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment