BLE demos fail on Android



  • Hi - The two Bluetooth Low Energy demos heartlistener and lowenergyscanner run fine on ios7 and ios8, but both FAIL on Android 4.4

    They scan for devices, I select iOS running the lightblue app emulating HR, and then Android fail to connect with GATT_ERROR (133)

    D/BluetoothGatt(26782): onClientConnectionState() - status=133 clientIf=7 device=5F:12:69:E3:10:C3
    W/QtBluetoothGatt(26782): Unhandled error code on connectionStateChanged: 133
    W/liblowenergyscanner.so(26782): ../src/device.cpp:283 (void Device::errorReceived(QLowEnergyController::Error)): Error: "Unknown Error"
    

    Any ideas on how to proceed?



  • I see the same "Unhandled error code on connectionStateChanged: 133" message on my own program using qt's ble. Any idea on what causes this yet? I typically find if I reset the ble device and turn on and off bluetooth on the android device it will start working.



  • I was getting this too. The way I finally fixed it was to re-boot my phone. Anyone know what causes this problem?


  • Qt Champions 2016

    @pbljung said in BLE demos fail on Android:

    errorReceived

    these errors can happen
    see my comments on top of

    void MyBluetoothDeviceInfo::onControllerError(QLowEnergyController::Error error)
    

    in https://github.com/ekke/ekkesBTLEexample/blob/master/cpp/bt/mybluetoothdeviceinfo.cpp

    not only 133 (reported as unhandled error)
    also 34 and 8 can happen
    see also all the discussions at https://bugreports.qt.io/browse/QTBUG-31674
    per ex from my comment on 133:

    while developing new example app for BT LE and Qt 5.8 using QtQuickControls2 for Android, iOS I also run into GATT ERROR 133
    googled and found out that this bug iseems not to be a Qt Bug.
    some more infos here:
    https://github.com/NordicSemiconductor/Android-nRF-Toolbox/issues/9
    https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-5.1.1_r13/stack/include/gatt_api.h
    of course would be great if Qt could handle error 133
    
    my workaround:
    if getting a QLowEnergyController::ConnectionError I try to reconnect up to 5 times with a delay of 1000ms
    In most cases 2nd or 3rd retry will connect without the error.
    

    BTW: find out more on my new BTLE Example APP: http://bit.ly/ekkeBTLEapp


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.