# Bluetooth Mouse Debacle

## netwinder

Hello Gentoo Fourms,

Interesting problem: I have bluetooth set up (according to https://wiki.gentoo.org/wiki/Bluetooth , as far as i'm concerned. For example i can connect my phone to my laptop and transfer a file, and it works. However when I attempt to use my bluetooth mouse (Logitech MX master) I can pair it, however it says "connected" and it recognizes it as a mouse... However the pointer in gnome3 dosen't actually move, i can't click...Scroll.. Anything. My laptop is a Thinkpad T450s, 

Output of LSPCi

```

Thinkbad ~ # lspci

00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)

00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)

00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09)

00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)

00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)

00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (3) I218-V (rev 03)

00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03)

00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #6 (rev e3)

00:1c.1 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #3 (rev e3)

00:1d.0 USB controller: Intel Corporation Wildcat Point-LP USB EHCI Controller (rev 03)

00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03)

00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03)

00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03)

00:1f.6 Signal processing controller: Intel Corporation Wildcat Point-LP Thermal Management Controller (rev 03)

02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)

03:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)

```

Portage make.conf:

```
Thinkbad portage # cat make.conf

# These settings were set by the catalyst build script that automatically

# built this stage.

# Please consult /usr/share/portage/config/make.conf.example for a more

# detailed example.

CFLAGS="-O2 -pipe"

CXXFLAGS="${CFLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.

# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

# These are the USE and USE_EXPAND flags that were used for

# buidling in addition to what is provided by the profile.

ABI_X86="64"

CPU_FLAGS_X86="mmx sse sse2 mmxext"

PORTDIR="/usr/portage"

DISTDIR="${PORTDIR}/distfiles"

PKGDIR="${PORTDIR}/packages"

GENTOO_MIRRORS="rsync://gentoo.gossamerhost.com/gentoo-distfiles/ http://gentoo.gossamerhost.com rsync://mirrors.tera-byte.com/gentoo http://gentoo.mirrors.tera-byte.com/ ftp://mirrors.tera-byte.com/pub/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"

#TODO: Clean up virtual machine use flag variable

VIRT="gnome-keyring gtk"

#TODO: Clean up use flags

USE="${VIRT} X aac alsa branding bluetooth bzip2 curl encode gtk gtk2 gpl iconv \

     jpeg libkms mp3 network opengl postproc pango png pulseaudio \

     python snappy ssh threads truetype vorbis x264 xcb xvid zlibs \

     networkmanager"

FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher"

# Because the fucking touchpad is broken

INPUT_DEVICES="synaptics evdev"

source /var/lib/layman/make.conf

```

I'm not too familiar with troubleshooting Bluetooth, so please ask for more command outputs as i'm not entirely sure what the fourm would expect to see, however any ideas on how to get my mouse working?

----------

## Logicien

Hello,

how do you connect your Logitech MX master? Do you use Gnome Bluetooth interface, Blueman, bluetoothctl or an other interface? bluetoothctl seem's to me the best interface for investigation. At best, only one interface at a time must manage Bluetooth. Maybe Bluetooth mouses need a special configuration option in one of the files in /etc/bluetooth.

Have you try to pair and then connect your mouse when no other Bluetooth device is connected to your laptop Bluetooth device?

----------

## netwinder

 *Logicien wrote:*   

> Hello,
> 
> how do you connect your Logitech MX master? Do you use Gnome Bluetooth interface, Blueman, bluetoothctl or an other interface? bluetoothctl seem's to me the best interface for investigation. At best, only one interface at a time must manage Bluetooth. Maybe Bluetooth mouses need a special configuration option in one of the files in /etc/bluetooth.
> 
> Have you try to pair and then connect your mouse when no other Bluetooth device is connected to your laptop Bluetooth device?

 

Thanks for the response! I use the gnome bluetooth interface, i havent tried bluetoothctl, i'll try it and get back to you. 

here is the contents of /etc/bluetooth

input.conf

```

# Configuration file for the input service

# This section contains options which are not specific to any

# particular interface

[General]

# Set idle timeout (in minutes) before the connection will

# be disconnect (defaults to 0 for no timeout)

IdleTimeout=0

# Enable HID protocol handling in userspace input profile

# Defaults to false (HIDP handled in HIDP kernel module)

#UserspaceHID=true

```

```

[General]

# Default adaper name

# Defaults to 'BlueZ X.YZ'

#Name = BlueZ

# Default device class. Only the major and minor device class bits are

# considered. Defaults to '0x000000'.

#Class = 0x000100

# How long to stay in discoverable mode before going back to non-discoverable

# The value is in seconds. Default is 180, i.e. 3 minutes.

# 0 = disable timer, i.e. stay discoverable forever

#DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable

# The value is in seconds. Default is 0.

# 0 = disable timer, i.e. stay pairable forever

#PairableTimeout = 0

# Automatic connection for bonded devices driven by platform/user events.

# If a platform plugin uses this mechanism, automatic connections will be

# enabled during the interval defined below. Initially, this feature

# intends to be used to establish connections to ATT channels. Default is 60.

#AutoConnectTimeout = 60

# Use vendor id source (assigner), vendor, product and version information for

# DID profile support. The values are separated by ":" and assigner, VID, PID

# and version.

# Possible vendor id source values: bluetooth, usb (defaults to usb)

#DeviceID = bluetooth:1234:5678:abcd

# Do reverse service discovery for previously unknown devices that connect to

# us. This option is really only needed for qualification since the BITE tester

# doesn't like us doing reverse SDP for some test cases (though there could in

# theory be other useful purposes for this too). Defaults to 'true'.

#ReverseServiceDiscovery = true

# Enable name resolving after inquiry. Set it to 'false' if you don't need

# remote devices name and want shorter discovery cycle. Defaults to 'true'.

#NameResolving = true

# Enable runtime persistency of debug link keys. Default is false which

# makes debug link keys valid only for the duration of the connection

# that they were created for.

#DebugKeys = false

# Restricts all controllers to the specified transport. Default value

# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).

# Possible values: "dual", "bredr", "le"

#ControllerMode = dual

# Enables Multi Profile Specification support. This allows to specify if

# system supports only Multiple Profiles Single Device (MPSD) configuration

# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple

# Devices (MPMD) configurations.

# Possible values: "off", "single", "multiple"

#MultiProfile = off

# 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 = false

#[Policy]

#

# The ReconnectUUIDs defines the set of remote services that should try

# to be reconnected to in case of a link loss (link supervision

# timeout). The policy plugin should contain a sane set of values by

# default, but this list can be overridden here. By setting the list to

# empty the reconnection feature gets disabled.

#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb

# ReconnectAttempts define the number of attempts to reconnect after a link

# lost. Setting the value to 0 disables reconnecting feature.

#ReconnectAttempts=7

# ReconnectIntervals define the set of intervals in seconds to use in between

# attempts.

# If the number of attempts defined in ReconnectAttempts is bigger than the

# set of intervals the last interval is repeated until the last attempt.

#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64

# 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=false

```

network.conf

```

# Configuration file for the network service

[General]

# Disable link encryption: default=false

#DisableSecurity=true

```

proximity.conf

```

# Configuration file for the proximity service

# This section contains options which are not specific to any

# particular interface

[General]

# Configuration to allow disabling Proximity services

# Allowed values: LinkLoss,PathLoss,FindMe

Disable=PathLoss

```

edit: forgot to add, i have tried pairing the mouse with no other devices connected. Still unsucessful

----------

## Logicien

In /etc/bluetooth/input.conf enable

```
UserspaceHID=true
```

and restart the bluetooth service. Try to pair/connect again.

A mouse is a HID device. Enable this option can help.

----------

## netwinder

 *Logicien wrote:*   

> In /etc/bluetooth/input.conf enable
> 
> ```
> UserspaceHID=true
> ```
> ...

 

I did that, same results as before. Also i notice that if i first pair the mouse and reset bluetooth, the mouse won't re-connect and i have to re-pair in order for it to be "connected"

Here's some initial investigation through bluetoothctl

```

[bluetooth]# connect C9:EB:D3:78:29:12

Attempting to connect to C9:EB:D3:78:29:12

[CHG] Device C9:EB:D3:78:29:12 Connected: yes

Connection successful

[CHG] Device C9:EB:D3:78:29:12 Paired: yes

[MX Master]# list-attribute C9:EB:D3:78:29:12

```

reveals no issues, however the mouse still doesn't work

----------

## Logicien

Have-you check in Gnome-Control-Center in the mouse interface if the Logitech MX master is activated?

----------

## netwinder

 *Logicien wrote:*   

> Have-you check in Gnome-Control-Center in the mouse interface if the Logitech MX master is activated?

 

I checked, no option for the MX-master. Any other ideas? I think its lower-level

----------

## Logicien

Are-you sure you mouse work properly? Does it work with an other Linux distribution (live) or an other operating system?

Bluetooth mouse - ArchWiki

----------

## netwinder

 *Logicien wrote:*   

> Are-you sure you mouse work properly? Does it work with an other Linux distribution (live) or an other operating system?
> 
> Bluetooth mouse - ArchWiki

 

Yes, my mouse does work properly. When I used Fedora 22/23/24 on this same laptop the mouse worked well. So I am sure the mouse works properly in  :Wink:  and yes I read that guide after you mentioned using bluetoothctl to connect my mouse, following thier commands I was able to pair and connect to the mouse however the mouse still wouldn't work.

----------

## Logicien

So, you may have a problem with your kernel configuration and/or Bluez and/or with the driver of your laptop Bluetooth device and/or permissions. I configure the Linux kernel to have Bluetooth support in modules [m] when possible. Every Bluetooth option is enabled. I think Bluez should work with the default USE flags. Some Bluetooth devices need firmware files to work properly. Maybe you need to be in a special group like plugdev to use a Bluetooth mouse device but I would be surprise.

You should check the kernel messages with the dmesg command to see if there is some missing firmware files who are mentionned. What the kernel say when you pair and connect your mouse and each Bluetooth device can be of an help too.

What say the status of the bluetooth service can give usefull informations.

An other reason can be that Xorg cannot use the Bluetooth mouse even if it is well pair and connect. Maybe pair and connect from a virtual terminal with bluetoothctl or with a Udev rule before starting X can help. If it work with Gpm on the console it should work with Xorg.

Some Bluetooth devices need to change mode for the mouse.

----------

## netwinder

Fixed it!

I made most of my BT kernel settings modular, and also:

```
                                                                                        

  │     -> Device Drivers                                                                                     

  │       -> HID support                                                                                     

  │         -> HID bus support (HID [=y])

```

Seemed to do the trick  :Smile:  thanks everyone

----------

## luciano

Would you mind sharing your kernel .config?

----------

