18

I have a nice little bluetooth mouse, but there is one problem. When it is not used for awhile (I primarily use keyboard) it turns off. Fine, so I have to turn it back on by pushing the button. But when I do I find that it does not get recognized by Ubuntu again until I click "connect" for that device specifically under the bluetooth-applet. I have a bluetooth touchpad+keyboard combo that I use with another Ubuntu computer that des not have this issue. Is there any reason mwhy this might be the case? It's very annoying.

1

7 Answers 7

7

Bluetooth settings are controlled from configuration files in /etc/bluetooth. For input devices we can define a timeout before a connection will be disconnected. To disable this open /etc/bluetooth/input.conf as root in an editor and either comment out the following line by adding # (as it is done in the example below), or set timeout value to 0:

#IdleTimeout=30

Other timeouts that can be set in /etc/bluetooth/main.conf may not be affected in your case as they only play a role when a service may be interrupted (e.g. by bad signal strength) and will not be reconnected in case a timeout is set here. Default values for timeouts in main.conf are:

DiscoverableTimeout = 0
PairableTimeout = 0
PageTimeout = 8192
5
  • That line was already commented out, but I've set it to 0 now to see if that changes anything (though it says that's the default). I think my device is actually turning itself off, though. Which is fine, I just wish it would auto-reconnect when I turn it back on, like my ones that have manual on/off do.
    – singpolyma
    Jul 17, 2011 at 2:32
  • Oh! It seems possible that it is recconecting and is just slow about it. I'll have to test a bit more to be sure.
    – singpolyma
    Jul 17, 2011 at 2:45
  • No... more testing seems to confirm that was a fluke. I definitely have to hit the button on my mouse, then select "connect" from the icon on Ubuntu
    – singpolyma
    Jul 17, 2011 at 3:24
  • Further testing shows that if I click one of my mouse buttons while it's off, it reconnects... I have no idea why that works an dthe other button didn't work the same way , but this solved now.
    – singpolyma
    Jul 18, 2011 at 21:15
  • Energy-saving feature of the mouse?
    – Takkat
    Jul 18, 2011 at 21:48
5

I appear to have solved my problem, and perhaps yours as well. After going through troubleshooting steps, here's I what have working now:

  • I commented out AutoConnectTimeout in /etc/bluetooth/main.conf -- not set to 0, but commented it out completely. Not sure if this matters, but I'm keeping it that way for now. I don't want AutoConnectTimeout to time out.
  • I set my IdleTimeout in input.conf to 240 minutes, this is a computer dedicated to watching movies, so can't hurt.
  • I set RememberPowered in main.conf to false.

I was really wracking my brain on this, fearing I would ultimately have to write an F-ing script to ping my mouse via Bluetooth. However, after trying out different combinations of settings in the input.conf and main.conf files. My eyes rested on the RememberPowered option in main.conf. It was set to true. Wait, I want my computer to remember that my mouse was powered off? I don't want my computer to remember any power-state of any mouse. Just go connect and keep powered and keep connected and keep talking, and I don't care if the mouse isn't listening because I turned it off. So I set that to false. It appears this has solved my problem of my Bluetooth mouse not re-syncing up and re-connecting to input services after a long time of being turned off, with the computer still on.

I hope this helps you.

Note: It doesn't matter if you have USB mice or USB keyboards connected to your computer.

2

Check out my answer here:

https://askubuntu.com/a/582035/13903

Uninstall/purge blueman-manager or any extra bluetooth software. Go vanilla and just leave the original Ubuntu bluetooth software to rule out any conflicts.

  1. Press the bluetooth mouse's discovery mode.

  2. Open a terminal and type the command hcitool scan

  3. Then paste the first half of your bluetooth address as the OUI.

So if your bluetooth mouse's address is AB:CD:EF:GH:IJ:KL

It would look like this:

<device oui="AB:CD:EF:" type="mouse" name="Microsoft Sculpt Comfort Mouse" pin="0000"/>

Insert that line with the rest of the entries in

/usr/share/gnome-bluetooth/pin-code-database.xml

This helps to reconnect mice that may require a pin to pair.

This should solve most reconnection issues because Ubuntu doesn't know the PIN when it reconnects. You need to provide it with one (if it needs it default is 0000).

name isn't required, pin isn't required either. oui is required however. First find out if your mouse needs apin then try this. You can also try without using the name parameter if you don't know it.

1

The setting which helped me was the AutoConnectTimeout in /etc/bluetooth/main.conf file. Originally it was set to 60, after changing that to

 AutoConnectTimeout = 0

the mouse connects in about 2 seconds after either the notebook or the mouse wake up. This is on Ubuntu 12.04 (Precise) on MacBook Air with a Logitech bluetooth mouse.

(The other settings mentioned in the previous answer mostly affect device pairing but won't help in re-establishing a connection with an already paired device.)

1

Always try set up PIN to 0000 first. It helps for me and all problems solved. I had exactly same problem looks as is stated above. I already tried all advices there in all related questions but nothing works. The solution is easier than we think (Ubuntu 14.04 LTS, Logitech M557 Bluetooth mouse).

2
  • Where should we do this? Oct 27, 2014 at 9:43
  • @TamsynMichael Check out my answer.
    – Tek
    Feb 5, 2015 at 16:10
0

When you setup mouse in 'Bluetooth New Device Setup' panel.

Bluetooth New Device Setup

Push 'PIN Options...'

PIN Options

Select fixed pin '0000'.

(Ubuntu 14.04 LTS)

0

It may sound strange but my wireless apple (mac) mouse re-connects on resuming/starting-up ubuntu only when I press few clicks and bang it randomly. Takes a couple of seconds to get connected.

I have tested this more than 10 times. If I don't bang (click) it doesn't connects upto 3-4 minutes. And on banging (clicking) it connects in less than 5 seconds.

Don't know if it would work with your mouse too least you could do is try.

PS: I paired it using hcitool scan.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .