I'm running tests with my home computer running Ubuntu and Python 2.7 in the hopes of having Raspberry Pi 3 advertise using BLE with custom services and characteristics. I've installed Bluez Version 5.42 (using the recommended method) on both devices as well as dbus-python. My computer and Raspberry Pi both are able to advertise using the hci0 lescan 0
command, but I'd like to advertise with the bluez example scripts, example-gatt-client.py and example-advertisement.py found here, as I want to use my own custom characteristics.
Home Computer - Kernel version 4.4.0-31 generic
I'm able to create custom characteristics and advertise by running example-gatt-server.py and example-advertise.py with no issues on my home computer. The one snag I had was I needed to enable Bluez experimental mode by adding --experimental
to the bluetooth.service file located in /lib/systemd/system/bluetooth.service
. Also installing the dbus-python library was a bit of a pain, as I had to build and install it myself for Python2.
The advertise.py script looks for a specific advertising interface called "org.bluez.LEAdvertisingManager1". The gatt-server.py script looks for "org.bluez.GattManager1". I can check if that interface exists by running the following command:
dbus-send --system --dest=org.bluez --print-reply / org.freedesktop.DBus.ObjectManager.GetManagedObjects
These interfaces are found and work fine on my home computer. The scripts run without issue.
Raspberry Pi - Kernel version 4.4.38-v7+
With the same bluez version and the experimental features enabled, I run into this error when trying to run advertise.py:
LEAdvertisingManager1 interface not found.
And when I execute the command "systemctl status bluetooth" it shows the experimental flag is enabled, but I don't see LEAdvertistingManager1 when running.
dbus-send --system --dest=org.bluez --print-reply / org.freedesktop.DBus.ObjectManager.GetManagedObjects
I can however run the gatt-server.py script without issue which means "org.bluez.GattManager1" is found and working properly. What am I missing here?
I've searched this issue, but the only suggestions were to enable experimental features and ensure my kernel is >= 4.1.