Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: bluez 5 not connecting
Date: Sun, 27 Apr 2014 07:27:47
Message-Id: 535CB163.8080008@iinet.net.au
In Reply to: Re: [gentoo-user] Re: bluez 5 not connecting by William Kenworthy
1 On 04/27/14 11:14, William Kenworthy wrote:
2 > On 04/27/14 02:33, Mick wrote:
3 >> On Thursday 24 Apr 2014 02:11:57 William Kenworthy wrote:
4 >>
5 >>> I was able to get it working manually - gentoo's init scripts are out of
6 >>> date with bluez 5, blutoothctl is broken (or probably just poorly
7 >>> documented which equates to the same thing if the command doesn't work) .
8 >>>
9 >>> In bluetoothctl:
10 >>> power on
11 >>> scan on
12 >>> agent on
13 >>> default-agent
14 >>> pair <dev_id>
15 >>> trust <dev_id>
16 >>> exit
17 >>>
18 >>> In a shell:
19 >>> rfcomm bind rfcomm0 <dev_id>
20 >>>
21 >>> do serial port stuff with /dev/rfcomm0
22 >>>
23 >>> rfcomm unbind rfcomm0
24 >>>
25 >>> bluetoothctl connect command does not work - connects and immediately
26 >>> disconnects with an error
27 >>> gentoo's rfcomm initscript has removed the -f flag which bluez 5 does
28 >>> not have, but it also looks like the bind all in the 5.17 ebuild is also
29 >>> not supported by late bluez5 so it immediately exits and no rfcomm
30 >>> device is created.
31 >>>
32 >>> Ive adapted my python script to the changes now - but the pairing does
33 >>> not survive restarting bluetooth so I'll need an expect script to set it
34 >>> up each bluetooth re-init as it looks like there are no scripting hooks
35 >>> in bluetoothctl.
36 >>>
37 >>> BillK
38 >>
39 >> Thanks BillK, your suggestions above helped somewhat, because I was able to
40 >> connect with my phone, but it didn't get me far enough. I was not able to
41 >> connect with rfcomm to my mobile. When I ran 'pon <connection_name>' pppd
42 >> started, but I got errors like:
43 >>
44 >> Apr 26 18:15:12 dell_xps chat[29579]: -- write failed: Transport endpoint is
45 >> not connected
46 >> Apr 26 18:15:12 dell_xps chat[29579]: Failed
47 >>
48 >>
49 >> This was despite the fact that I had created manually the rfcomm0 device and
50 >> binded it to the bdaddr of my phone as you suggested.
51 >>
52 >> Googling for this error revealed that this is because the rfcomm code has
53 >> changed - but there is a patch which may fix things:
54 >>
55 >> http://comments.gmane.org/gmane.linux.bluez.kernel/42303
56 >>
57 >>
58 >> I ran out of time and did not try 'rfcomm connect' instead of 'rfcomm bind' to
59 >> see if it makes a difference in my case.
60 >>
61 >> FYI, I'm on net-wireless/bluez-5.15 and kernel 3.12.13-gentoo.
62 >>
63 >
64 > I just upgraded to 3.12.13 and it stopped working with the same error
65 > you have.
66 >
67 > I did see some other messages saying that certain kernel versions are
68 > broken but I'll now need to look into that now.
69 >
70 > BillK
71 >
72 >
73 >
74
75 I used the patch from the reply above - worked!
76
77 It did take a couple of goes but after restarting the bluetooth
78 initscript before using bluetoothctl via expect (took 3 goes before I
79 got a clean run from "expect" - timing might need adjusting?)
80
81 BillK

Replies

Subject Author
Re: [gentoo-user] Re: bluez 5 not connecting Mick <michaelkintzios@×××××.com>