QBluetooth not detecting local device, Qt 5.7 Alpha, Ubuntu 15.10, BlueZ 5.35
I'm trying to develop a read/write wrapper for a custom Bluetooth Low Energy peripheral using Qt 5.7 Alpha. I built the alpha on my local machine and my current project compiles fine, but when it seems that QBluetooth can't find my local device.
When I try to run:
peripheralController = QLowEnergyController::createPeripheral(btDevice); qDebug() << peripheralController->localAddress();
the string that's returned is "00:00:00:00:00:00"
However, if I run hciconfig in terminal, I get the following output:
hci0: Type: BR/EDR Bus: USB BD Address: 5C:F3:70:72:5B:C6 ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:712 acl:0 sco:0 events:50 errors:0 TX bytes:2507 acl:0 sco:0 commands:50 errors:0
It seems that maybe this is a problem I've encountered because I had to build Qt from source, seeing as it's the Alpha release. However I need to use this release because I need the peripheral support.
I've seen it requested elsewhere that the output of the command
dbus-send --system --dest=org.bluez --print-reply / org.freedesktop.DBus.ObjectManager.GetManagedObjects
might be helpful, so here's a pastebin of that.
Even if I call
btDevice = new QBluetoothLocalDevice(QBluetoothAddress(QStringLiteral("5C:F3:70:72:5B:C6")), this); qDebug() << btDevice->localAddress();
I still get a null address instead of the expected 5C:F3:70:72:5B:C6.
I appreciate any help you can give me. This project is due in a few days and right now this is a major snag.
I hope bumping isn't frowned upon on this forum. I really need help with this.
I tried installing Qt 5.6 from a binary to see if the functionality works there, and it does. So either it has to do with building Qt 5.7 from source, or it's something that changed between 5.6 and 5.7. Unfortunately I can't just use 5.6 as it doesn't have the Peripheral mode functionality that I need for this project.
I'm guessing the problem lies somewhere with QDBus as it doesn't seem to be properly reading the DBus managed devices. I'm looking through the source code to see what's different but so far I've not had any luck.
So it's definitely something that changed between 5.6 and the 5.7 alpha. Building 5.6 from source and installing it via the binary both work fine...
Hi and welcome to devnet,
Nothing wrong with bumping unless you do it too early ;)
You should check the bug report system to see if it's something known. If not please open a new report providing a minimal compilable example that reproduces the behavior. Don't forget to also give details about your current setup (distribution, dependencies version etc)
I didn't find a bug that matched my issue, so I filed a report here.
Please let me know if there are any more details I need to add.
Seems pretty complete.
The only thing I see is that you should rather provide a zip file including a .pro file to build your code. That gives less job to people trying to fix the bug to reproduce it.