Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: bluez 5 not connecting
Date: Wed, 28 May 2014 18:58:58
Message-Id: 201405281942.20218.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] Re: bluez 5 not connecting by William Kenworthy
1 On Sunday 27 Apr 2014 08:27:31 William Kenworthy wrote:
2 > On 04/27/14 11:14, William Kenworthy wrote:
3 > > On 04/27/14 02:33, Mick wrote:
4 > >> On Thursday 24 Apr 2014 02:11:57 William Kenworthy wrote:
5 > >>> I was able to get it working manually - gentoo's init scripts are out
6 > >>> of date with bluez 5, blutoothctl is broken (or probably just poorly
7 > >>> documented which equates to the same thing if the command doesn't
8 > >>> work) .
9 > >>>
10 > >>> In bluetoothctl:
11 > >>> power on
12 > >>> scan on
13 > >>> agent on
14 > >>> default-agent
15 > >>> pair <dev_id>
16 > >>> trust <dev_id>
17 > >>> exit
18 > >>>
19 > >>> In a shell:
20 > >>> rfcomm bind rfcomm0 <dev_id>
21 > >>>
22 > >>> do serial port stuff with /dev/rfcomm0
23 > >>>
24 > >>> rfcomm unbind rfcomm0
25 > >>>
26 > >>> bluetoothctl connect command does not work - connects and immediately
27 > >>> disconnects with an error
28 > >>> gentoo's rfcomm initscript has removed the -f flag which bluez 5 does
29 > >>> not have, but it also looks like the bind all in the 5.17 ebuild is
30 > >>> also not supported by late bluez5 so it immediately exits and no
31 > >>> rfcomm device is created.
32 > >>>
33 > >>> Ive adapted my python script to the changes now - but the pairing does
34 > >>> not survive restarting bluetooth so I'll need an expect script to set
35 > >>> it up each bluetooth re-init as it looks like there are no scripting
36 > >>> hooks in bluetoothctl.
37 > >>>
38 > >>> BillK
39 > >>
40 > >> Thanks BillK, your suggestions above helped somewhat, because I was able
41 > >> to connect with my phone, but it didn't get me far enough. I was not
42 > >> able to connect with rfcomm to my mobile. When I ran 'pon
43 > >> <connection_name>' pppd started, but I got errors like:
44 > >>
45 > >> Apr 26 18:15:12 dell_xps chat[29579]: -- write failed: Transport
46 > >> endpoint is not connected
47 > >> Apr 26 18:15:12 dell_xps chat[29579]: Failed
48 > >>
49 > >>
50 > >> This was despite the fact that I had created manually the rfcomm0 device
51 > >> and binded it to the bdaddr of my phone as you suggested.
52 > >>
53 > >> Googling for this error revealed that this is because the rfcomm code
54 > >> has
55 > >>
56 > >> changed - but there is a patch which may fix things:
57 > >> http://comments.gmane.org/gmane.linux.bluez.kernel/42303
58 > >>
59 > >> I ran out of time and did not try 'rfcomm connect' instead of 'rfcomm
60 > >> bind' to see if it makes a difference in my case.
61 > >>
62 > >> FYI, I'm on net-wireless/bluez-5.15 and kernel 3.12.13-gentoo.
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 > I used the patch from the reply above - worked!
73 >
74 > It did take a couple of goes but after restarting the bluetooth
75 > initscript before using bluetoothctl via expect (took 3 goes before I
76 > got a clean run from "expect" - timing might need adjusting?)
77
78 This is getting worse! O_O
79
80 I am on net-wireless/bluez-5.18 and gentoo-sources-3.12.20 without the patch.
81
82 Now I have no rfcomm service at all listed under rc-update and if I try to
83 start /etc/init.d/bluetooth I get:
84
85 # /etc/init.d/bluetooth restart
86 * ERROR: bluetooth needs service(s) rfcomm
87
88
89 Creating /dev/rfcomm0 with:
90
91 # rfcomm bind rfcomm0 hci0
92
93 does not change the error. Starting KDE's BlueDevil shows no adaptor found.
94 Indeed, hci0 is not configured. O_o
95
96 So, running:
97
98 # hciconfig hci0 up
99
100 allows me to list it:
101
102 $ hcitool dev
103 Devices:
104 hci0 90:4C:E5:FA:F2:A8
105
106 but NOT under bluetoothctl!
107
108 [bluetooth]# power on
109 No default controller available
110 [bluetooth]# show
111 No default controller available
112 [bluetooth]# list
113 [bluetooth]#
114 [bluetooth]# devices
115 [bluetooth]#
116
117 NOTE: using hcitool I can scan my mobile phone, but without rfcomm I can't use
118 it.
119
120
121 Hmm ... am I alone in this quest?
122
123 --
124 Regards,
125 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Re: bluez 5 not connecting Samuli Suominen <ssuominen@g.o>