Score:0

BlueZ gives 'Missing CAP_NET_ADMIN permission' error

tn flag

I need to identify the source of problem. The error message is:

qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.
qt.bluetooth.bluez: SDP scan failure QProcess::NormalExit 3

My C/C++ code , based on QT , scans for "bluetoooth service " and fails to complete. It just times out as it should when the scan is completed.

Otherwise my code works as expected, hence no OS problem...
This error is posted by "bluez" - so why not look there first? 
I was hoping somebody knows the answer...

I'll czech bluez.  

vidarlo avatar
om flag
Please add more relevant information, such as the version of Ubuntu you're using, and what you're attempting to do when the error message occurs to the question. Press [Edit] to update t to add details.
cocomac avatar
cn flag
Yes, Bluez is on-topic here, assuming you are using Ubuntu or an official derivative, like Kubuntu. But that one line error isn't enough to identify or fix the issue. Please [edit] your question to include what caused this error, and what OS you have.
Nmath avatar
ng flag
Questions about Ask Ubuntu belong on https://meta.askubuntu.com/ If you have a question about Ubuntu, post on the main site and include clear reproducible details about the problem you are experiencing. Add context, explaining what you are trying to do and all of the steps required to reproduce the problem.
mchid avatar
bo flag
Questions about Bluez are on topic here but questions about asking questions about Bluez are off topic.
Score:0
tn flag

Here is partial explanation why is this happening.

https://unix.stackexchange.com/questions/96106/bluetooth-le-scan-as-non-root

Here my take on it : The actual bluetooth call hierarchy appears to be:

QT implementation (library ) of Bluetooth called "Bluetooth (module ).
Note that this module is NOT same in every QT version and it is actually missing in some.

The QT module "library" is QT copy / modification of "bluez".

"bluez" is based on "hci".

Note - I have used "hci" directly, bypassing "bluez" and have not found any issues using it direct. Actually QT implementation is missing physically reset the "Bluetooth devices found with last successful call for them ". So I use "hci" to reset the unknown database of Bluetooth devices found last time.

Now there are QT C/C++ examples btscanner example works as expected - returns nearby devices and its "service" btchat basically does same , but fails with the above error.

Both of these example implements only three SIGNALS start found device finished

**there are NO "found device " SIGNALS ** in btchat, there are there in btscanner !!

Therefore the "problem " is with btchat implementation of "bluez" and btchat uses DIFFERENT QT functions - adds ANOTHER layer to call / use "bluez"...

Since the usage of QT functions is in real time it is a challenge to find the sequence of the calls and where it gets stuck.

tn flag
In case there is a remote possibility to resolve this. Here is my latest (2023 / Dec 5) attempt to use Qt btchat example - straight from the CURRET git version, 10:58:36: Starting /media/nov25-1/MDI/Qt-5.15.2/widgets/mainwindows/mdi/mdi... Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type. qt.bluetooth.bluez: SDP scan failure QProcess::NormalExit 3
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.