My Bluetooth dongle/keyboard connection keeps dropping off

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read how to get help
Post Reply
rdlf4
Level 1
Level 1
Posts: 32
Joined: Sun Jul 02, 2017 9:53 pm

My Bluetooth dongle/keyboard connection keeps dropping off

Post by rdlf4 » Fri Dec 29, 2017 12:16 pm

Hello there! Long time LM user.
So, I got a Bluetooth dongle and a BT keyboard a few months ago and when my wired keyboard went out of service, I decided to give them a shot.
But now, I wish I didn't. You see, as I'm typing this, my keyboard decided to disconnect. Usually, all it takes is to press a button, wait a few seconds and then my BT systray/notification (from blueberry) turns green again and I'm good to go.
But this time, I'm pressing some keys and it won't come up again. Then, I turn to my dongle. When it's active, it blinks normally and when it receives data input, it blinks repeatedly fast. But this time, neither happened. It was just sitting there, not blinking at all. So who's to blame? My dongle or my BT keyboard? Before jumping to conclusions, I decided to take a deeper look at my Bluetooth manager aka blueberry. I did try Blueman but that thing made adding a BT keyboard a nightmare, so I switched back to blueberry.

It goes beyond my mind why is it that the Linux Mint team has not added an option like "Let the adapter switch off devices to save power" with a checkbox right next to it. If they did, I don't think we'd have that many Bluetooth-related topics in the forums.

I'm in no position to point fingers at my dongle or my bt keyboard. All I can say is this: whenever my keyboard decided to stop working, my transmitter/BT dongle stops blinking. The LED is on, but it will just stay that way, meaning Bluetooth is enabled on my system, but not active. Of course I would like to add some technical data into this post, but I have no idea what I should ask for in the terminal. Please let me know what data you require (and how I can get it) and I'll promptly provide it for you.

Thank you.

rdlf4
Level 1
Level 1
Posts: 32
Joined: Sun Jul 02, 2017 9:53 pm

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by rdlf4 » Fri Dec 29, 2017 12:34 pm

[POST EDIT] I've just experienced a keyboard timeout. My dongle is still blinking but my BT keyboard is now disconnected due to inactivity. And because my dongle was still active, all it took was hit one button and then my bt kb woke up.
I need to find a way to tell my bt keyboard and dongle NOT to sleep/save power. Is there a Bluetooth Manager available for Linux that lets me do so?

User avatar
JerryF
Level 11
Level 11
Posts: 3935
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by JerryF » Fri Dec 29, 2017 12:59 pm

In BIOS, check to see if your USB ports are set to a power saving mode.
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

rdlf4
Level 1
Level 1
Posts: 32
Joined: Sun Jul 02, 2017 9:53 pm

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by rdlf4 » Fri Dec 29, 2017 2:04 pm

JerryF wrote:In BIOS, check to see if your USB ports are set to a power saving mode.
Hi, sorry for taking so long. I had to look for a wired keyboard to enter my BIOS. As you may have guessed, my mobo does not have BT support.
So, my mobo does not list power saving mode for USB. The closest thing related to power, USB and keyboard is 'Power On by Keyboard' (which is set to Disabled).
This is a Gigabyte GA-78LMT-USB3 Review v5.0.
Also, judging my BT dongle's behavior, after some time, it stops blinking and remains turned on (as I mentioned before). So I guess I should tell both my dongle and my BT KB to not go to sleep/rest/low-power consumption mode, right?
If so, how exactly is that achieved in LM18.1? I'm looking through bluetoothctl and there doesn't seem to be such an option...

User avatar
JerryF
Level 11
Level 11
Posts: 3935
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by JerryF » Fri Dec 29, 2017 2:12 pm

rdlf4 wrote: Hi, sorry for taking so long. I had to look for a wired keyboard to enter my BIOS. As you may have guessed, my mobo does not have BT support.
So, my mobo does not list power saving mode for USB. The closest thing related to power, USB and keyboard is 'Power On by Keyboard' (which is set to Disabled).
No need to be sorry :wink:. Just an FYI, even if your mobo doesn't have BT, it can still have a power saving mode for USB. Yours doesn't seem to have it.

Unfortunately, I wouldn't know how to set power options for your keyboard setup. Sorry.
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

