You are not logged in.

#1 2016-11-02 23:37:00

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Dual boot and bluetooth device (change link key)

Hi guys, I set my laptop to dual boot W10 and arch, the thing is I got a bluetooth mouse and I would like it to be associated with both the OS.

I have already seen tutorials on how to get the windows pairing key but each of these have you changing a  [LinkKey] value inside of /var/bluetooth/<HostMAC>/<DeviceMAC>info.

The trick is, there is no such key in the structure of the info file on arch.

Any other distro seems to have it...

There is other keys but nothing looking like the one I need to replace.

I can't imagine noone has ever tried to get a bluetooth device working on two OS with arch.

Any help around ?

Offline

#2 2016-11-04 08:17:41

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Re: Dual boot and bluetooth device (change link key)

Anyone have a clue ?

Last edited by MisterTea (2016-11-04 09:17:46)

Offline

#3 2016-11-04 15:14:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,142

Re: Dual boot and bluetooth device (change link key)

First, please don't bump  https://wiki.archlinux.org/index.php/Co … mpty_posts
Silence on these forums is generally a good indication you have not provided enough information.

Have you worked through this article? https://wiki.archlinux.org/index.php/Bluetooth


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2016-11-04 16:00:29

ua4000
Member
Registered: 2015-10-14
Posts: 202

Re: Dual boot and bluetooth device (change link key)

Your path is wrong, please look at /var/lib/bluetooth/<HostMAC>/<DeviceMAC>info.

I use this myself, for restoring paired devices after new arch installation - backup/restore the info file.

I sugest: pair the device with arch, to create the directory+files. Then pair the device again with windows, extract the secret key in the registry - you need super-root rights. Then go back to arch and edit the existing info file and update the secret key with the windows setting + 1x reboot arch.
best regards

Last edited by ua4000 (2016-11-04 16:01:02)

Offline

#5 2016-11-04 20:22:15

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Re: Dual boot and bluetooth device (change link key)

Well first sorry about the bump, I didn't find the forum rules before bumping.

I have read the bluetooth wiki page entirely without any information regarding the link key.

About the path, I am using the var/lib/Bluetooth but I can't find the "linkkey"  property in the info file.
Could you tell me how you do it?

Thank you.

Last edited by MisterTea (2016-11-05 00:51:03)

Offline

#6 2016-11-05 14:26:48

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Re: Dual boot and bluetooth device (change link key)

Alright so I have more informations, here is the content of my info file for the said device :

[General]
Name=Designer Mouse
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;

[IdentityResolvingKey]
Key=A2126A717D50CA3C994A4FD6E509BCA8

[LocalSignatureKey]
Key=F8D7ABBD1FAF1A0646612AEB8F8E5DDF
Counter=0
Authenticated=false

[LongTermKey]
Key=1FFA80EAE477C978B966A2305E43C38E
Authenticated=0
EncSize=16
EDiv=49506
Rand=12830081786460759602

[DeviceID]
Source=2
Vendor=1118
Product=2053
Version=272

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=300

As you can see I don't have a LinkKey section.

SOLVED : I found the answer here :

http://console.systems/2014/09/how-to-p … tooth.html

I also followed this comment

Hey,
I know this is a bit late but maybe it helps other people :)

I got the same hci dump errors and was able to resolve them as follows:

1) I did not reverse the Rand value, instead I used the decimal number regedit shows beside the hex key

2) I set EncSize to 16.

These two changes allowed me to connect my Logitech MX Anywhere 2 but your mileage may vary! :)

Last edited by MisterTea (2016-11-05 15:41:04)

Offline

#7 2016-11-06 11:35:51

requies
Member
Registered: 2016-06-13
Posts: 5

Re: Dual boot and bluetooth device (change link key)

Hi, i need help.
I have a dualboot with archlinux and windows 10 but even following the tutorial (http://console.systems/2014/09/how-to-p … tooth.html) i can't get my Microsoft designer mouse to work on both systems without repairing.

This is the original Arch config:

[General]
Name=Designer Mouse
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;

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=300

[DeviceID]
Source=2
Vendor=1118
Product=2053
Version=272

[IdentityResolvingKey]
Key=58FD200DCC6C7DCC834390F9E60C8773

[LocalSignatureKey]
Key=49A66F649B448E5E90764A015B8B73F0
Counter=0
Authenticated=false

[LongTermKey]
Key=2FEBB3164D03B91A2FB3F507AA745504
Authenticated=0
EncSize=16
EDiv=12307
Rand=12064032143015722847

This is the original Win10 config:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys]

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys\4485009cc3ee]

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys\4485009cc3ee\e3bee7773e12]
"LTK"=hex:56,5d,1e,16,1f,18,99,eb,74,d8,a6,32,79,c7,09,0d
"KeyLength"=dword:00000000
"ERand"=hex(b):91,2b,ca,19,cf,b8,80,54
"EDIV"=dword:0000696a
"IRK"=hex:73,87,0c,e6,f9,90,43,83,cc,7d,6c,cc,0d,20,fd,58
"Address"=hex(b):12,3e,77,e7,be,e3,00,00
"AddressType"=dword:00000001
"CSRK"=hex:9a,ee,15,04,27,e7,18,9e,7c,73,d4,86,05,f4,3c,b7
"AuthReq"=dword:00000001

