All Projects → ThomasGerstenberg → blatann

ThomasGerstenberg / blatann

Licence: BSD-3-Clause license
Python BLE library for the Nordic nRF52 connectivity firmware

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to blatann

IOS-DFU-Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 400 (+809.09%)
Mutual labels:  ble, bluetooth-low-energy, nrf52
py-bluetooth-utils
Python module containing bluetooth utility functions, in particular for easy BLE scanning and advertising
Stars: ✭ 60 (+36.36%)
Mutual labels:  ble, bluetooth-low-energy
H.E.L.P.
Home Environment Locating People 🍍
Stars: ✭ 19 (-56.82%)
Mutual labels:  ble, bluetooth-low-energy
BLE SDK6 examples
Examples for the Dialog Smartbond Bluetooth low energy families based on the SDK6
Stars: ✭ 38 (-13.64%)
Mutual labels:  ble, bluetooth-low-energy
Fruitymesh
FruityMesh - The first completely connection-based open source mesh on top of Bluetooth Low Energy (4.1/5.0 or higher)
Stars: ✭ 229 (+420.45%)
Mutual labels:  ble, bluetooth-low-energy
Bluetooth
Cross-platform Bluetooth API for Go and TinyGo.
Stars: ✭ 246 (+459.09%)
Mutual labels:  ble, bluetooth-low-energy
ble
Bluetooth Low Energy for Linux / macOS
Stars: ✭ 264 (+500%)
Mutual labels:  ble, bluetooth-low-energy
Reactivebeacons
Android library scanning BLE beacons nearby with RxJava
Stars: ✭ 171 (+288.64%)
Mutual labels:  ble, bluetooth-low-energy
IOS-Nordic-Thingy
iOS Library and example application for Thingy:52™
Stars: ✭ 60 (+36.36%)
Mutual labels:  ble, nrf52
SmartSpin2k
Transform your spin bike into a Smart Trainer!
Stars: ✭ 88 (+100%)
Mutual labels:  ble, bluetooth-low-energy
theheraldproject.github.io
Herald - Proximity Detection Protocol and research documentation, including the Fair Efficacy Formula
Stars: ✭ 17 (-61.36%)
Mutual labels:  ble, bluetooth-low-energy
Rxble
使用 RxJava 封装的低功耗蓝牙类库
Stars: ✭ 203 (+361.36%)
Mutual labels:  ble, bluetooth-low-energy
Blessed Android
BLESSED, a Bluetooth Low Energy (BLE) library for Android
Stars: ✭ 195 (+343.18%)
Mutual labels:  ble, bluetooth-low-energy
bluetooth-terminal
ES6 class for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 43 (-2.27%)
Mutual labels:  ble, bluetooth-low-energy
Continuity
Apple Continuity Protocol Reverse Engineering and Dissector
Stars: ✭ 180 (+309.09%)
Mutual labels:  ble, bluetooth-low-energy
STBlueMS Android
"ST BLE Sensor" Android application source code.
Stars: ✭ 93 (+111.36%)
Mutual labels:  ble, bluetooth-low-energy
BLELib
This library contains many of the features you need to interact with BLE peripherals
Stars: ✭ 21 (-52.27%)
Mutual labels:  ble, bluetooth-low-energy
Node Ble
Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
Stars: ✭ 159 (+261.36%)
Mutual labels:  ble, bluetooth-low-energy
H Ble
Android Ble类库,基于回调,暴露搜索、连接、发送、接收、断开连接等接口,无需关心细节操作即可进行Ble通信。
Stars: ✭ 171 (+288.64%)
Mutual labels:  ble, bluetooth-low-energy
daydream-node
Quick Node.js module to connect to the Daydream controller and receive all the data
Stars: ✭ 17 (-61.36%)
Mutual labels:  ble, bluetooth-low-energy

Blatann

blåtann: Norwegian word for "blue tooth"

The goal of this library is to provide a high-level, object-oriented interface for performing bluetooth operations using the Nordic nRF52 through Nordic's pc-ble-driver-py library and the associated Connectivity firmware.

Documentation is available on ReadTheDocs

NOTE

As of v0.3.0, the public-facing API is stable. There is not likely to be any major changes in method/property naming or functionality and all features added will aim to maintain backwards compatibility.

Install

pip install blatann

Using with macOS brew python

pc-ble-driver-py consists of a shared object which is linked to mac's system python. In order to use it with brew's python install, you'll need to run install_name_tool to modify the .so to point to brew python instead of system python.

Note: This is the case with any custom-installed python on mac (like anaconda), brew is the most popular and what has been tested

An example shell script to do so can be found here

