Bluetooth LE Supported on Zerynth

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.

There’s a new article on Design Bluetooth BLE Applications in Python on ESP32 using Zerynth. The official documentation provides lots of examples.

Latest Nordic Wireless Q Magazine Available

Nordic, the manufacturer of the System on a Chip (SoC) in many beacons, has a latest issue of Wireless Q Magazine. It showcases the many uses of Nordic SoCs.

Read about:

  • The Ruuvi IoT asset tracker
  • Smart rope load sensors
  • Use of SoCs in an insulin monitor device
  • A wearable respiration monitor
  • Bluetooth 5.1 direction finding
  • Tracking shipping containers
  • IoT for farmers
  • Use of SoC for athlete performance wearable
  • Building next generation Bluetooth beacons

IoT Protocols

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 Advertising Channels

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:

Frequency Channels from RF Wireless-World

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:

Power use over time

Read about Choosing an Advertising Interval

Bluetooth Mesh Standard Evaluation

There’s recent new research on The Bluetooth Mesh Standard: An Overview and Experimental Evaluation (pdf) by Mathias Baert, Jen Rossey, Adnan Shahid ID and Jeroen Hoebeke of Ghent University.

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 influencing the communication flows 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.

Read about Beacons and the Bluetooth Mesh

Read about SensorMesh™

Traffic Monitoring Using Bluetooth

There’s a recent story at LA Times on how Newport Beach will monitor drivers’ Bluetooth data to analyze traffic, congestion.

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 ezine – Understanding Bluetooth 5 and Mesh

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.

Read more about Bluetooth mesh on our web site.

Bluetooth SIG Mesh Rationale

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.

Start with the post on Bluetooth Mesh – The Launch and then read about The Packet, Depth, Flexibility and Scalability.

You can also follow Szymon on Twitter.

Read more about Bluetooth mesh on our web site.

Bleah Linux Bluetooth Utility

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.