Ubuntu 18.04 bluetooth mouse issue

Moderators: mdrjr, odroid

Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Sun Jun 24, 2018 2:53 am

Hi odroiders,

I upgraded today my C2 to ubuntu 18.04, and my Microsoft Bluetooth 3600 mouse stops working after a few minutes.
My bluetooth adapter is the one sold by hardkernel:
Code: Select all
me@odroid-C2:~$ lsusb
...
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
...

When it stops working, the only way I've found to have it back (without deleting the device and re-paring) is to manually ask to connect using bluetoothctl:
Code: Select all
me@odroid-C2:~$ sudo bluetoothctl
[NEW] Controller 00:1A:7D:DA:xx:xx odroid-C2 [default]
[NEW] Device D5:8B:A5:39:xx:xx BluetoothMouse3600
[NEW] Primary Service
   /org/bluez/hci0/dev_D5_8B_A5_39_xx_xx/service0009
   0000180a-0000-1000-8000-00805f9b34fb
   Device Information
[NEW] Characteristic
   /org/bluez/hci0/dev_D5_8B_A5_39_xx_xx/service0009/char000c
   00002a50-0000-1000-8000-00805f9b34fb
   PnP ID
[NEW] Characteristic
   /org/bluez/hci0/dev_D5_8B_A5_39_xx_xx/service0009/char000a
   00002a29-0000-1000-8000-00805f9b34fb
   Manufacturer Name String
[NEW] Primary Service
   /org/bluez/hci0/dev_D5_8B_A5_39_xx_xx/service0008
   00001801-0000-1000-8000-00805f9b34fb
   Generic Attribute Profile
[NEW] Device 34:88:5D:70:xx:xx Keyboard K480
Agent registered
[bluetooth]# connect D5:8B:A5:39:xx:xx
Attempting to connect to D5:8B:A5:39:xx:xx
[CHG] Device D5:8B:A5:39:xx:xx Connected: yes
Connection successful
[CHG] Device D5:8B:A5:39:xx:xx ServicesResolved: yes
[CHG] Device 34:88:5D:70:xx:xx Connected: yes

But after a while, or if I turn the mouse off then on, the connection is lost and I have to reconnect again.
The bluetooth keyboard K480 doesn't have this problem.

Note that I had no issue with this mouse on 16.04.

Any thoughts ?
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby odroid » Sun Jun 24, 2018 5:05 pm

Can you compare the lsmod outputs to find a missing Bluetooth HID driver?
User avatar
odroid
Site Admin
 
Posts: 28610
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Sun Jun 24, 2018 5:55 pm

The file mouse-on.log is the result of lsmod when the mouse is working, and the file mouse-off.log is the result of lsmod when the mouse is no longer working:
Code: Select all
me@odroid-C2:~$ diff mouse-on.log mouse-off.log
6,9c6,9
< cmac                    3139  2
< algif_hash              5456  1
< algif_skcipher          8582  1
< af_alg                  6821  6 algif_hash,algif_skcipher
---
> cmac                    3139  0
> algif_hash              5456  0
> algif_skcipher          8582  0
> af_alg                  6821  2 algif_hash,algif_skcipher
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby odroid » Sun Jun 24, 2018 6:04 pm

Sorry, I meant the comparison against Ubuntu 16.04 Kernel 3.14.
User avatar
odroid
Site Admin
 
Posts: 28610
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Sun Jun 24, 2018 6:08 pm

My bad. It will take some time since I erased my emmc to install 18.04. I will flash a 16.04 on an sdcard and keep you posted.
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Sun Jun 24, 2018 6:58 pm

Here's the output of lsmod on 16.04, with the mouse working:
Code: Select all
odroid@odroid64:~$ lsmod
Module                  Size  Used by
cmac                    3139  2
algif_hash              4109  1
algif_skcipher          7144  1
af_alg                  6159  6 algif_hash,algif_skcipher
fuse                   89333  3
ir_lirc_codec           4814  3
ir_sanyo_decoder        1668  0
ir_mce_kbd_decoder      3381  0
ir_sony_decoder         1698  0
lirc_dev               10631  1 ir_lirc_codec
ir_jvc_decoder          1688  0
ir_nec_decoder          1824  0
ir_rc6_decoder          2021  0
ir_rc5_decoder          1605  0
meson_ir                3404  0
zram                   18336  4
lz4_decompress          2704  1 zram
lz4_compress            2865  1 zram
btusb                  19153  0
meson_gpiomem           4024  0
gxbb_wdt                3427  0
ipv6                  376636  46
autofs4                28111  2

And here's the output of lsmod on 18.04 when the mouse is still working:
Code: Select all
me@odroid-C2:~$ lsmod
Module                  Size  Used by
sg                     30434  0
sr_mod                 17196  0
cdrom                  30139  1 sr_mod
joydev                 11035  0
cmac                    3139  2
algif_hash              5456  1
algif_skcipher          8582  1
af_alg                  6821  6 algif_hash,algif_skcipher
fuse                   91055  3
btusb                  21436  0
w1_gpio                 3801  0
wire                   28606  1 w1_gpio
meson_gpiomem           4048  0
gxbb_wdt                3395  0
sch_fq_codel            7827  2
sx865x                  5179  0
rtc_pcf8563             3924  0
aml_i2c                16735  0
nfsd                  292872  13
nfs_acl                 2898  1 nfsd
ip_tables              17220  0
ipv6                  387345  70
autofs4                27592  2

