Bluetooth LE pairing fail

Bug #1510570 reported by Guilhem Lettron on 2015-10-27
142
This bug affects 24 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Medium
Cyrus Lien
bluez (Ubuntu)
High
Unassigned
Xenial
Undecided
Konrad Zapałowicz

Bug Description

[Impact]

When the Bluetooth adapter is not powered on it is not possible to use
it in normal way. We used to have a hack to force powering on by using
an udev rule but this doe snot work anymore. Luckily the BlueZ has
introduced "AutoEnable" option that makes the stack power on adapters by
itself.

Backporting this to xenial will improve life of the desktop users and
will not require them to hack the solution on their own. The fix itself
uses the well known solution to this problem that is floating around
there for a while.

The upload fixes the bug by enabling the 'AutoEnable' option in the
bluetoothd config file.

[Original Report]

. 15.10 we now have bluez 5 so we can pair BLE devices like the
Microsoft Arc Touch Bluetooth Mouse.

But this pairing doesn't work very well. Mouse is seen but pairing fail.
More information: https://bugzilla.kernel.org/show_bug.cgi?id=104011#c5

This is due to udev rule that use "hcitool" to power on device.
Hopefully, bluez 5.35 has a new parameter "AutoEnable" who can be used
instead of udev rules.

here is a commit with this parameter:
http://bazaar.launchpad.net/~guilhem-fr/bluez/autoenable/revision/138

[Test Case]

On xenial install from ppa: https://launchpad.net/~bluetooth/+archive/ubuntu/bluez

Now reboot the machine. The BT adapter shall be
powered on.

[Regression Potential]

If things go wrong the adapter will not be powered on after the system boots up. Therefore while testing please focus on the adapter state, i.e. powered on or off.

[Other Info]

This fix is included in the development release, see: http://bazaar.launchpad.net/~bluetooth/bluez/ubuntu-zesty/revision/22

[What to upload]

For xenial as in:

) https://launchpad.net/~bluetooth/+archive/ubuntu/bluez
) https://launchpadlibrarian.net/347480725/bluez_5.37-0ubuntu5_5.37-0ubuntu5.2~build1.diff.gz

summary: - BLE pairing failed
+ BLE pairing fail
description: updated

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bluez (Ubuntu):
status: New → Confirmed
Martin Pitt (pitti) wrote :

@Mathieu: Is enabling "AutoEnable" something we want to do and is generally safe?

Guilhem Lettron (guilhem-fr) wrote :

@Martin, changelog from 5.35 is quite explicit:
"
A noteworthy new feature is the ability to configure bluetoothd to automatically enable (power on) all new adapters. One use of this is to replace unreliable “hciconfig hci0 up” commands that some distributions use in their init/udev scripts. The feature can be enabled by having AutoEnable=true under the [Policy] section of /etc/bluetooth/main.conf.
"
http://www.bluez.org/release-of-bluez-5-35/

But yes more advice are welcome :)

Simon Fels (morphis) wrote :

