intel-iot-devkit / tinyb

TinyB exposes the BLE GATT API for C++, Java and other languages, using BlueZ over DBus.
MIT License
255 stars 114 forks source link

GDBus Error on new discoveries #176

Open giuseppemr opened 3 years ago

giuseppemr commented 3 years ago

Good morning everyone,

I am actually using tinyb library for Java on a Raspberry Pi 3+ to scan for BLE devices. After a period of time (it can be minutes or hours), new scans make the system blocks in a non recoverable loop with this error:

2020-10-09T08:27:16,310 [Thread-896] ERROR o.e.k.i.b.BluetoothLeAdapterImpl - Stop discovery failed
tinyb.BluetoothException: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.7 was not provided by any .service files
        at tinyb.BluetoothAdapter.stopDiscovery(Native Method)
        at org.eclipse.kura.internal.ble.BluetoothLeAdapterImpl$BluetoothFuture.run(BluetoothLeAdapterImpl.java:266)
        at java.lang.Thread.run(Thread.java:748)

I tried to stop and restart my program, restart the bluetooth service, but the only solution is to completely reboot the system. Any help is really appreciated. Thanks.

tommyNy commented 3 years ago

@giuseppemr check solution with power on/off adapter

giuseppemr commented 3 years ago

@tommyNy thank you for replying. Could you please send me the link of this solution?

tommyNy commented 3 years ago

@giuseppemr check bluetoothctl CLI tool for Linux Maybe Your bluez version is incompatible with tinyb