This is my edited config following the tutorial:

[General]
Name=Designer Mouse
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;

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=300

[DeviceID]
Source=2
Vendor=1118
Product=2053
Version=272

[IdentityResolvingKey]
Key=58FD200DCC6C7DCC834390F9E60C8773

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

[LongTermKey]
Key=565D1E161F1899EB74D8A63279C7090D
Authenticated=0
EncSize=0
EDiv=26986
Rand=6089069895835332000

This is my edited config following the MisterTea post:

[General]
Name=Designer Mouse
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;

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=300

[DeviceID]
Source=2
Vendor=1118
Product=2053
Version=272

[IdentityResolvingKey]
Key=58FD200DCC6C7DCC834390F9E60C8773

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

[LongTermKey]
Key=565D1E161F1899EB74D8A63279C7090D
Authenticated=0
EncSize=16
EDiv=26986
Rand=10460676771706077000

hcidump

> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 2
    status 0x00
> HCI Event: Command Status (0x0f) plen 4
    LE Start Encryption (0x08|0x0019) status 0x00 ncmd 1
> HCI Event: Encrypt Change (0x08) plen 4
    status 0x06 handle 3585 encrypt 0x00
    Error: PIN or Key Missing
> HCI Event: Command Status (0x0f) plen 4
    Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 3585 reason 0x16
    Reason: Connection Terminated by Local Host

None of this works.
Anyone knows how to fix that?

Thank you

Last edited by requies (2016-11-06 16:27:31)

Offline

#8 2016-11-06 15:26:54

alex.theoto
Member
From: Athens Greece
Registered: 2014-11-30
Posts: 307

Re: Dual boot and bluetooth device (change link key)

Offline

#9 2016-11-06 16:37:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,142

Re: Dual boot and bluetooth device (change link key)

Thank you for cleaning up your post.  It kept me from having to do so smile
I do not believe that the tutorial you linked is applicable to Arch Linux.
I also do not believe that that mouse is a BLE device.  Yes, it is is Bluetooth 4.0.   BLE implies Bluetooth 4.0; Bluetooth 4.0 does not imply BLE.  I could be wrong, I cannot prove it is not BLE

Have you worked through this wiki page? https://wiki.archlinux.org/index.php/Bluetooth
In particular, I would be interested in knowing what happens with bluetoothctl


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#10 2016-11-06 17:08:57

requies
Member
Registered: 2016-06-13
Posts: 5

Re: Dual boot and bluetooth device (change link key)

No problem for the edit. wink

These are the bluetoothctl infos i get:

requies ~ $ bluetoothctl 
[NEW] Controller 44:85:00:9C:C3:EE Lap [default]
[NEW] Device E3:BE:E7:79:3E:12 Designer Mouse
[bluetooth]# info E3:BE:E7:79:3E:12 
Device E3:BE:E7:79:3E:12
	Name: Designer Mouse
	Alias: Designer Mouse
	Appearance: 0x03c2
	Icon: input-mouse
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v045Ep0805d0110
[bluetooth]# 

if i move the mouse i get a bunch of:

