Problem using the btscanner example for Linux ...
Hello ... today I've been trying out the QtBluetooth API on Linux 64bits. The example compiles and runs fine meaning that every Qt dependency has been installed. However, I am not able to see any adapters currently connected to the PC. I'm using a USB bluetooth dongle: Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode). I tried the bluez-test tools to see if it was a problem with the bluez underlying system since I read somewhere that QtBluetooth uses it on Linux. This is what the list-devices binary of the bluez suite has to offer:
[ /org/bluez/hci0 ]
Name = espi-127.bazaar
Powered = 1
Modalias = usb:v1D6Bp0246d0508
DiscoverableTimeout = 180
Alias = espi-127.bazaar
PairableTimeout = 0
Discoverable = 0
Address = 00:15:83:12:18:F2
Discovering = 0
Pairable = 1
Class = 0
UUIDs = 0x1200 0x1800 0x1801 0x110e 0x110c
I tried this code in the DeviceDiscoveryDialog constructor:
this->localDevice->powerOn(); std::cout << this->localDevice->allDevices().size() << std::endl; std::cout << this->localDevice->isValid() << std::endl;
and get 0 and 0, meaning no bluetooth adapters are found and none are valid. Is there any other way to check where the problem might be?
I'm using: Opensuse 13.1 Linux 64-bit
QMake version 3.0
Using Qt version 5.3.1 in /usr/lib ( from online repositories, nothing compiled by hand )
Thanks in advance ...
Do bluetooth devices on your system require a special group or root?
Some systems need the uses added to a bluetooth group to use bt devices without being root.
You could try a simple console application that checks for bt devices on the command line and run that as root and see if it comes up.
The list-devices script in the bluez-test does just that. I ran it being the same user as the one running the Qt app. It seems to be something related with Qt in my opinion, even with hciconfig I see the dongle and with hcitool scan get the other bluetooth devices in the vecinity.
I haven't used the bluetooth stuff in Qt yet so I can't comment on if it's working or not. I just figured I would tell you about some of the linux things that can get people.
If I have some time here in a bit I will run the bt sample app and see if it works on my system and let you know. I'm using gentoo and not opensuse though. Also did you check your logs like /var/log/messages just in case there is something in there, although I doubt it.
I went to test btscanner but it didn't work for me either. It has nothing to do with btscanner though. I noticed my BT usb adapter isn't configured. Last time I redid my linux system I didn't include BT support in the kernel I bet.
I will add support and test again but I can't do it today. I have a release I need to get to QA today so I don't have time to play. :)
As a side note though I use bluedevil and not bluez for bt support. Maybe bluez is causing issues? I doubt it though.