HomeAboutMailing ListList Chatter /0/0

Debugging Bluetooth info

2018-04-10 by: Dan Lyke
From: Dan Lyke 
I've got me this snazzy Asus ZenBook, which I mostly love. I got the
audio volume issue worked out. The BlueTooth mouse even works, but...

My Samson Expedition Escape speaker, and my cheapie direct from China
remote volume control both don't work with Bluetooth.

The former throws some weird protocol error, the latter won't go
through pairing.

I'm using Blueman on Xubuntu, and my impression of that and the whole
Bluetooth stack is that it's kinda where WiFi support on Linux was 20
years ago. Blueman doesn't seem to give me device names, just hardware
addresses, when I search for devices. The whole thing is klunky.

So: If one were going to try to figure out Bluetooth issues on Linux,
where would one go? Are there command-line tools I can be using to see
missing specs?

=============================================================== From: DaWorm ------------------------------------------------------ Some good general troubleshooting tips here . Not sure if they'll help with your exact issues, but should give you some idea of the command line tools you can use that are part of the bluez package. Jeff.

=============================================================== From: Dan Lyke ------------------------------------------------------ On Wed, 11 Apr 2018 08:49:06 -0400 DaWorm wrote: Thanks. That's the kind of stuff I'm interested in. I don't want to have to understand the whole darned stack, but piecing together the command-line tools is probably gonna be necessary. (The worst part is that I've reworked this Qt app to, theoretically, be able to do all the Bluetooth remote control things, if I can just get the system to pair with the device...)

=============================================================== From: DaWorm ------------------------------------------------------ Which libs are you using? I'm working on some proof of concept type code, just raw command line stuff, direct to dbus, although apparently glib and gdbus are more appropriate. I don't have any experience with glib though and haven't been able to wrap my head around it. I also am stuck with plain C, since I couldn't program hello world in python or anything like it, and most of the good demos are not in plain C. If you're on QT, I'd guess glib isn't what you'd be using, though, as that's rooted in the GTK world. Supposedly, you should be able to do all of the scanning and pairing directly from your app, not worrying about what blueman or any other bluetooth manager is running. That's the route I'm going to go down as soon as I figure out glib. I really need it for the callback functions, because I don't want to continuously poll dbus in my app. The bluez source contains the full code for the command line utility that I should be able to use to base my code on, but it is a kitchen sink app and it's hard for me to back it down to the simple level of just the functions I'm looking at, which is limited to BLE scan, pair, connect, and communicate. I don't need audio, networking, standard BT, or any of that, so it is taking me quite a while to move forward on it. Plus my normal job only gives me a few hours a week to look at it. And if you understood what I'm talking about, a) you probably already know more about it than I do, and b) I'm sorry. Jeff.

=============================================================== From: Dan Lyke ------------------------------------------------------ On Wed, 11 Apr 2018 11:46:07 -0400 DaWorm wrote: Just changing a bunch of misuse of a global event filter and abuse of QKeySequence with QShortcut and legitimate use of QKeySequence (this is for http://squaredesk.net/ ) Qt seems to send most of the Bluetooth HID commands as QKeySequence mappable events, but we'd been abusing QKeySequence by using individual components for multiple hotkeys to the same option (eg: if you wanted "+" and "a" to be "Increase Volume" you'd click on the QKeySequence input, hit "+" and "a", but because we were using a global event filter we treated those as separate keys rather than a hotkey sequence). This broke the Bluetooth HID: People could set the action to the multi-character "Volume Up" command that came from the remote, but we broke it down into things we couldn't decipher. (If you're really interested in playing with a very niche music player written in Qt and C++, I'll happily walk you through the details of compiling it on Linux, the Github branch is "hotkeys" at https://github.com/mpogue2/SquareDesk/ the particular issue is https://github.com/mpogue2/SquareDesk/issues/246 ) Yeah, Qt is abstracting the Bluetooth into higher level events. Not yet, but I can feel it coming... Dan