There’s a growing number of operating systems for microcontrollers on single board computers, most of which can scan for Bluetooth LE devices such as beacons and connect to them via GATT for setup and extraction of data. Zerynth is now one such OS that you can program using Python. Zerynth r2.2.0 update allows use of Bluetooth LE.
Haltian has a useful IoT protocols comparison. It provides a comparison of TE Cat 1, LTE Cat M1, EC-GSM-IoT, NB-Io, Zigbee, SigFox, LoRa, Google Thread, Bluetooth LE and Wirepas Mesh.
Haltian say “It’s is a question of selecting the best-suited option for each use-case at hand”. One thing they don’t say is that the protocols are not mutually exclusive. For example, it’s increasingly the case that more than one protocol is used, one for short on-site distances and another for intra-site communication. WiFi/Ethernet also aren’t mentioned which are often a component of IoT solutions.
Bluetooth LE works at 2.4GHz, the same frequency used for WiFi and microwave ovens! There are two main types of Bluetooth LE transmission: advertising where the device only sends out data and connection-orientated using Generic Attributes (GATT) .
Bluetooth LE uses frequency hopping for increased reliability when there might be noise on a particular channel. When advertising, it uses channels 37, 37 and 39. If subsequently connected, it uses other channels:
When only advertising, the transmission is very short of the order of 1 or 2 milliseconds. In between advertising, there is no transmission which is one of the main reasons why Bluetooth LE has very low power use:
The paper explains how the Bluetooth Mesh Standard came about to address the problem of the variety of BLE meshing solutions that were not interoperable. It includes a great introduction to Bluetooth LE and Mesh with some statistical and experimental insights into mesh performance.
The authors explain how the choice of the use of advertising advertising at 100% duty cycle for lower end-to-end delay has degraded the low energy advantage of BLE advertising thus limiting the usefulness in power (battery) sensitive applications.
The paper contains some useful insights:
The back off mechanism, used to decrease the chance of mesh network collisions, contributes most to the communication delay. However, as they identify, it’s this mechanism that provides reliability and scalability in larger networks. Disabling the backoff mechanism decreases the delay but makes the network less scaleable and robust.
Making the network more dense, has a positive effect on the round trip time (RTT). However too a dense network leads to more collisions.
Increasing the number of hops needed, making the network more sparse, has a negative effect on the RTT.
“It is clear that there are a lot of factors inﬂuencing the communication ﬂows within a Bluetooth Mesh network, requiring more advanced management mechanism for optimizing the performance of the mesh network.”
However, the research had some limitations. Noise was simulated by introducing non-mesh beacons advertising every 20ms. This wasn’t very realistic given that most beacons advertise in the range 100ms to 1000ms. Re-transmit time was considered that complicated calculations – especially as re-transmit is application specific. It wasn’t mentioned that in many mesh sensing applications, unacknowledged messages are acceptable such that there’s no re-transmit. Also, the affect of other mesh network traffic, on the round trip time, wasn’t considered – only one mesh transmission at a time was considered.
The Wiki includes information about Bluetooth LE idioms such as advertising, MAC address, Bluetooth name, GATT, transmit power, measured power, range, RSSI, mesh and the new direction finding feature. It also has links to hardware and programming information.
It’s a traffic monitoring system that receives signals from Bluetooth-enabled equipment such as cellphones and in-car hands-free devices, building a real-time picture of motorists’ routes and travel times.
This is a simple example of a real time locating system using Bluetooth devices that are already out there as opposed to, more focused, Bluetooth beacons that are specifically being tracked.
Mouser has a free ezine called ‘Methods’ (pdf) that has in-depth articles on the latest advances in Bluetooth.
Steven Hegenderfer, Director of Developer Programs at Bluetooth SIG explains how Bluetooth 5 will enable design engineers to pioneer innovative solutions. Steven Keeping shows how Bluetooth has evolved and Barry Manz explains Bluetooth Mesh Networking and beacons.
If you take a look at the recently announced Bluetooth SIG mesh, it’s described by three specifications with around 1000 pages! It took three years to create. So what’s the rationale that caused it to be so complex?
For some answers, take a look at Szymon Slupik’s personal blog. Szymon is the Chair Mesh Working Group at Bluetooth SIG and his posts give a fascinating insight into the thinking behind the Bluetooth SIG mesh.
There’s a new command line Python-based utility for Linux called Bleah that describes itself as a “BLE scanner for smart devices hacking”. Don’t let the ‘hacking’ part put you off – all it does is scan for devices and enumerate/use Bluetooth GATT Service much like the many apps for iOS and Android like Nordic nRF Connect. Nevertheless, it’s useful should you need to do these things from Linux rather than mobile apps.
If you use this utility (or mobile apps) you need to be aware that most Beacons are not connectable by default and most have password protected Bluetooth Services preventing you writing to them without having written the password to a specific Service. You will need to read the documentation for the beacon to determine how to make it connectable and to ascertain the default password.