rdlf4
Level 1
Level 1
Posts: 32
Joined: Sun Jul 02, 2017 9:53 pm

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by rdlf4 » Fri Dec 29, 2017 2:14 pm

JerryF wrote:
rdlf4 wrote: Hi, sorry for taking so long. I had to look for a wired keyboard to enter my BIOS. As you may have guessed, my mobo does not have BT support.
So, my mobo does not list power saving mode for USB. The closest thing related to power, USB and keyboard is 'Power On by Keyboard' (which is set to Disabled).
No need to be sorry :wink:. Just an FYI, even if your mobo doesn't have BT, it can still have a power saving mode for USB. Yours doesn't seem to have it.

Unfortunately, I wouldn't know how to set power options for your keyboard setup. Sorry.
No need to be sorry either :mrgreen:
But to tell you the truth, admittedly, this is annoying.
Is there a way to keep track of when my bluetooth devices get disconnected and by what process? I guess that would be a good way to start.
This is pretty much what bluetoothctl outputs whenever my keyboard gets disconnected and reconnected:

Code: Select all

[bluetooth]# list
Controller 00:1B:10:00:3D:01 rodolfo-GA-78LMT-USB3 [default]
[CHG] Device 70:73:00:1A:40:1E Connected: no
[CHG] Device 70:73:00:1A:40:1E Connected: yes
[CHG] Device 70:73:00:1A:40:1E Connected: no
[CHG] Device 70:73:00:1A:40:1E Connected: yes
However, I need more, further info. Anyone?

User avatar
JerryF
Level 11
Level 11
Posts: 3935
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by JerryF » Fri Dec 29, 2017 2:35 pm

rdlf4 wrote: No need to be sorry either :mrgreen:
But to tell you the truth, admittedly, this is annoying.
Is there a way to keep track of when my bluetooth devices get disconnected and by what process? I guess that would be a good way to start.
This is pretty much what bluetoothctl outputs whenever my keyboard gets disconnected and reconnected:

Code: Select all

[bluetooth]# list
Controller 00:1B:10:00:3D:01 rodolfo-GA-78LMT-USB3 [default]
[CHG] Device 70:73:00:1A:40:1E Connected: no
[CHG] Device 70:73:00:1A:40:1E Connected: yes
[CHG] Device 70:73:00:1A:40:1E Connected: no
[CHG] Device 70:73:00:1A:40:1E Connected: yes
However, I need more, further info. Anyone?
I know how annoying it can be. I had Bluetooth problems too. It took a while to get it solved, so hang in there!
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

rdlf4
Level 1
Level 1
Posts: 32
Joined: Sun Jul 02, 2017 9:53 pm

Re: My Bluetooth dongle/keyboard connection keeps dropping off

Post by rdlf4 » Sat Dec 30, 2017 1:30 pm

I decided to do my own research on the topic and came up with a few ideas. Lets take a look at how it went:
I couldn't tell which Bluetooth Manager was giving me the headache (blueberry or blueman), so I tried to ditch them both and go with Bluetoothctl in the terminal. I powered on my adapter, made it discoverable, set the default agent, paired it to my BT keyboard, typed the random number for connection and it finally connected without a Bluetooth Manager... to no avail, as the connection kept dropping and coming back. Back to step 0.
For those of you wondering, I want my Bluetooth keyboard not to lose/drop connection to my BT dongle. When that happens, the BT keyboard either A) won't receive any input for a few seconds and then establishes connection again or B) it will definitely lose connection to my dongle and play dead, refusing to work at all.

I had determined that I will not allow my BT keyboard to go to sleep in order to avoid connection drops. So anything power saving related should be set to disabled. I also decided to remove Blueman because it can't handle pairing to a device that requires a passcode. It will just tell you 'paring failed' (or something like that) and exit the process. Something blueberry does with ease, so I'm playing with them and removed Blueman from my computer for good.
Alright, back to the fun stuff. Although blueberry does the job of managing my Bluetooth devices efficiently, it lacks several options which could make our lives much easier. Definitely something the Linux Mint team should look into and change in the future. One of those features (if you will) is the addition of a check button right next to an option called 'Disable Power Saving mode for this device' under a tab called 'Bluetooth Options' which could be accessed via blueberry -> Bluetooth 3.0 keyboard -> Keyboard settings -> Bluetooth Options tab. It literally took me hours to get to know that there is a file in /etc/bluetooth called main.cfg, which can do just that: force my Bluetooth device to not go to sleep (and presumably stay connected to my Bluetooth dongle - in theory). Lets have a look at the file:

