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. BT LE (Android, iOS) pairing/bonding problem
Qt 6.11 is out! See what's new in the release blog

BT LE (Android, iOS) pairing/bonding problem

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 1 Posters 522 Views 1 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.
  • ekkescornerE Offline
    ekkescornerE Offline
    ekkescorner
    Qt Champions 2016
    wrote on last edited by
    #1

    Qt 5.15.7
    did many Qt apps for BT LE (for Barcode Scanners) with custom services / characteristic.
    all works well
    Now a project to control Beds with some motors for slatted frame (Lattoflex)
    This BT LE device must be paired/bonded (just works)
    The device was found from BLE device discovering, the services and characteristics can be discovered.
    at first I’m collecting all needed Services
    then for one of the Services I want to create a Characteristic to read a value from. From Bed-API docs this is the recommended way to get a dialog to pair the device first time and to do the bonding.
    But I’m getting an LE Controller Connection Error and no dialog to pair the device comes up.
    BTW: a QtBluetoothGatt warning was logged: “Looks like the peripheral does NOT act in accordance to Bluetooth 4.x spec” (Only reported on Android, not iOS)
    Found a workaround for Android:
    From Android Device BT Settings: Connected devices, pair new device the BED was found and can be added. Then the app works without any problems, can READ,WRITE, get NOTIFICATION.
    On iOS the BED device is not listed and cannot be paired from BT Settings.
    Tried on many different iOS phones / iPads. Also tried many BT LE Apps from AppStore, tapped on services, characteristics, write values etc to see if there’s an app available to pair/bond the BED. Suddenly I noticed, that on one of my iPhones the BED was listed as one of ‘My Devices’. Tried my app on this iPhone and the app is working. Unfortunately I have no idea what I did to add the BED as device. tried some hours but cannot reproduce on another iPhone.
    So the good news: as soon as the BED is listed as a known device on Android or iOS, my app is working and can control the motors.
    On Android I can live with the workflow to add the BED first time from Android Settings.
    any ideas, what I can do, to initiate the pairing from my Qt app - esp on iOS ?
    anyone knows an iOS app on App Store where I can pair a BLE device ?

    ekke ... Qt Champion 2016 | 2024 ... mobile business apps

    ekkescornerE 1 Reply Last reply
    1
    • ekkescornerE ekkescorner

      got a hint that nRF Connect for Mobile App could be helpful.
      so installed from AppStore on iPhone.
      found the BED BT LE device
      connects and getting all services and characteristics
      as soon as I am trying to read the value from Characteristic I’m getting an error “Encryption is insufficient” and device disconnects.
      does anyone know if nRF App should popup the pairing dialog ? if yes - the problem perhaps is inside the BT LE device and not inside my Qt app ;-)

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

      finally it was a hardware problem of this BED - BLE Dongle. Had to made a hard reset and now the popup to pair the device comes up on Android and iOS devices - so Qt works as expected :)
      BTW: the possibility to make a hard reset of course was not mentioned in the docs.
      now I can confirm that connect/pair with JustWorks Security works well under Qt on Android and iOS

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps

      1 Reply Last reply
      2
      • ekkescornerE ekkescorner

        Qt 5.15.7
        did many Qt apps for BT LE (for Barcode Scanners) with custom services / characteristic.
        all works well
        Now a project to control Beds with some motors for slatted frame (Lattoflex)
        This BT LE device must be paired/bonded (just works)
        The device was found from BLE device discovering, the services and characteristics can be discovered.
        at first I’m collecting all needed Services
        then for one of the Services I want to create a Characteristic to read a value from. From Bed-API docs this is the recommended way to get a dialog to pair the device first time and to do the bonding.
        But I’m getting an LE Controller Connection Error and no dialog to pair the device comes up.
        BTW: a QtBluetoothGatt warning was logged: “Looks like the peripheral does NOT act in accordance to Bluetooth 4.x spec” (Only reported on Android, not iOS)
        Found a workaround for Android:
        From Android Device BT Settings: Connected devices, pair new device the BED was found and can be added. Then the app works without any problems, can READ,WRITE, get NOTIFICATION.
        On iOS the BED device is not listed and cannot be paired from BT Settings.
        Tried on many different iOS phones / iPads. Also tried many BT LE Apps from AppStore, tapped on services, characteristics, write values etc to see if there’s an app available to pair/bond the BED. Suddenly I noticed, that on one of my iPhones the BED was listed as one of ‘My Devices’. Tried my app on this iPhone and the app is working. Unfortunately I have no idea what I did to add the BED as device. tried some hours but cannot reproduce on another iPhone.
        So the good news: as soon as the BED is listed as a known device on Android or iOS, my app is working and can control the motors.
        On Android I can live with the workflow to add the BED first time from Android Settings.
        any ideas, what I can do, to initiate the pairing from my Qt app - esp on iOS ?
        anyone knows an iOS app on App Store where I can pair a BLE device ?

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

        got a hint that nRF Connect for Mobile App could be helpful.
        so installed from AppStore on iPhone.
        found the BED BT LE device
        connects and getting all services and characteristics
        as soon as I am trying to read the value from Characteristic I’m getting an error “Encryption is insufficient” and device disconnects.
        does anyone know if nRF App should popup the pairing dialog ? if yes - the problem perhaps is inside the BT LE device and not inside my Qt app ;-)

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps

        ekkescornerE 1 Reply Last reply
        0
        • ekkescornerE ekkescorner

          got a hint that nRF Connect for Mobile App could be helpful.
          so installed from AppStore on iPhone.
          found the BED BT LE device
          connects and getting all services and characteristics
          as soon as I am trying to read the value from Characteristic I’m getting an error “Encryption is insufficient” and device disconnects.
          does anyone know if nRF App should popup the pairing dialog ? if yes - the problem perhaps is inside the BT LE device and not inside my Qt app ;-)

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

          finally it was a hardware problem of this BED - BLE Dongle. Had to made a hard reset and now the popup to pair the device comes up on Android and iOS devices - so Qt works as expected :)
          BTW: the possibility to make a hard reset of course was not mentioned in the docs.
          now I can confirm that connect/pair with JustWorks Security works well under Qt on Android and iOS

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps

          1 Reply Last reply
          2

          • Login

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