BLE Support on a raspberry pi

Next experiment was, well, definitively more advanced and required quit a lot of work and perseverance...

The idea was to create an external service that could do the scanning and report the results to NR via MQTT. I also wanted a solution that would work in later NR versions without any eventual dependency of node.js specific versions

Since there are already libraries for GATT Protocol for Bluetooth LE devices available, I decided to jumpstart with one of them, gattlib for Python

Now the real journey started, it took many hours and googling to figure out and fix all dependencies initially required until I finally had the library installed in a Pi for Python3

The end result is working great, it has been running flawless since yesterday in two separate Pi's. The detection is not better or worse than the other setup but it works also fine in the latest NR beta

This post is not intended as a full instruction of how to do with all that Python and other dependency stuff required, it is at this stage intended as informative

The Python script running and scanning:


The NR configuration to control & monitor the execution of the script. It allows

  • for automatic restart of the script if it should stop delivering scans
  • manual aborting & restarting
  • filtering of monitored iBeacons (in this case I am just watching one single device)
  • iBeacon enter/leave events sent to my iPhone via Telegram (currently useful for debugging)

1 Like