Rudimentary BLE peripheral using Node.js and Bleno

I thought I set up a system of my home dialysis devices for automatic
collection of data. Blood pressure meassurment devices and scales I’ve
looked at use Bluetooth Low Energy to communicate with a central
device. I thought I use a Raspberry Pi to scan peripherals and colect
data at times of meassurement.

For this, I tried to set up a toy BLE peripheral out of a Raspberry Pi
3B (shipps with Bluetooth 4.1 and Wi-Fi which makes the device much
easier to work with than other Pi alternatives).

I started out googling some Python projects as well as some of the
litterature (e.g. Getting Started with Bluetooth Low Energy, Tools
and Techniques for Low-Power Networking by Kevin Townsend, Carles
Cufí, Akiba, Robert Davidson).

Being a total novice on Bluetooth Low Energy, I did not have the chops
to take a Python project to fruition. Instead, I found a couple of
blog posts and projects using Node.js and Blemo. This was a fast
track.

On the Pi I have the “latest” Stretch Lite (Debian 9.4). The installed
bluez is version is 5.43 which works fine with BLE, but before going
further we need to shut down the bluez bluetoothd but bring up the
host interface

sudo systemctl stop bluetooth
sudo hciconfig hci0 up

Make sure the daemon is “quitting” by issuing

sudo systemctl status bluetooth

Node needs to be installed. I snatched the latest binary, you might
need to check the versions available at the site, from NodeJS.org and
installed it.