-> By the way, for those of you wondering why your Bluetooth device won't just reconnect after your computer reboots, just remove the hashtag before AutoEnable and set it to true.

Code: Select all

# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'false'.
AutoEnable=true
-> Back to my business, lets make my Bluetooth keyboard always on.

Code: Select all

# Permanently enables the Fast Connectable setting for adapters that
# support it. When enabled other devices can connect faster to us,
# however the tradeoff is increased power consumptions. This feature
# will fully work only on kernel version 4.1 and newer. Defaults to
# 'false'.
FastConnectable = true
Again, it's important to note that the BlueZ implementation is from the Canonical team and therefore pretty much Ubuntu default stuff.
So an updated blueberry Bluetooth Manager could easily manipulate those setting without having the user go data-digging into the system and spend countless hours trying to fix something Linux Mint should make available to the user in the first place. No need to hide that stuff from the user!
My kernel version is 4.4.0-104.127. In other words, stock kernel for Linux Mint 18.1 (up-to-date).
Did it work? Yes and no. Yes, my Bluetooth keyboard remains connected for a long time. And no, I'm still experiencing some random drops. Not so often, but still annoying.

I had to keep track of what is going on in the background, so it could shed some light into the issue. After some digging, I found some documentation provided by the Arch Linux community and came to learn about Journalctl.
So I did jornalctl | grep bluetooth in the terminal. Here's the output:

Code: Select all

Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Bluetooth daemon 5.37
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Starting SDP server
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Bluetooth management interface 1.10 initialized
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Failed to obtain handles for "Service Changed" characteristic
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Error adding Link Loss service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Current Time Service could not be registered
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: gatt-time-server: Input/output error (5)
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Not enough free handles to register service
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Sap driver initialization failed.
Dec 30 13:12:14 rodolfo-GA-78LMT-USB3 bluetoothd[830]: sap-server: Operation not permitted (1)
Dec 30 13:12:15 rodolfo-GA-78LMT-USB3 NetworkManager[854]: <info>  [1514650335.5061] Loaded device plugin: NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-bluetooth.so)
Dec 30 13:12:23 rodolfo-GA-78LMT-USB3 kernel: input: Bluetooth 3.0 Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/bluetooth/hci0/hci0:11/0005:04E8:7021.0002/input/input12
Dec 30 13:12:49 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource
Dec 30 13:12:49 rodolfo-GA-78LMT-USB3 bluetoothd[830]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSink
Dec 30 13:19:45 rodolfo-GA-78LMT-USB3 bluetoothd[830]: input-hid profile connect failed for 70:73:00:1A:40:1E: Device or resource busy
Dec 30 13:22:33 rodolfo-GA-78LMT-USB3 kernel: input: Bluetooth 3.0 Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/bluetooth/hci0/hci0:11/0005:04E8:7021.0003/input/input13
Dec 30 14:13:05 rodolfo-GA-78LMT-USB3 kernel: input: Bluetooth 3.0 Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/bluetooth/hci0/hci0:11/0005:04E8:7021.0004/input/input14
Dec 30 14:23:09 rodolfo-GA-78LMT-USB3 kernel: input: Bluetooth 3.0 Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/bluetooth/hci0/hci0:11/0005:04E8:7021.0005/input/input15
As you can see, it's complaining about no free handles, service error, and a driver error. No idea how to fix them as of yet, but if you know what it's about, please let me know. Much appreciated :-)
Alright, the output you see above is where I'm at currently. Notice the last three lines? It creates some kind of an input register for each time my keyboard goes off and then back on again.

So now this is the time I gotta ask, whose blame is it for experiencing those connection drops?
Who's to blame, my keyboard, my dongle or the Bluetooth Manager? An additional info: My dongle is BTv2 and my keyboard is BTv3. I'm not sure this has anything to do with it, I'm just mentioning it here just in case :-P

Sorry for the long post. I do hope it helped someone out. Will let you know if I find a way out. Peace.

Post Reply

Return to “Hardware Support”