{"__v":38,"_id":"558473c0d57d770d00343a16","category":{"__v":5,"_id":"557790ace6063e0d0048146a","pages":["557790ade6063e0d0048146c","5577bb5be6063e0d004814f4","5577bb66a042551900b00443","5577bb6da042551900b00445","558473c0d57d770d00343a16"],"project":"557790abe6063e0d00481466","version":"557790ace6063e0d00481469","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-10T01:19:40.602Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"project":"557790abe6063e0d00481466","user":"5564f227f0f70f0d00a9ab20","version":{"__v":4,"_id":"557790ace6063e0d00481469","project":"557790abe6063e0d00481466","createdAt":"2015-06-10T01:19:40.071Z","releaseDate":"2015-06-10T01:19:40.071Z","categories":["557790ace6063e0d0048146a","5577bceaa042551900b0044b","55d222fa3c74062300aee56e","55db5726b0e9140d00a632ba"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["563f25da1c29770d0091d217"],"next":{"pages":[],"description":""},"createdAt":"2015-06-19T19:55:44.568Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Connect your your Raspberry Pi to the internet before beginning.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Version Requirements\",\n  \"body\": \"Requires gateblu-forever v3.3.2 or higher!\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Raspbian\",\n  \"body\": \"These instructions are for [Raspbian](https://www.raspberrypi.org/downloads/) running on Raspberry Pi A/B/B+/2\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Install Node and Dependencies\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"wget https://nodejs.org/dist/latest-v5.x/node-v5.11.1-linux-armv6l.tar.gz && \\\\\\ntar -xvf node-v5.11.1-linux-armv6l.tar.gz  && \\\\\\ncd node-v5.11.1-linux-armv6l && \\\\\\nsudo cp -R * /usr/local/ && \\\\\\nsudo apt-get install -y --force-yes libusb-1.0-0-dev && \\\\\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"libusb-1.0-0.dev\",\n  \"body\": \"libusb-1.0-0.dev package is optional, but you will probably need it for most devices connected to the Raspberry Pi\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Install Gateblu Service\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo npm install -g gateblu-forever && \\\\\\nsudo curl -o /etc/init.d/gateblu-service https://raw.githubusercontent.com/octoblu/gateblu-forever/master/.installer/raspbian/init.d/gateblu-service  && \\\\\\nsudo chmod +x /etc/init.d/gateblu-service && \\\\\\nsudo update-rc.d gateblu-service defaults\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"meshblu.json and /boot\",\n  \"body\": \"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.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Start / Stop Gateblu\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo service gateblu-service start\\nsudo service gateblu-service stop\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Blink1\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"udev permission\",\n  \"body\": \"Due to udev permissions issues, you need to follow this step to allow the pi user to have write access to the blink1.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo curl -o /etc/udev/rules.d/51-blink1.rules https://raw.githubusercontent.com/todbot/blink1/master/linux/51-blink1.rules  && \\\\\\nsudo udevadm control --reload-rules\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Bluetooth Permissions\"\n}\n[/block]\n### Running without root/sudo \n\nRun the following command:\n\n```sh\nsudo setcap cap_net_raw+eip $(eval readlink -f `which node`)\n```\n\nThis grants the ```node``` binary ```cap_net_raw``` privileges, so it can start/stop BLE advertising.\n\n__Note:__ The above command requires ```setcap``` to be installed, it can be installed using the following:\n\n * apt: ```sudo apt-get install libcap2-bin```\n * yum: ```su -c \\'yum install libcap2-bin\\'```\n\nSource: [Noble NPM Module](https://www.npmjs.com/package/noble) \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"File Locations\"\n}\n[/block]\nYou can find a debug log at `/home/pi/gateblu-service/gateblu.log`\n\n`meshblu.json` file is located at `/home/pi/gateblu-service/meshblu.json`","excerpt":"","slug":"raspberry-pi","type":"basic","title":"Raspberry Pi"}
Connect your your Raspberry Pi to the internet before beginning. [block:callout] { "type": "danger", "title": "Version Requirements", "body": "Requires gateblu-forever v3.3.2 or higher!" } [/block] [block:callout] { "type": "info", "title": "Raspbian", "body": "These instructions are for [Raspbian](https://www.raspberrypi.org/downloads/) running on Raspberry Pi A/B/B+/2" } [/block] [block:api-header] { "type": "basic", "title": "Install Node and Dependencies" } [/block] [block:code] { "codes": [ { "code": "wget https://nodejs.org/dist/latest-v5.x/node-v5.11.1-linux-armv6l.tar.gz && \\\ntar -xvf node-v5.11.1-linux-armv6l.tar.gz && \\\ncd node-v5.11.1-linux-armv6l && \\\nsudo cp -R * /usr/local/ && \\\nsudo apt-get install -y --force-yes libusb-1.0-0-dev && \\", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "libusb-1.0-0.dev", "body": "libusb-1.0-0.dev package is optional, but you will probably need it for most devices connected to the Raspberry Pi" } [/block] [block:api-header] { "type": "basic", "title": "Install Gateblu Service" } [/block] [block:code] { "codes": [ { "code": "sudo npm install -g gateblu-forever && \\\nsudo curl -o /etc/init.d/gateblu-service https://raw.githubusercontent.com/octoblu/gateblu-forever/master/.installer/raspbian/init.d/gateblu-service && \\\nsudo chmod +x /etc/init.d/gateblu-service && \\\nsudo update-rc.d gateblu-service defaults", "language": "shell" } ] } [/block] [block:callout] { "type": "success", "title": "meshblu.json and /boot", "body": "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." } [/block] [block:api-header] { "type": "basic", "title": "Start / Stop Gateblu" } [/block] [block:code] { "codes": [ { "code": "sudo service gateblu-service start\nsudo service gateblu-service stop", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "Blink1" } [/block] [block:callout] { "type": "warning", "title": "udev permission", "body": "Due to udev permissions issues, you need to follow this step to allow the pi user to have write access to the blink1." } [/block] [block:code] { "codes": [ { "code": "sudo curl -o /etc/udev/rules.d/51-blink1.rules https://raw.githubusercontent.com/todbot/blink1/master/linux/51-blink1.rules && \\\nsudo udevadm control --reload-rules", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "Bluetooth Permissions" } [/block] ### Running without root/sudo Run the following command: ```sh sudo setcap cap_net_raw+eip $(eval readlink -f `which node`) ``` This grants the ```node``` binary ```cap_net_raw``` privileges, so it can start/stop BLE advertising. __Note:__ The above command requires ```setcap``` to be installed, it can be installed using the following: * apt: ```sudo apt-get install libcap2-bin``` * yum: ```su -c \'yum install libcap2-bin\'``` Source: [Noble NPM Module](https://www.npmjs.com/package/noble) [block:api-header] { "type": "basic", "title": "File Locations" } [/block] You can find a debug log at `/home/pi/gateblu-service/gateblu.log` `meshblu.json` file is located at `/home/pi/gateblu-service/meshblu.json`