Brave people - look at and test BLE downloads
Linus Torvalds
torvalds at linux-foundation.org
Sat Jun 24 16:06:00 PDT 2017
So I currently have the BLE GATT downloading working on both my Suunto
EON Steel and the Scubapro G2. This is to see if anybody else wants to
play with the code, but before looking at the code, a few faily big
caveats:
(a) BLE is not fast. Just be warned. You *will* be happier with a USB
cable if you have that option.
(b) divecomputers are odd, and not a lot of people seem to play with
them over bluetooth. At least Suunto seems to consider the BLE to be
mobile-only. On desktop systems, bluetooth seems to be pretty hit and
miss outside of legacy mouse/keyboard/audio things. Odd BLE devices?
Yeah, bugs will happen.
(c) I only work with Linux, and I don't do mobile. End result: right
now the code only works on Linux laptops and desktops with bluetooth.
A regular BT-4.0 USB dongle works fine for me on my desktop, and my
laptop has Intel wireless with BT that also works. So as long as it's
LE-capable (and not all BT dongles are), it probably works.
(d) ...but I found several "features" due to (b), and you'll not only
need a fairly up-to-date Qt installation, you may need to literally
build your own due to Qt bugs (the EON Steel in particular is very
picky, and Qt/Bluez didn't connect to it without patches).
(e) my BLE code is not pretty. It's scary. In fact, it can probably
be used to make small timid pets pee on the floor in fright. You have
been warned.
With those encouraging words, here's the scoop:
If using Qt, use at least 5.9.1, and if you want to play with the EON
Steel, make it work on some non-Bluez platform (which has so far never
been tested - Bluez is what the Linux desktop environments use), and
use the patch from here:
https://codereview.qt-project.org/#/c/198202/
You also need to make sure that you have "device privacy" enabled, at
least in order to pair with the EON Steel. It will not talk to you
unless you have a device identity key ("IRK"). With Bluez (ie Linux
desktop environment), this involves making sure that you have
Privacy = device
in your bluetooth config file (normally /etc/bluetooth/main.conf, and
normally it it set to "off").
Also, make sure that you have the current libdivecomputer
Subsurface-branch, which has the code for the EON Steel and the
Scubapro G2 to know the differences between a USB HID download and a
BLE GATT download.
And if y ou do all that, and if you apply the attached patch to the
current subsurface source base, and if you walk around three times
widdershins around your computer while you build it all, you *may*
just get working BLE GATT downloads.
I'll hopefully look at the Shearwater Perdix AI next. Since BLE is the
*only* way to download from that dive computer, it would be really
nice if I can make this work for that too. We'll see.
Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Very-early-and-likely-quite-broken-BLE-GATT-code.patch
Type: text/x-patch
Size: 11743 bytes
Desc: not available
URL: <http://libdivecomputer.org/pipermail/devel/attachments/20170624/bab16108/attachment.bin>
More information about the devel
mailing list