New Python Library

Most use of Bluetooth LE and beacons only looks at the transmitted advertising containing identification and sensor information. More advanced use requires connection to the device using GATT to write, read and be notified of changes in values (Bluetooth Service Characteristics). The most common use for connecting is to set configurable settings as in the case of device manufacturer smartphone apps.

Some solutions need to manipulate Bluetooth Service Characteristics programmatically. Barry Byford has a new Pyton library BLE-GATT for Linux based devices. It’s based on the BlueZ D-Bus API, features a small number of dependencies and can be easily installed without sudo privileges.

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.

Graphical Bluetooth Analyser for Linux

Sparrow is an open source Graphical Bluetooth and WiFi Analyzer for Linux. It provides a 2.4 GHz and 5 GHz spectrum view, listens for Bluetooth LE advertising and tracks advertisement or iBeacons advertisement sources. It can also be used to advertise iBeacon.

Sparrow is useful for advanced users who need to diagnose more advanced problems related to interference or which part of a system isn’t working.

Bettercap for Debugging Bluetooth LE

There’s a useful tool called bettercap that claims to be the “Swiss Army knife for WiFi, Bluetooth Low Energy, wireless HID hijacking and Ethernet networks reconnaissance and MITM attacks”.

While you might want to use it to test Bluetooth LE security, a more interesting use is for debugging Bluetooth LE. If you are scanning for advertising or creating or using GATT, for example with a beacon, it’s sometimes useful to have a separate way of exercising Bluetooth LE.

Bettercap is written in Go and runs on GNU/Linux, BSD, Android, Apple macOS and the Microsoft Windows. However, a bug in Windows and macOS prevents the Bluetooth commands from working. Hence, it’s for Linux or Android only.

Better caps runs in the browser and you can create scripts.

UPDATE: There’s a tutorial on Medium.

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.