[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no
[CHG] Device E3:BE:E7:79:3E:12 Connected: yes
[CHG] Device E3:BE:E7:79:3E:12 Connected: no

if i pair it this is what i get:

[NEW] Device E3:BE:E7:7A:3E:12 Designer Mouse
[CHG] Device E3:BE:E7:7A:3E:12 Connected: yes
[CHG] Device E3:BE:E7:7A:3E:12 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device E3:BE:E7:7A:3E:12 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device E3:BE:E7:7A:3E:12 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device E3:BE:E7:7A:3E:12 UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device E3:BE:E7:7A:3E:12 UUIDs: 00001812-0000-1000-8000-00805f9b34fb
[CHG] Device E3:BE:E7:7A:3E:12 ServicesResolved: yes
[CHG] Device E3:BE:E7:7A:3E:12 Paired: yes
[NEW] Primary Service
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service0008
    00001801-0000-1000-8000-00805f9b34fb
    Generic Attribute Profile
[NEW] Primary Service
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service0009
    0000180a-0000-1000-8000-00805f9b34fb
    Device Information
[NEW] Characteristic
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service0009/char000a
    00002a29-0000-1000-8000-00805f9b34fb
    Manufacturer Name String
[NEW] Characteristic
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service0009/char000c
    00002a50-0000-1000-8000-00805f9b34fb
    PnP ID
[NEW] Primary Service
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service000e
    0000180f-0000-1000-8000-00805f9b34fb
    Battery Service
[NEW] Characteristic
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service000e/char000f
    00002a19-0000-1000-8000-00805f9b34fb
    Battery Level
[NEW] Descriptor
    /org/bluez/hci0/dev_E3_BE_E7_7A_3E_12/service000e/char000f/desc0011
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration
[CHG] Device E3:BE:E7:7A:3E:12 Trusted: yes
[CHG] Device E3:BE:E7:7A:3E:12 Modalias: usb:v045Ep0805d0110

Anyways i'm pretty sure the mouse (Microsoft Designer Mouse) is BLE and even if it isn't, reading the tutorial, the last tree guys saying that it works, all have my same mouse.
I can't really understand what i'm doing wrong.

Last edited by requies (2016-11-06 17:11:41)

Offline

#11 2016-11-06 19:54:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,142

Re: Dual boot and bluetooth device (change link key)

I agree, that does actually look like it may be BLE what with the continuous connect/disconnect.  Unfortunately, my experience with BLE is limited to serial links.  I've not worked with a BLE mouse, but I imagine it is going to need to be hooked by lib-input.  That output from when you pair appears to indicate that the services have been instantiated. 

Before I start wading through that tutorial, what happens if you start your X session after having paired ?  It might just work.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#12 2016-11-06 20:44:18

requies
Member
Registered: 2016-06-13
Posts: 5

Re: Dual boot and bluetooth device (change link key)

I just tested starting X manually but no results.
When the mouse is paired on arch, it works.
Pairing in windows and then following the tutorial (both tutorial and MisterTea ways) it beheaves as before. Doesn't work..

I'm downloading a debian iso to test if it works there. (Since is a Debian tutorial) but it should work the same in arch too..

Offline

#13 2016-12-25 13:03:20

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Re: Dual boot and bluetooth device (change link key)

Here is a more detailed guide, maybe it should be added on the wiki...

Please pay attention that some bluetooth devices get a new MAC address each time they get linked

Windows :

1) Download PSEXEC here

2) CMD/Powershell : c:\portable\pstools\psexec -s -i regedit
3) Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\Your Bluetooth Controller' s MAC\Your Device' s MAC
Don't export the registry key, it will be misguiding because of reverse values)

4) Note down your device's  MAC.

On the right panel, note down CSRK, LTK, EDIV and ERand

CSRK must ne noted without spaces in upper cases.
Same for LTK
For EDIV and ERand, you have to note down the decimal value (you can copy the value by double clicking and selecting decimal)

Here is an example :

TkONEtE.png

Linux :

1) su

2) cd /var/lib/bluetooth/Your Bluetooth controller's MAC/

3) If the Windows device's MAC is different:

3.1) mv /var/lib/bluetooth/Your Bluetooth controller' s MAC/ Old device's MAC /var/lib/bluetooth/Your Bluetooth controller' s MAC/New device's MAC

4)vim /var/lib/bluetooth/Your Bluetooth controller's MAC' s/New device' s MAC/info

5) Changes to be made :

LocalSignatureKey Key = Windows CSRK

LongTermKey EDIV = Windows EDIV

LongTermKey Rand = Windows Rand

LongTermKey Key = Windows LTK

Here is an example with the same device linked on both Windows and Linux :

EAXCp4t.png

4) Save file

5) Maybe reboot

6) Enjoy

Last edited by MisterTea (2016-12-25 13:17:08)

Offline

#14 2017-01-08 11:10:53

requies
Member
Registered: 2016-06-13
Posts: 5

Re: Dual boot and bluetooth device (change link key)

I've forgot about this post. Anyway, it works perfectly. Last post of MisterTea should be added to the wiki.. IMHO
Anyway, thank you all guys. wink

Offline

#15 2017-01-10 02:49:23

MisterTea
Member
Registered: 2016-10-28
Posts: 12

Re: Dual boot and bluetooth device (change link key)

requies wrote:

I've forgot about this post. Anyway, it works perfectly. Last post of MisterTea should be added to the wiki.. IMHO
Anyway, thank you all guys. wink

Well, I am glad it helped you.

Please pay attention that you should activate your bluetooth device after linux booting so there is no bug with the connection.
If you are dual booting on a laptop and you 've got no bluetooth connection after booting on windows, please shutdown and start linux again.
The reason for this bug is yet to be known...

Offline

Board footer

Powered by FluxBB