Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. BLE demos fail on Android
Forum Updated to NodeBB v4.3 + New Features

BLE demos fail on Android

Scheduled Pinned Locked Moved Mobile and Embedded
androidbluetooth low e
4 Posts 4 Posters 3.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pbljung
    wrote on last edited by
    #1

    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?

    ekkescornerE 1 Reply Last reply
    0
    • C Offline
      C Offline
      csanders
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kgregory
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • P pbljung

          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?

          ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          @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

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.9 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved