We have moved to a new Sailfish OS Forum. Please start new discussions there.
162

Proper Bluetooth LE support

asked 2014-01-02 12:45:18 +0200

onion gravatar image

updated 2017-09-13 00:26:58 +0200

The device have Bluetooth 4.0 support and that include LE, but the current APIs provided are old and does not properly support LE. Bluez needs to be updated to 5.x and proper BTLE Qt APIs should be added.

Edit by c.la 20150413: I just noticed in Harbour the app Parrot ZIK 2.0 Manager that includes a backport of QtBluetooth 5.4. Can't this be included in jolla update?

EDIT 2015-12-15 by c.la: this topic will be discussed on Dec, 17th Jolla Community meeting. If you plan to attend please edit the post and add your name in the list of substitutes in case I can't show up (50% chance atm)

EDIT 2017-09-12 by martonmiklos: After the release of the Jämsänjoki the Bluez5 supported devices has all the things needed for creating applications with BLE connectivity (Qt libraries). However the harbour RPM validator still reject these apps due the libQt5Bluetooth.so.5 usage. I would say the BLE support could be said to proper once the official apps could utilize that.

edit retag flag offensive close delete

Comments

4

The problems I see is that not even Bluez 5.x currently has a BLE API.

There seems to be more interest in getting it to work under Android than on GNU. In fact, at this rate, Bluez's Android BT API facsimile will be complete even before the real Bluez D-Bus API :/

javispedro ( 2014-01-05 22:48:43 +0200 )edit

Another problem with Bluez 5.x, is that it doesn't currently support handsfree profiles. Which I noticed the hard way in Fedora 20.

dazo ( 2014-03-04 22:57:28 +0200 )edit
7

Any idea what it would take to add Bluetooth LE support for the apps running in Dalvik?

Nicolas ( 2014-06-13 14:32:20 +0200 )edit

So are we any closer to BluetoothLE support? I'm eyeing up doing something with beacons and motion sensors like the PebbleBee (https://www.kickstarter.com/projects/192833321/pebblebee-the-most-versatile-ios-android-bluetooth) or other similar tags for objects.

In my case I want to do something that alerts my phone if an object is moved eg. someone nicking my bike or laptop while I'm not watching it.

aegis ( 2014-08-07 22:59:49 +0200 )edit

I got a pair of PowerUp 3.0 BTLE modules for remote controlled paper planes. Would love to get them working on a Jolla

Henque19 ( 2014-08-07 23:26:35 +0200 )edit

8 Answers

Sort by » oldest newest most voted
29

answered 2016-08-05 12:15:34 +0200

r0kk3rz gravatar image

updated 2019-03-27 01:41:00 +0200

Work is being done on moving to Bluez5 with an aim of having BLE enabled.

@veskuh Responded to a question about this in a #mer-meeting.

Bluez5 is not ready yet for next update, but 2.0.5 or 2.0.6 are likely candidates

EDIT (27/03/19): Ok so to update this issue, we've had Bluez5 support for a while now but as always things aren't always that simple. BLE support was a fairly recent addition to the Linux Kernel and most Sailfish Devices have a very old kernel indeed! so proper support isn't there.

However on newer devices like the Sony Xperia XA2 it should work, but I haven't heard of anyone investigating this just yet

edit flag offensive delete publish link more

Comments

2

Sweet, that's great news!

nick75 ( 2016-08-05 12:16:49 +0200 )edit

Yeah finally, can't wait for it!

jdrescher2006 ( 2016-09-30 09:45:21 +0200 )edit

For the sake of completeness:

This is the link to the above mentioned mer-meeting: http://merproject.org/meetings/mer-meeting/2016/mer-meeting.2016-08-05-09.00.html

And the following mer-meeting contains some new information regarding Bluetooth LE support and implementation: http://merproject.org/meetings/mer-meeting/2016/mer-meeting.2016-12-05-09.00.html

Alex ( 2016-12-27 23:26:59 +0200 )edit
1

Sorry if I am nagging on this, but this is close to two years old. (Topic in itself more than 4 years). Still there is no BLE in the sailfishX. We are also well passed the likely candidates mentioned.

Is development on this stopped?

ebjordal ( 2018-05-03 10:04:59 +0200 )edit

@ebjordal, it seems that this will be available with Sailfish 3. Let's hope that this is the case :)

cquence ( 2018-09-06 15:41:25 +0200 )edit
25

answered 2014-01-05 23:20:16 +0200

javispedro gravatar image

updated 2014-07-31 18:26:06 +0200

One option is to "roll your own BLE API". This is what most Bluez BLE users do these days (e.g. NoBle, ble-sensor-pi). I was about doing that in Gato for my smartwatch experiments.

A benefit of this solution is that it works with Bluez 4 and 5 on both PC, the N9 and the Jolla device. You can probably statically link the library and thus even pass Harbour requirements. However, there are several disadvantages:

  • Scanning for BLE devices requires root (CAP_NET_RAW). There might be some way to workaround this using bluez's StartDiscovery but from my tests it does not seem realiable. If multiple programs start scanning collisions will occur (and for certain use cases such as iBeacons it is interesting to keep passively scanning for looong times). Also, https://together.jolla.com/question/9309/bug-bluetooth-le-scan-kills-wlan-connection/ .
  • Acting as a peripheral is impossible unless you "take over" Bluetooth. Since there's no arbitration collisions here are also a given. The first program that "wins" is responsible for handling all services.
  • For similar reasons advertising is not possible.
  • Pairing is possible, but hard, and not user-friendly. However not many BLE devices require pairing (e.g. certainly most smartwatches or fitness monitors do not).

While the above cons are probably dealkillers, one has to consider that the current Qt5.3 Bluetooth API seems to be walking the same path, except that they call a separate program (gatttool) for GATT instead of reimplementing the protocol in the library. Qt5.4 Bluetooth actually uses its own implementation derived from Gato. But there is no arbitration at all, so it's subject to the same problems as above.

edit flag offensive delete publish link more

Comments

Lets go with this for now until bluez sorts itself out.

onion ( 2014-03-13 11:48:51 +0200 )edit

According to this: "Support for Bluetooth LE adapters was not introduced until kernel 3.5; BlueZ 5.0 supports Bluetooth LE functionality only for this and subsequent kernels." As Jolla seeminly runs kernel 3.4.0 (timestamped this year, however) this could mean no BLE support for Jolla until kernel upgrade...which could prove over complicated for this only. Perhaps with some backport magick..? Oh, and I'm looking forward to use my FitBit Felx, so... ;-)

Direc ( 2014-03-21 19:22:27 +0200 )edit
1

we are creaping closer ... kernel 3.4.87

egnat69 ( 2014-06-10 17:18:46 +0200 )edit

@javispedro - just out of curiosity: i saw a youtube video of your jolla communicating with a BLE stylus, done with gato ... how experimental is that and can it be used with other devices? i have a mio alpha that tracks heart rate and sends it over BLE so i'd love to toy around with it a bit...

egnat69 ( 2014-06-12 12:32:28 +0200 )edit
1

@egnat69 feel free to "try", you can find some packages in http://depot.javispedro.com/jolla/ble/ , but I've not written documentation yet. You can refer to some of the small test-* programs I've written in https://gitorious.org/gato/ . Also Apple's CoreBluetooth documentation, since Gato's API is similar to it.

javispedro ( 2014-06-12 13:27:26 +0200 )edit
20

answered 2016-10-23 09:05:50 +0200

Sage gravatar image

We are currently working on Bluez 5 and we are currently merging the changes to our development branch. We are aiming to do release that contains Bluez 5 stack in next couple of months, however with this first release the Bluez 5 stack will not be enabled on any devices yet, but the target is to get first devices with Bluez5 enabled one release after the release with bluez 5 stack. This also should make it easier for community to help on testing some of the changes on their device ports and also contribute on the Bluez 5 based stack.

edit flag offensive delete publish link more

Comments

1

Will that also include an updated version of QtBluetooth for apps? Anyway, looking forward to it.

ArmsOfSorrow ( 2016-10-23 18:44:19 +0200 )edit
1

Will Android apps work too with this Bluez 5 stack?

thisisme ( 2016-11-28 10:10:09 +0200 )edit
1

@Sage: how is the status of this? When can we expect Bluez5 to be enabled?

jdrescher2006 ( 2017-02-01 08:25:45 +0200 )edit
5

answered 2019-04-07 15:24:12 +0200

arisel gravatar image

updated 2019-04-07 18:20:37 +0200

Just played around a bit to check the current status:

(tried as root, after installing bluez5-tools, target was a BLE-Midi device)

  • Gemini (3.0.1.13):
    • devices are found with: hcitool -i hci0 lescan
    • interaction works fine with: gatttool -i hci0 -b yourdevice-uuid_here -I
  • Jolla C (3.0.2.8)
    • devices are found with: hcitool -i hci0 lescan
    • interaction works fine with: gatttool -i hci0 -b yourdevice-uuid_here -I
  • Jolla 1 (3.0.2.8)
    • couldn't install bluez5-tools due to broken dependencies.

However.. in theory that looks like writing some BLE-speaking daemon should be possible.

edit flag offensive delete publish link more

Comments

thank you for these tests. Will these improvements help with the stability of headsets and car BT connections ?

Maximilian1st ( 2019-04-07 19:26:50 +0200 )edit

I'm not so sure if those devices also rely on BLE these days. So what I tested might not be relevant to you at all. However, there have been some bluetooth-related changes mentioned in the 3.0.2 changelog which already might be enhancing the connections you are mentioning.

arisel ( 2019-04-07 20:57:36 +0200 )edit

Jolla 1 cant use Bluez5, and is still on bluez 4

r0kk3rz ( 2019-04-08 02:16:13 +0200 )edit
4

answered 2014-07-31 18:20:36 +0200

javispedro gravatar image

updated 2014-07-31 18:20:54 +0200

Another approach is to move to Bluez 5. Upstream Bluez 5 still has no _client_ GATT API (so you can't query peripherals from the phone), but it does have a server API (seemingly).

Because Google is in the same problem as Jolla is (they want a BLE API for ChromeOS but upstream Bluez is currently lagging), they have published a set of patches implementing a Client GATT API on top of Bluez 5.19 .

I think those patches are an alternative option to gain "cleaner" BLE support. However they would require migrating all of Sailfish to Bluez5.

edit flag offensive delete publish link more

Comments

GATT client API is comming upstream at the moment. See http://marc.info/?l=linux-bluetooth&m=140856575224560&w=2

harry ( 2014-08-22 18:25:08 +0200 )edit

And it comes from Google, so it should be similar to the above API.

javispedro ( 2014-08-26 20:55:42 +0200 )edit
1

Bluez 5.30 now contains a experimental release of the GATT client API.

javispedro ( 2015-05-18 15:18:00 +0200 )edit
3

answered 2014-11-23 11:35:37 +0200

harry gravatar image

Hi, I created a Bluetooth LE request for the upcomming Jolla tablet. Please vote for it. If it happens for the tablet, it is more likely to come to the phone, too.

edit flag offensive delete publish link more
2

answered 2017-07-12 22:19:24 +0200

@Jaymzz Are there any plans to add the QtBluetooth module to the SDK in the upcoming release? Thank you for your response in advance!

edit flag offensive delete publish link more

Comments

Yes, I am also very interested in that. I have two apps waiting for that so they can be realeased in Jolla harbour.

jdrescher2006 ( 2017-07-13 14:14:33 +0200 )edit

@jdrescher2006 Did you built the missing Qt modules, or you have used libgato? Are the source of these apps available publicly?

martonmiklos ( 2017-07-13 15:07:16 +0200 )edit
0

answered 2016-10-23 21:41:57 +0200

mvdm gravatar image

hello i have jolla 1 and jolla c and a xiami band 2 i'm volunteer if someone will make test just ask

;~) mvdm

edit flag offensive delete publish link more

Comments

Have a Pebble 2 now which doesn't connect to Jolla 1 because of missing LE support. So would test, too if a beta would be available.

asys3 ( 2016-11-19 06:29:17 +0200 )edit
Login/Signup to Answer

Question tools

Follow
42 followers

Stats

Asked: 2014-01-02 12:45:18 +0200

Seen: 8,861 times

Last updated: Apr 07 '19