IOT setup using a bluetooth sensor streaming data to the Beaglebone which submits it to the IBM cloud
Note: This blog post is being superceded with updates here: BeagleBone Black IoT Project Bundle
This is forked from a project HERE, but changed slightly to work with the TI Sensor Tag CC2650.
It is a very easy project with only a few minor edits needed. This can be done in about 20 minutes from start to finish, and looks great at the end.
What You'll Need
Beagle Bone Black
|TI Sensor CC2650|
First we need to grab the code:
cd ~ git clone http://github.com/ibm-messaging/iot-beaglebone
Then we need to get to the code's directory
Then we need to install the dependencies. Luckily this very easy thanks to the automated script provided
Editing the script
We only need to edit one file to get this to work. The credit for this edit goes to AshokRao.
You need to download the file attached to this blog, See at the bottom.
This file needs to replace the file iot_beaglebone/samples/nodejs/node_modules/sensortag/lib/cc2650.js. Copy the file at the bottom and replace the existing file with this new one
The only differences are on lines 186-188 where we have used a different version of the API from Node.js framework that does not evaluate the offset & continues to read the data from the buffer. The default is “false”. For documentation on this and other API’s, please refer: https://nodejs.org/api/buffer.html#buffer_buf_readint16le_offset_noassert .
Everything is now done!
Just run the main script using the command
cd ~/iot_beaglebone/samples/nodejs node iot_sensortag.js
Now follow the link below and type in your BBB's mac address (shown when you start the .js script) to view the data.
Hope it now works for all of you. Please leave your comments, suggestions, and problems below.