IoT Projects with Bluetooth Low Energy

Our article on Beacon Proximity and Sensing for the Internet of Things (IoT) provides short summary how to use Bluetooth for IoT.

If you need a more rigorous description take a look at the book IoT Projects with Bluetooth Low Energy. It covers the fundamental aspects of Bluetooth Low Energy scanning, services, and characteristics. It goes on to describe examples of how to monitor health data, perform indoor navigation and use the Raspberry Pi for Bluetooth solutions. The book’s code is also available on GitHub.

View Sensor Beacons

Advertise Eddystone Using node.js

We recently came across node-eddystone-beacon that advertises Eddystone using node.js (Javascript). It works across MacOS, Linux (including Raspberry Pi) and Windows but obviously requires the device to have a Bluetooth adapter.

The open source code advertises Eddystone-URL, Eddystone-UID and Eddystone-TLM. Examples are provided.

Our previous post mentioned node-beacon-scanner that provides for node.js Bluetooth scanning.

OmnIoT SoftHub for Bluetooth Solutions

OmnIoT SoftHub is a way of creating IoT edge applications quickly without any programming. It runs on Raspberry Pi hardware (2, 3, 4, or Zero/W) and detects iBeacon, AltBeacon, and EddyStone beacons ‘out of the box’. The authors have told us they are interested in integrating other Bluetooth sensor types.

The platform allows sending of data to many 3rd party MQTT brokers. It logs data to internal or attached storage and can also decode data into a variety of data formats. Thresholds can be created to cause events, for example, sending alarm emails or SMS messages direct from the platform itself.

It’s free for personal use and one-off company projects. It only needs to be licensed if you are going to re-sell it as part of a solution.

For more information, read the FAQ and explore the YouTube channel.

Node Beacon Scanner

If you are developing using Node, there’s a Node.js module, node-beacon-scanner, that allows you to scan Bluetooth beacon packets and parse the packet data.

While Node tends to be associated with Linux, servers and hence web sites, Node can also be used on small single board computers such as the Raspberry Pi. Hence, this module provides an easy way to scan for Beacons and other Bluetooth devices.

The module supports iBeacon and Eddystone and outputs the MAC address, local name, transmit power level, RSSI and the iBeacon/Eddystone specific attributes.

Detecting Beacons on Linux Devices

Beacons don’t just work with smartphones. They can work with any other devices that have Bluetoooth LE. This includes Single Board Computers (SBCs) such as the Raspberry Pi 3 and new $10 Pi Zero W that include Bluetooth 4.1.

Pi zero Wireless

If you take a look at our article on Implementation Types, the smartphone app or gateway in each scenario could equally be a SBC.

For sensing and RTLS applications, the SBC can do additional pre-processing to extract and/or filter sensor data. It can also do post processing to aggregate data and/or reformat for specific IoT platforms. Another advantage of a SBC over a gateway is that data can be cached when WiFi or Internet connectivity isn’t available and queued for sending later so that the data isn’t lost.

The starting place for evaluating use of Linux-based SBCs is usually the command line hcitool. This can be used to scan for and connect to beacons and save data to a file. There’s also a script available to scan and decode advertising data.

Implementations usually use the Bluez library that can be programatically accessed via languages such as c, Python and Javascript (node.js).