I am trying for almost a week to communicate from Linux Ubuntu 18.04 using BLE and always get errors. The Java Android code works well from an Android device, and the PC running Ubuntu can connect to other BLE devices. Is there an example of a bluez C++ code or other language that actually work? on Ubuntu? I tried all the tools, libraries, python, C, C++. I can discover the device. I can't connect to the device and can't get the device services.
Some of the errors that I get:
Device connected error: GDBus.Error:org.bluez.Error.Failed: Software caused connection abort
Fail to connect to the bluetooth device.
gatttool -t random -b BB:A0:50:D2:D7:E5 -I
[BB:A0:50:D2:D7:E5][LE]> connect
Attempting to connect to BB:A0:50:D2:D7:E5
Error: connect error: Connection refused (111)
while the gatttoll command succeeded if I use other devices such as the Tile device.
I also installed an android application from google store: ble scanner, that can connect and discover all services.
Please, advise ASAP.
Thanks,
Alon.