weliem / blessed-bluez

BLE library using Java and Bluez
MIT License
76 stars 21 forks source link

connection failed with status 'DBUS_EXECUTION_EXCEPTION' #9

Closed wangjianxiang closed 2 years ago

wangjianxiang commented 2 years ago

hello , I'm using your blessed BlueZ project. I have some problems. Can you help me? When I run the project, I can't collect scan data normally. Errors are reported as follows: BluetoothPeripheral - Input/output error 10:11:45.923 [Central-queue] ERROR BluetoothPeripheral - connection failed with status 'DBUS_EXECUTION_EXCEPTION' org.freedesktop.dbus.exceptions.DBusExecutionException: Input/output error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.freedesktop.dbus.errors.Error.getException(Error.java:145) at org.freedesktop.dbus.errors.Error.throwException(Error.java:175) at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(RemoteInvocationHandler.java:152) at org.freedesktop.dbus.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:216) at com.sun.proxy.$Proxy22.Connect(Unknown Source) at com.welie.blessed.bluez.BluezDevice.connect(BluezDevice.java:416) at com.welie.blessed.BluetoothPeripheral.connect(BluetoothPeripheral.java:324) at com.welie.blessed.BluetoothCentralManager.lambda$connectPeripheral$11(BluetoothCentralManager.java:896)

weliem commented 2 years ago

Are you able to scan normally with bluetoothctl?

weliem commented 2 years ago

By the way, the exception is caused by the connectPeripheral method. So it looks like scanning is working....right?

wangjianxiang commented 2 years ago

Bluetooth scanning is normal. I don't know why this problem occurs, but I saw an article today about low-power Bluetooth data collection. So I reduced the Bluetooth version on the machine to 5.47, and then I tried to run your project again. Surprisingly, it can run normally and get data.

wangjianxiang commented 2 years ago

So I think it may be caused by the Bluetooth version。You can look at this project: https://github.com/sputnikdev/bluetooth-manager-tinyb

wangjianxiang commented 2 years ago

Thank you very much for your answer