I'm not sure what to look for :/
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby mdrjr » Wed Jun 27, 2018 5:45 am

Some bluetooth devices uses a crypted connection however they don't provide a pairing key, this causes some confusion on bluez.

The solution to that is to click on the upper right bluetooth icon, go to devices, right click on your mouse and click "Trust"
there will be a yellow star near the mouse icon..

Microsoft mouses are notorious for having this issue.. I tested my "Microsoft Sculpt Comfort Mouse" that way and its working nice on 18.04 :)
mdrjr
Site Admin
 
Posts: 11686
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Thu Jun 28, 2018 1:50 am

Thanks for your reply.
Unfortunately, I also had the trust option enabled.
Here's the info file for the mouse from /var/lib/bluetooth:
Code: Select all
me@odroid-C2:~$ sudo cat /var/lib/bluetooth/00\:1A\:7D\:DA\:xx\:xx/D5\:8B\:A5\:39\:xx\:xx/info
[General]
Name=BluetoothMouse3600
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;

[LocalSignatureKey]
Key=9A1EAFE5D3B23E745824D047xxxxxxxx
Counter=0
Authenticated=false

[LongTermKey]
Key=52073421767C61A7DE0AFD34xxxxxxxx
Authenticated=0
EncSize=16
EDiv=45040
Rand=14818568845765507352

[DeviceID]
Source=2
Vendor=1118
Product=2326

And today, I could no longer reconnect using bluetoothctl:
Code: Select all
me@odroid-C2:~$ sudo bluetoothctl
[NEW] Controller 00:1A:7D:DA:xx:xx odroid-C2 [default]
[NEW] Device D5:8B:A5:39:xx:xx BluetoothMouse3600
[NEW] Device 34:88:5D:70:xx:xx Keyboard K480
Agent registered
[bluetooth]# connect D5:8B:A5:39:xx:xx
Attempting to connect to D5:8B:A5:39:xx:xx
Failed to connect: org.bluez.Error.Failed

I had to delete the device and re-pair it again.
Do you know how to get some bluetooth logs ? I don't see anything related to bluetooth using journalctl.
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby mdrjr » Thu Jun 28, 2018 2:09 am

Ah, your mouse seems to use BlueTooth LE.. I don't own a mouse with bluetooth LE enabled..
Let me see if I can find one locally to order.

Meanwhile, try this -> https://askubuntu.com/questions/1018298 ... evice-list
mdrjr
Site Admin
 
Posts: 11686
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Thu Jun 28, 2018 2:26 am

Applied the changes, rebooted and paired the mouse again. It seems the connection no longer times out.
But If I turn the mouse off/on, It still can't reconnect. :(

In 16.04, I had the same settings in the info file for BLE, but I guess the old bluez stack may have ignored it:
Code: Select all
SupportedTechnologies=LE;

The only difference I see in the info file between 16.04 and 18.04 is the entry "[LocalSignatureKey]" which doesn't exists in 16.04.
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Thu Jun 28, 2018 3:13 am

Some more information:
Code: Select all
me@odroid-C2:~$ sudo hcitool scan 
Scanning ...
me@odroid-C2:~$ sudo hcitool lescan
Set scan parameters failed: Input/output error

It seems that bluetooth low energy is not supported by the system or the adapter ?
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Thu Jun 28, 2018 5:45 am

chombier wrote:Applied the changes, rebooted and paired the mouse again. It seems the connection no longer times out.

Correction: after a while, the mouse stops working, even after setting IdleTimeout=0 and UserspaceHID=true in /etc/bluetooth/input.conf.
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby mdrjr » Thu Jun 28, 2018 6:02 am

I've just placed the order for the same mouse as you have :)
mdrjr
Site Admin
 
Posts: 11686
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Fri Jun 29, 2018 2:06 am

mdrjr wrote:I've just placed the order for the same mouse as you have :)

Thanks ! :)
Let's hope you'll find out what's wrong.
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby mdrjr » Thu Jul 12, 2018 1:52 am

Hello,

I received my mouse today and I could replicate your issue..
I still don't understand why it happens, but it also happens on my x86 laptop :(
I'l trying to check any possible options on bluez that may help with it ..
mdrjr
Site Admin
 
Posts: 11686
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby chombier » Fri Jul 13, 2018 3:11 am

Looks like it's a bug in Ubuntu 18.04 bluetooth stack... :(
Maybe opening a ticket at https://bugs.launchpad.net/ubuntu could help ?
chombier
 
Posts: 11
Joined: Sun Feb 18, 2018 10:13 pm
languages_spoken: english, french
ODROIDs: C2,HC1,HC2

Re: Ubuntu 18.04 bluetooth mouse issue

Unread postby mdrjr » Fri Jul 13, 2018 4:12 am

Maybe... I think it should help
mdrjr
Site Admin
 
Posts: 11686
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -


Return to Issues

Who is online

Users browsing this forum: No registered users and 0 guests