During second Eclipse Open IoT Challenge I’ve been working on personal eHealth gateway. It is a system for monitoring human health parameters and allowing medical personnel or fitness instructors to assess current and historical data. It consist of personal gateway device, web client and ancillary sensor devices.
There are a lot of bio-electrical sensors on the market. Many of them provide connectivity options through Bluetooth Low Energy profile. My project utilize small embedded computer that act as local home gateway. During development I was working on Raspberry Pi 2. It acquire data from BLE sensors and send it to the message broker. Backend application with web UI access broker server and present obtained data.
My system consist of four components:
- Sensor devices ( Silicon Labs Sensor Puck, Generis Heart Rate BLE Monitor, custom ECG 3 lead monitor with BLE using Cypress PSoC4 BLE
- eHealth Personal Gateway software ( Eclipse Kura 1.4 running on Raspberry Pi )
- Eurotech Everyware Cloud ( trial version of commercial IoT device cloud offering )
- Web client application ( OSGi EnRoute based AngularJS web application and backend running on Red Hat OpenShift DIY cartridge )
I’m a big fan of OSGi and Eclipse based technologies, so my software stack decisions where rather biased😉. I’ve used Eclipse Kura on gateway and OSGi enRoute (project, framework, and tooling …) as a base for implementing needed functionality.
High level overview is shown on below diagram:
During analysis of available sensor devices, Linux Bluetooth stack and abilities of Kura framework I’ve discovered that one of my sensor devices, Silicon Labs Sensor Puck, transmits data in Bluetooth advertising packages. Unfortunately at that time, Kura wasn’t able to get those data. Meanwhile, Lee Marshall submitted pull request which allows to listen for Bluetooth Beacons. They works similar – transmit data in advertisement packets (Bluetooth specification describes it as EXTENDED INQUIRY RESPONSE DATA FORMAT).
I’ve modified org.eclipse.Kura.Bluetooth.linux bundle in order to listen for advertising packets specific for SensorPuck device. I have a plan to contribute my code to Kura project. I’ve already presented it on mailing list. Hopefully it will be my first contribution.
The second device, generic heart rate monitor belt, caused serious problems. Although it provides appropriate profile (Heart Rate Profile) and it looked pretty simple to integrate, connecting to this device was impossible from Linux. Apparently, my heart rate belt during connecting to it issues connection parameters update request (as in Bluetooth specification). I faced serious problems to answer this request or force change of initial connection parameters. So, currently my system do not support generic HRM devices.
Application on local gateway (based on Kura) collects measured heart rate values and raw data from optical sensor (extracted from advertisement packets) and if measurement was correct sends it to the Everyware cloud. Raw data are available locally through Event Admin service for bundles interested in processing such data. Currently, those data are not used.
I use Everyware Cloud as message broker and for remote configuration. It is a commercial solution and helps a lot during development and operation. It provides REST API and java client library that allows to access data available on the broker.
Because I use OSGi for developing application on Kura, I also choose it for creating Web based application. I choose OSGi enRoute project. It allowed me to easily develop AngluarJS frontend application and REST backend system. All of it is deployed as one jar file and can be started as any Java application. I choose Red Hat Openshift cloud offering. You can seen screenshot of the working dashboard.
Using open source technologies like Eclipse Kura, Linux, enRoute and OSGi specs allows to easily create systems and in case something is not working, or there is no particular feature, you can do it yourself and extend.
I had a lot of fun working with bluetooth and Kura, especially parts where I needed to change its implementation.