Are there limitations in QT for Bluetooth Low Energy and Coded PHY?
-
Hi,
I am in the process of developing a long range BLE module where the client can use a QT developed piece of software to scan and connect to the device. Previously, we have used the same software to connect to BLE devices without coded PHY enabled, and the software is able to scan, identify, and connect to device.
With this new module, it seems that the QBluetoothDeviceDiscoveryAgent class is unable to find my device with Coded PHY enabled. If I do a scan with my NRF application on my phone I am able to see the device, and if I scan with the generic windows bluetooth scanner, it is also able to locate the device. I have a series of qdebug prints that show identified devices.
I am using a Nordic based bluetooth chip (NINA-B3) and once I set the following AT command:
AT+UBTLECFG=29,4
the device is not found, however setting it to 29,0 allows the device to be located.I have also tested this using the example BLE scanner project in QT on QT5 and QT6 versions which produces the same results.
Does QT have any limitations in regard to long range enabled devices? Or is this a library issue I am having? I built QT 5.15.15 and QT 6.5.3 from source. The module is about 30cm from my PC with an RSSI of -50 when scanned from my phone.
Thanks.
-
I cannot think of any reason that Qt will be directly interacting with the Bluetooth physical layer. I would expect Qt neither knows about nor requires a specific physical layer coding.
Both physical Bluetooth systems need to support BLE and Coded Phy in order to communicate that way. Are you sure of your receiving Bluetooth hardware capabilities?What platform are you operating on?
-
@ChrisW67 said in Are there limitations in QT for Bluetooth Low Energy and Coded PHY?:
Are you sure of your receiving Bluetooth hardware capabilities?
Yes I'm sure. The bluetooth adaptor I have installed in my PC is able to scan and identify the module when configured for CODED PHY. My platform is WIndows 11 with QT 5.14.
I've just compiled QT6.7 and ran the example BLE Scanner project, and it is able to identify the device. You can replicate this if you have a BLE module you can configure and just run the QT5 BLE scanner project, then the QT6 one. So this is clearly QT5 issue, and QT have not documented this anywhere. I am running QT 5.14. Is this fixed in QT 5.15? Or is it a new QT6 function? So the fact that it does work in QT6 means that QT should have some information on the specifications of the integration of their framework and the physical layer of bluetooth.
-
If you are building your own Qt 5 then you should see if the notes about enabling the Win32 API apply to you.
Qt 5.14 adds a native Win32 port supporting Classic Bluetooth on Windows 7 or newer, and Bluetooth LE on Windows 8 or newer. It must be enabled at build time by configuration option -native-win32-bluetooth.
BT LE did have a restriction under the Win32 API that may also at play:
Note: The Received Signal Strength Indicator (RSSI), as well as the Manufacturer Specific Data advertised by Bluetooth LE devices are not supported by the Win32 backend. Also, it is only possible to find devices that have been previously paired through Windows Settings.
Qt 6.2 reintroduced Qt Bluetooth after it was ported from Qt 5. In that process, "Win32 backend was removed. As consequence there is no more QtBluetooth with MinGW." This may have changed the default BT API used and explain a changed behaviour. Cannot say for sure without reading the actual code.