1 |
On Thursday 24 Apr 2014 02:11:57 William Kenworthy wrote: |
2 |
|
3 |
> I was able to get it working manually - gentoo's init scripts are out of |
4 |
> date with bluez 5, blutoothctl is broken (or probably just poorly |
5 |
> documented which equates to the same thing if the command doesn't work) . |
6 |
> |
7 |
> In bluetoothctl: |
8 |
> power on |
9 |
> scan on |
10 |
> agent on |
11 |
> default-agent |
12 |
> pair <dev_id> |
13 |
> trust <dev_id> |
14 |
> exit |
15 |
> |
16 |
> In a shell: |
17 |
> rfcomm bind rfcomm0 <dev_id> |
18 |
> |
19 |
> do serial port stuff with /dev/rfcomm0 |
20 |
> |
21 |
> rfcomm unbind rfcomm0 |
22 |
> |
23 |
> bluetoothctl connect command does not work - connects and immediately |
24 |
> disconnects with an error |
25 |
> gentoo's rfcomm initscript has removed the -f flag which bluez 5 does |
26 |
> not have, but it also looks like the bind all in the 5.17 ebuild is also |
27 |
> not supported by late bluez5 so it immediately exits and no rfcomm |
28 |
> device is created. |
29 |
> |
30 |
> Ive adapted my python script to the changes now - but the pairing does |
31 |
> not survive restarting bluetooth so I'll need an expect script to set it |
32 |
> up each bluetooth re-init as it looks like there are no scripting hooks |
33 |
> in bluetoothctl. |
34 |
> |
35 |
> BillK |
36 |
|
37 |
Thanks BillK, your suggestions above helped somewhat, because I was able to |
38 |
connect with my phone, but it didn't get me far enough. I was not able to |
39 |
connect with rfcomm to my mobile. When I ran 'pon <connection_name>' pppd |
40 |
started, but I got errors like: |
41 |
|
42 |
Apr 26 18:15:12 dell_xps chat[29579]: -- write failed: Transport endpoint is |
43 |
not connected |
44 |
Apr 26 18:15:12 dell_xps chat[29579]: Failed |
45 |
|
46 |
|
47 |
This was despite the fact that I had created manually the rfcomm0 device and |
48 |
binded it to the bdaddr of my phone as you suggested. |
49 |
|
50 |
Googling for this error revealed that this is because the rfcomm code has |
51 |
changed - but there is a patch which may fix things: |
52 |
|
53 |
http://comments.gmane.org/gmane.linux.bluez.kernel/42303 |
54 |
|
55 |
|
56 |
I ran out of time and did not try 'rfcomm connect' instead of 'rfcomm bind' to |
57 |
see if it makes a difference in my case. |
58 |
|
59 |
FYI, I'm on net-wireless/bluez-5.15 and kernel 3.12.13-gentoo. |
60 |
-- |
61 |
Regards, |
62 |
Mick |