Supported Devices/Software

This library has been tested using both the nRF52 Dev Kits, the nRF52840 USB Dongle and the ABSniffer 528 flashed with Connectivity Firmware

Supported Versions:

Blatann Version Python Version SoftDevice Version pc-ble-driver-py Version Supported Devices
v0.2.x 2.7 Only v3 <=0.11.4 nRF52832 Dev Kit
ABSniffer BLE Dongle
nRF52840 Dev Kit/Dongle (using S132 connectivity image)*
v0.3+ 3.7+ v5 >=0.12.0 Same as above

* I have not personally tested the nRF52840 compatibility for v0.2.x, only heard second-hand accounts of it working. v0.3+ has been tested with the nRF52840 USB Dongle

When using the nRF52840, it should be flashed using the S132/SoftDevice v5 connectivity images. Both hex files and DFU packages are distributed by default with v4.1.1 of pc-ble-driver and is also bundled with pc-ble-driver-py install, allowing the Dev Kit and USB Dongle to be flashed. The devices can be updated using nRF Connect Desktop App

Roadmap/Supported BLE Features

Below lists the supported BLE features and ones that are on the roadmap to implement (eventually)

  • Documentation (majority covered, still needs some updates)
    • ReadTheDocs integration
    • Better type hinting
  • GAP
    • BLE Enable parameters
    • BLE Connection parameters (functional, needs some work)
    • Advertising
    • Data Length Extensions
    • PHY selection
      • Coded PHY not supported, only 1 and 2 Mbps PHYs
    • Scanning
    • Documentation
    • RSSI
    • Transmit Power
    • Advertising channel selection
  • SMP
    • Encryption/Authentication process
    • MITM/Passcode pairing support
    • Store bonding info
      • Currently uses pickle which is not secure
    • Identity resolve
    • Bonding as Peripheral
    • Bonding as Central
    • LESC pairing
    • Documentation
  • GATT
    • Configurable MTU
    • Generic Access service configuration
    • Service Changed characteristic
  • GATT Server
    • Characteristic Reads
    • Characteristic Writes
    • Notifications/Indications
    • Long reads/writes
    • Characteristic User Description/Presentation format
    • CCCD Caching
    • Custom Read/Write authorization (#10)
    • Documentation
  • GATT Client
    • Database Discovery procedure
    • Client reads
    • Client writes
    • Client long writes
    • Notifications/Indications
    • CCCD Caching
    • Service Discovery Caching (#89)
    • Documentation
  • Examples
    • Advertiser/Broadcaster
    • Scanner/Observer
    • Central, Procedural
    • Central, Event Driven
    • Central, Multiple Connections (#77)
    • Peripheral
    • Multi-role
    • Passcode Pairing
    • LESC Numeric Comparison Pairing (glucose peripheral, no central example)
    • Bonding (glucose peripheral, no central example)
  • Bluetooth Services
    • Device Info Service
    • Battery Service
    • Current Time Service
      • Peripheral
      • Central (Partially implemented)
    • Glucose Service
      • Peripheral
      • Central
    • Nordic UART Service
    • More TBD (or on request)
  • License
  • Unit Tests
  • Integration Tests (partial -- below are implemented)
    • Advertising
    • Scanning
    • GATT Writes/Reads
    • GATT throughput testing/benchmarks
    • Pairing/Bonding

The library aims to support both event-driven and procedural program styles. It takes similar paradigms from C#/.NET's event function signatures, where event handlers are passed object sender, EventArgs e parameters. Additionally, all asynchronous function calls return a Waitable object which can be waited on (with timeout) until the event associated with the function call returns.

Examples

There are several example scripts which showcase different functionality of the library under blatann/examples. Examples can be run using python -m blatann.examples [example_filename] [device_comport].

Example usage: python -m blatann.examples scanner COM3

Running Tests

The integrated tests can be ran using the builtin unittest runner and depends on a few environment variables to find the connected Nordic devices.

At a minimum, two nordic devices are required to run the unit tests. These are specified using environment variables:

  • BLATANN_DEV_1 - Serial port of the first Nordic device
  • BLATANN_DEV_2 - Serial port of the second Nordic device

Optionally a third BLATANN_DEV_3 can be specified to run tests which require more than two devices. If this environment variable is not defined, tests which require 3 devices are skipped.

In order to speed up the tests, BLATANN_TEST_QUICK=1 can be defined to skip long-running tests. Note that test cases which are defined as "long-running" is subjective and relative--the test suite will still take awhile to run, but in general test cases which take longer than 20 seconds are skipped.

The tests can also be ran through the makefile using make run-tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].