IoT

Connect Sensor Tag to Watson IoT platform using a Raspberry PI as gateway

In my previous post, to connect Sensor Tag to Watson IoT platform I used my MacBook as IoT gateway !

My Bluemix‘ s colleagues have developed a Node.js app (iot-sensor-tag) that allow to use a MacBook as IoT gateway, retrieve data from its sensors, and publish that data to the IoT platform. In theory you can run the application an anything that supports the Node.js runtime and Bluetooth LE, so you can install node.js and iot-sensor-tag application on Raspberry PI.

You have download the Bluetooth stack Bluez on the Raspberry Pi from:

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.32.tar.xz

and before installing Bluez, the Raspberry Pi environment needs to be updated to have the following set of libraries installed on it:

sudo apt-get install libglib2.0-0 libglib2.0-dev

sudo apt-get install libdbus-1-dev

sudo apt-get install libudev-dev

sudo apt-get install libical-dev

sudo apt-get install libreadline-dev

sudo apt-get install libusb-1.0-0-dev

You have extract the tar file downloaded earlier. Under the extracted directory the is the bluez-5.32 directory. You should find the configuration file ‘configure’ under the directory mentioned above Execute the following command to configure the Bluez

sudo ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --with-systemdsystemunitdir --with-systemduserunitdir --enable-library

Post successful configuration, now perform ‘make’ to install the Bluez

sudo make

During the make command I enjoined to monitor the Raspberry CPU utilization on my web dashboard. As you know the Raspberry can send performance data to Watson IoT platform. Here is my old post about it.

Sensor Tag to Watson IoT
IoT data for Raspberry make command

and finally run the app on node.js

Raspberry Pi as IoT gateway for Sensor Tag
Raspberry Pi as IoT gateway for Sensor Tag

As usual you have to register the device on Watson IoT platform and create a NodeRed flow. You can read my previous post at this link

Sensor Tag to Watson IoT
IoT data from Sensor Tag

Enjoy with Sensor Tag and Raspberry PI !

Related Articles

One Comment

  1. Sir may I know that is the sensortag is directly connected via USB cable thru CC debugger or a separate Bluetooth dongle module is used for this purpose to establish communication between rpi and sensoratag wirelessly over BLE protocol?

Back to top button