@pitti: Yes, they implemented it to allow us to replace our hack udev rule (https://bazaar.launchpad.net/~bluetooth/bluez/ubuntu/view/head:/debian/50-bluetooth-hci-auto-poweron.rules) with that. "that some distributions " includes Ubuntu.

Martin Pitt (pitti) wrote :

Ah, thanks Simon. As you currently seem to manage bluez (https://code.launchpad.net/~bluetooth/bluez/bluez5-upgrade), can you do this change too?

Changed in bluez (Ubuntu):
assignee: nobody → Simon Fels (morphis)
Nahum Rozen (nahum) wrote :

Hi,
I encountered the very same issue. Followed changing AutoEnable=true, did't helped...
I'm with 15.10 without any mods.

Any ideas?

Changed in bluez (Ubuntu):
importance: Undecided → High
Guilhem Lettron (guilhem-fr) wrote :

@nahum have you try my ppa or you only have modify your main.conf?

you also have to remove udev rules

Nahum Rozen (nahum) wrote :

Hi Guilhem,

I only did the modify my main.conf.

Can you send detailed instructions regarding what to do?

Thanx

Nahum Rozen (nahum) wrote :

Hi Guilhem,

Did what you said:

Add your PPA:
        sudo add-apt-repository ppa:guilhem-fr/bluez-autoenable
        sudo apt-get update
        sudo apt-get upgrade

modified the main.conf
        sudo gvim /etc/bluetooth/main.conf
     change line 67 from #[Policy] into [Policy]
            change line 89 from #AutoEnable=false into AutoEnable=true

remove file 50-bluetooth-hci-auto-poweron.rules located in /lib/udev/rules.d
 I just changed its name…

rebooted

The BT panel sais that the device is connected. Yet, mouse does not move the cursor....

Any insights?
Maybe I did it wrong?

Thanx
Nahum

Guilhem Lettron (guilhem-fr) wrote :

@nahum, no you did it right.

You may have to remove mouse and redo pairing from scratch.

If it doesn't work, try to move udev rule to another backup dir.

jimmux (jimmux) wrote :

I have followed Nahum's overview of steps and not had much success.

It does at least claim to be paired now, but not actually doing anything. Tried pairing from scratch several times, sometimes it pairs and sometimes doesn't.

In my case there was no 50-bluetooth-hci-auto-poweron.rules file to remove, so is it possible I'm missing something?

Thanks.

jimmux (jimmux) wrote :

Cancel that.

Rebooted one more time, and of course it works perfectly minutes after calling for help.

Cheers!

Keith McClelland (zismylaptop) wrote :

I have been working with a Microsoft Designer Mouse (also a BLA device). I went to AskUbuntu to try to find out why I could not use it with Ubuntu 15.10. [I have a Microsoft Surface Pro3 and am using a home-built kernel but the kernel does not seem to affect this problem.] I have followed the instructions in comment #9 and find that the mouse works...for 10 minutes. Apparently each use of the mouse resets a 10-minute watchdog timer and the mouse is disconnected if ever this timer expires.

It won't come back on its own. To reconnect it, you must "remove" the mouse using Blueman or the Gnome Bluetooth Manager (I use the former), search it out again, and set it up again. Usually this works the first time but sometimes you have to go through it again. Despite the fact that the mouse works it is reported as of type "unknown" or "All types."

I have attached a chunk of syslog showing the full cycle. I removed the old and reconnected it at 19:19. I used the mouse for about 4 minutes and then turned it upside down at 19:23. It disconnected 10 minutes later at 19:33. This sequence is repeatable and invariant.

Is this the right bug for this our should another be started?

Thanks,
Keith

Keith McClelland (zismylaptop) wrote :

A follow-up. My Android Lollipop phone can connect and knows that the Designer Mouse is a mouse (not an unknown). Unfortunately it too loses connection in 10 minutes so the problem is deeper than I had expected.

Keith McClelland (zismylaptop) wrote :

The 4.4 Linux Kernel series reconnects even after the 10 minutes or (usually) a reboot. My roll-your-own is 4.4-rc2 which has a building problem but that is known and probably will already be fixed in rc3

lovefish (1398738509-u) on 2016-01-03
no longer affects: bluez
Yung Shen (kaxing) wrote :

found a workaround to this:

if you happened to upgrade from vivid(15.04) or you know how to get vivid kernel install properly,
you can boot the system with 3.19 kernel and pairing up the mouse using bluetoothctl manually
then reboot with 4.2, the mouse will still paired and working.

$ bluetoothctl (entering interactive mode)
$ agent on
$ default-agent
$ pairable on
$ scan on
$ devices (to see the device mac that you want to pair)
$ pair <dev mac>
$ trust <dev mac>
$ connect <dev mac>

verified versions(stable while posted):
bluez 5.35-0ubuntu2
linux-image-3.19.0-43-generic 3.19.0-43.49
linux-image-4.2.0-23-generic 4.2.0-23.28

Hi Nahum Rozen (nahum),

in Ubuntu 16.04Lts Desktop Edition that ppa doesn't work, it gves this error:

W: The repository 'http://ppa.launchpad.net/guilhem-fr/bluez-autoenable/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1)
E: Failed to fetch http://ppa.launchpad.net/guilhem-fr/bluez-autoenable/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found [IP: 91.189.95.83 80]
E: Failed to fetch http://ppa.launchpad.net/guilhem-fr/bluez-autoenable/ubuntu/dists/xenial/main/binary-i386/Packages 404 Not Found [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

any idea?

phamdohung161 (phamdohung161) wrote :

I've got the problem on Ubuntu 16.04 LTS Desktop :(

Kathryn Morgan (katamo) wrote :

I've confirmed this issue on multiple dell platforms including xps 9343, 9350, & 5510 laptops, both broadcom & intel wireless radios, & multiple types of LE devices.

I confirm that Microsoft Arch Tech mouse cannot be paired with Asus Eee PC. I'm using Ubuntu 16.04 Linux earth 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:15 UTC 2016 i686 i686 i686 GNU/Linux. Bluez version 5.37-0ubuntu5

ckjavacoder (ckjavacoder) wrote :

i confirm that Micosoft Designer mouse cannot work in ubuntu 16.04 at NUC5i7RYH i7-5557U.
The BT panel sais that the device is connected. Yet, mouse does not move the cursor....

Guilhem Lettron (guilhem-fr) wrote :

I try another merge request with AutoEnable parameter here:
https://code.launchpad.net/~guilhem-fr/bluez/ubuntu-autoenable/+merge/296115

It's based on previous patch submit here.

Keith McClelland (zismylaptop) wrote :

Bluez 5.40 works for me for both Designer keyboard and mouse. At this time Ubuntu has not packaged it up into a DEB but I was able to build and install it myself (search for bluez 5.40 to find how to download the entire large source). I am using Ubuntu 16.04 but a newer kernel made by Ubuntu (4.6.0-040600-generic). It is also important to install the patches Guilhem mentions in #22.

I needed some additional packages to do the build. This is the whole procedure as well as a website that helped me figure this out:

 ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var
 sudo apt-get install glib2.0
 sudo apt-get install libdbus-1-dev
 sudo apt-get install libudev-dev
 sudo apt-get install libical-dev
 sudo apt-get install libreadline-dev
 sudo make
 sudo make install

(I got help from http://rrbluetoothx.blogspot.com/2016/04/rr-bluetooth-compile-bluez-539.html).

They haven't got everything right yet: both devices, though they work fine, are of unknown type, and syslog is still littered with python failures whenever one of these connects or disconnects.

Nil PARRA (nil-parra) wrote :

I'm on ubuntu 16.10 and not works for me for both Designer keyboard and mouse. Do you have any solution before an official fix ?

Nil PARRA (nil-parra) wrote :

On 16.10, if i do :

modified the main.conf
        sudo gvim /etc/bluetooth/main.conf
     change line 67 from #[Policy] into [Policy]
            change line 89 from #AutoEnable=false into AutoEnable=true

remove file 50-bluetooth-hci-auto-poweron.rules located in /lib/udev/rules.d

My mouse works but not the keyboard.

Kai-Heng Feng (kaihengfeng) wrote :

After removed the udev rule, I can pair & connect both Designer Keyboard and Mouse via bluetoothctl. Both of them works.

Bluez version: 5.37-0ubuntu5

Robert Liu (robertliu) wrote :

I tried to specify the udev rule more precisely, i.e. only power up a host controller.
Is there anybody could give it a try?

#/lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
# Set bluetooth power up
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", ENV{DEVTYPE}=="host", RUN+="/bin/hciconfig %k up"

Gyula (gyula) wrote :

Hi guys. I am happy about finding this page. I had the same issue with my new Dell Bluetooth Mouse WM615 but after using your suggestions, it's working well now.

What I did are
- editing /etc/bluetooth/main.conf as it is said in #25
- editing /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules as it is said in #27. Thanks Robert, I can assure you, it works. At least for me.

I'm on Ubuntu 16.04 LTS and Dell Inspiron 15 7000.

Cheers guys!

Kathryn Morgan (katamo) wrote :

Just confirmed that Gyula's notes work for me too. Post #'s 25 & 27 work great to get my Microsoft Arc BTLE Mouse paired. Flawless connect, disconnect, and general usage. Thanks guys!

What I did:
- editing /etc/bluetooth/main.conf as it is said in #25
- editing /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules as it is

Xin YAO (yaoxin) wrote :

Hi Guys, thank you all for the effort, I can confirm that post #25 & #27 works as expected! (including the step of removing/renaming file 50-bluetooth-hci-auto-poweron.rules)

Many thanks!

Reuben Thomas (rrt) wrote :

Thanks for this. I managed to get my Arc Touch SE mouse to work with an otherwise stock 16.04 system by changing the setting as mentioned in #25, COMMENTING OUT the rule in #27 (merely changing it didn't seem to work) and then connecting as in #16.

Very grateful, as the mouse was a Christmas present that I asked for and I felt bad that I wasn't able to use it!

Based on comments here I can get the Microsoft Arc Touch Bluetooth to pair. But the Bluetooth manager doesn't think it is a mouse, or offer connecting it to the input service. How does one get an actual working mouse?

I made the same as #25 and I got the following:

1) the following dmesg error desappeared. The BT controller is an internal usb device.
[ 17.566030] usb 2-6: device descriptor read/64, error -110

2) M$ Bluetooth Mobile Mouse 3600 works. I removed any traces of it with bluetoothctl and I started a new setup only with GUI. Left/right clicks, movement and scroll (up/down/left/right) tested.

So #25 solved my problem. My M$ mouse 3600 now works with xenial.

tags: added: papercuts2017
LEYGUES (aurelien-leygues) wrote :

Finally both keyboard and mouse Microsoft Designer are working perfectly!

- I used #25 (maybe #27 can work, I didn't try)
- then #23 worked perfectly using this script: https://gist.github.com/Powiee/06129701f78f3c8a9cd23c197a35130f
- I removed all BT devices using bluetoothctl (command line interface) and reboot
- then I paired properly both mouse (1st) and keyboard (2nd) using #16
- both stopped working after a while (cursor not moving anymore), just switch off / on Bluetooth and TADAA: both auto-reconnect and now working without any problem!

Thanks a lot.

Ads20000 (ads20000) on 2017-01-06
tags: added: xenial
tags: added: yakkety
Mosh (moshikoy) wrote :

Thanks to you,
Got both Designer keyboard and Mouse working on Ubuntu 16.04
comment #34 solves the issue.

notice: without upgrading to v5.40 only the designer mouse will work

@All

FYI: the fix discussed here is on it's way to zesty [currently being tested]. Moreover we are making efforts on getting it as an update to xenial.

grafviktor (grafviktor) wrote :

#23 resolved my problem, I haven't changed any other files, like 25 and 26 suggested.

grafviktor (grafviktor) wrote :

Apologize, not 26, but 27. Haven't found how to edit my previous comment.

Jack Daniels (unoexperto) wrote :

I don't know guys. None of the above helped me. I initially had Killer 1535 card on my DELL XPS 13. Today I replaced it with Intel 8260 ant it still doesn't see Mobile Bluetooth 3600 mouse. Oddly it worked on another laptop with Intel 7260 card. Go figure :(

Chris J Arges (arges) wrote :

I see this was uploaded to Xenial as well as an SRU. It would be helpful to fill out the template in order to make reviewing easier:
https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

In addition we must ensure it is fixed in the development release before it gets fixed in stable versions so please confirm this.
Thanks

Brian Murray (brian-murray) wrote :

Additionally, were these changes intended? They are not documented in the changelog.

  1 diff -Nru bluez-5.37/debian/50-bluetooth-hci-auto-poweron.rules bluez-5.37/debian/50-bluetooth-hci-auto-poweron.rules
  2 --- bluez-5.37/debian/50-bluetooth-hci-auto-poweron.rules 2016-03-01 15:23:48.000000000 +0000
  3 +++ bluez-5.37/debian/50-bluetooth-hci-auto-poweron.rules 1970-01-01 00:00:00.000000000 +0000
  4 @@ -1,2 +0,0 @@
  5 -# Set bluetooth power up
  6 -ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/bin/hciconfig %k up"
  7 diff -Nru bluez-5.37/debian/bluez.install bluez-5.37/debian/bluez.install
  8 --- bluez-5.37/debian/bluez.install 2016-03-01 15:23:48.000000000 +0000
  9 +++ bluez-5.37/debian/bluez.install 2017-03-30 10:03:52.000000000 +0000
 10 @@ -25,7 +25,6 @@
 11 lib/udev/hid2hci
 12 lib/udev/rules.d/97-hid2hci.rules
 13 attrib/gatttool usr/bin
 14 -debian/50-bluetooth-hci-auto-poweron.rules lib/udev/rules.d
 15 #-- for systemd
 16 lib/systemd/system/bluetooth.service
 17 etc/dbus-1/system.d/bluetooth.conf

Changed in bluez (Ubuntu):
status: Confirmed → Incomplete
Robie Basak (racb) wrote :

Rejecting from the Xenial queue due to the lack of response.

If this still needs fixing in Xenial, please see https://wiki.ubuntu.com/StableReleaseUpdates and follow https://wiki.ubuntu.com/StableReleaseUpdates#Procedure.

Kai-Heng Feng (kaihengfeng) wrote :

The change is intended - please check comment #3.

Daniel van Vugt (vanvugt) wrote :
summary: - BLE pairing fail
+ Bluetooth LE pairing fail
Changed in bluez (Ubuntu):
assignee: Simon Fels (morphis) → nobody
status: Incomplete → In Progress
status: In Progress → Incomplete
description: updated
description: updated
Changed in bluez (Ubuntu):
status: Incomplete → Fix Released
Robie Basak (racb) wrote :

Adding a task for Xenial as requested on IRC. But note that I haven't looked into the details of the proposed fix - in particular checking for and understanding any proposed change in behaviour for Xenial users. So please don't take this as a +1 from ~ubuntu-sru. Before accepting this SRU, please consider whether the proposed fix is appropriate from scratch.

Changed in oem-priority:
importance: Undecided → Critical
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bluez (Ubuntu Xenial):
status: New → Confirmed
Changed in bluez (Ubuntu Xenial):
assignee: nobody → Konrad Zapałowicz (kzapalowicz)
Changed in oem-priority:
assignee: nobody → Cyrus Lien (cyruslien)

Testing::

1. using the bluez without the patch

- reboot
- try to pair and connect

2. using bluez with patch

- reboot
- try to pair and connect

In some cases pairing and connecting works better with the patch applied. There is no negative behavior observed with patch applied compared to w/o the patch.

tags: added: risk
tags: added: sru
tags: removed: risk
description: updated
description: updated

Hello Guilhem, or anyone else affected,

Accepted bluez into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/bluez/5.37-0ubuntu5.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in bluez (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-xenial
Daniel van Vugt (vanvugt) wrote :

Verification failed on xenial. Please see bug 1744806.

tags: added: verification-failed-xenial
removed: verification-needed-xenial
cement_head (andor-udel) wrote :

Verification failed on Xenial

As a part of the Stable Release Updates quality process a search for Launchpad bug reports using the version of bluez from xenial-proposed was performed and bug 1744806 was found. Please investigate this bug report to ensure that a regression will not be created by this SRU. In the event that this is not a regression remove the "verification-failed" tag from this bug report and add the tag "bot-stop-nagging" to bug 1744806 (not this bug). Thanks!

tags: added: verification-failed
Daniel van Vugt (vanvugt) wrote :

Good news: Bug 1744806 has been resolved with a kernel update. So we're still able to continue testing and releasing this one.

tags: added: verification-needed-xenial
removed: verification-failed verification-failed-xenial
Łukasz Zemczak (sil2100) wrote :

Since the regression has been resolved, could someone re-validate the package in -proposed?

Cyrus Lien (cyruslien) wrote :

Verified bluez 5.37-0ubuntu5.2 from -proposed, designer mouse works but designer keyboard failed.

To fully support BT LE, looks like we need to upgrade bluez >5.44. (verified bluez 5.46-0ubuntu4~somerville1 which comes form artful can make designer keyboard works)

Cyrus Lien (cyruslien) wrote :

With bluez 5.37-0ubuntu5.2 Designer keyboard still can not connect on 4.13.0-32-generic.

Daniel van Vugt (vanvugt) wrote :

Being a HWE problem, and not completely patchable, it sounds like we may have to consider a major upgrade of bluez to xenial. Assuming we can avoid ABI/API breaks...

I don't think we want to do it, but if it comes to that then we may have to.

Changed in oem-priority:
importance: Critical → High
Łukasz Zemczak (sil2100) wrote :

Should this bug be switched to verification-failed-xenial in that case? What is the status of this SRU?

Daniel van Vugt (vanvugt) wrote :

I'm not sure. I'm only going on Cyrus' comments.

Maybe check with koza for some extra verification on this one.

Changed in oem-priority:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

  • auto-1398738509 Edit

Bug watches keep track of this bug in other bug trackers.