Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-117009

Unstable Qt6.2/Qt6.5 BLE connection under macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 6.2.1, 6.5.2
    • None
    • PySide6.2.1, Pycharm IDE
    • macOS

    Description

      I observe the following issues while evaluating the BLE connectivity subsystem of Qt6 (through PySide6) on MacOS:

      • The BLE discovery procedure reports two instances of my BLE device: One with zero mac address i.e. 00:00:00:00:00:00 and another one with valid/non-zero mac address; Which is unexpected. i.e. On Windows; The same code can discover only one instance of this BLE device.
      • Trying to connect to the non-zero mac address; I was not able to establish the connection.
      • I tried to upgrade PySide6.2.1 to PySide6.5.2 but without any luck (i.e. same issues encountered again).
      • In order to understand these issues- the following experiments were performed:
      • A very basic swift-based code was written on MacOS to scan and connect to BLE devices and the code was very stable. So I started to have preliminary conclusions that it might be a Qt6 issue.
      • Bleak library has also been evaluated (python-based library of BLE connectivity). and noticed that it is quite stable compared to PySide6/Qt6 in this regard.
      • It seems that the common factor between the swift code and Bleak-based code is that they both use CoreBluetooth; while Qt6 utilizes IOBluetooth.

      Here is what I see when I try to connect to my bLE device ("LE-SIMULATOR")?

      2023-09-12 22:10:47.623 Python[47148:2960237] -[IOBluetoothDeviceInquiry initWithDelegate:] -  0x600000881200
      New Bluetooth low energy device was discovered: LE-SIMULATOR
      qt.bluetooth.darwin: IOKit error code:  1
      qt.bluetooth.darwin: IOKit error code:  1
      qt.bluetooth.darwin: IOKit error code:  1
      qt.bluetooth.darwin: IOKit error code:  1
      
      qt.bluetooth.darwin: Manually interrupting IOBluetoothDeviceInquiry
      New Bluetooth low energy device was discovered:
      New Bluetooth low energy device was discovered:
      New Bluetooth low energy device was discovered: Mi Smart Band 6
      New Bluetooth low energy device was discovered: LE-SIMULATOR
      
      New BLE device was found: LE-SIMULATOR 28:C6:3F:A3:E2:41
      New BLE device was found:  00:00:00:00:00:00
      New BLE device was found:  00:00:00:00:00:00
      New BLE device was found: Mi Smart Band 6 00:00:00:00:00:00
      New BLE device was found: LE-SIMULATOR 00:00:00:00:00:00
      
      
      User wants to connect to device: 28:C6:3F:A3:E2:41
      An error has occurred while trying to connect to BLE device. Error is : PySide6.QtBluetooth.QLowEnergyController.Error.UnknownRemoteDeviceError
      
      
      User wants to connect to device: 00:00:00:00:00:00
      QLowEnergyController.ControllerState changed. new state is PySide6.QtBluetooth.QLowEnergyController.ControllerState.ConnectingState
      User wants to connect to device: 00:00:00:00:00:00
      QLowEnergyController.ControllerState changed. new state is PySide6.QtBluetooth.QLowEnergyController.ControllerState.ClosingState
      QLowEnergyController.ControllerState changed. new state is PySide6.QtBluetooth.QLowEnergyController.ControllerState.UnconnectedState
      QLowEnergyController.ControllerState changed. new state is PySide6.QtBluetooth.QLowEnergyController.ControllerState.ConnectingState
      SDK disconnected from "00:00:00:00:00:00"
      
      2023-09-12 22:11:53.139 Python[47148:2960237] -[IOBluetoothDeviceInquiry dealloc] -  0x0
      
      Process finished with exit code 0 

      Do these issues imply that BLE support on macOS is broken?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tpochep Timur Pocheptsov
              rida-shamasneh Rida Shamasneh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes