On 04/27/14 11:14, William Kenworthy wrote: > On 04/27/14 02:33, Mick wrote: >> On Thursday 24 Apr 2014 02:11:57 William Kenworthy wrote: >> >>> I was able to get it working manually - gentoo's init scripts are out of >>> date with bluez 5, blutoothctl is broken (or probably just poorly >>> documented which equates to the same thing if the command doesn't work) . >>> >>> In bluetoothctl: >>> power on >>> scan on >>> agent on >>> default-agent >>> pair <dev_id> >>> trust <dev_id> >>> exit >>> >>> In a shell: >>> rfcomm bind rfcomm0 <dev_id> >>> >>> do serial port stuff with /dev/rfcomm0 >>> >>> rfcomm unbind rfcomm0 >>> >>> bluetoothctl connect command does not work - connects and immediately >>> disconnects with an error >>> gentoo's rfcomm initscript has removed the -f flag which bluez 5 does >>> not have, but it also looks like the bind all in the 5.17 ebuild is also >>> not supported by late bluez5 so it immediately exits and no rfcomm >>> device is created. >>> >>> Ive adapted my python script to the changes now - but the pairing does >>> not survive restarting bluetooth so I'll need an expect script to set it >>> up each bluetooth re-init as it looks like there are no scripting hooks >>> in bluetoothctl. >>> >>> BillK >> >> Thanks BillK, your suggestions above helped somewhat, because I was able to >> connect with my phone, but it didn't get me far enough. I was not able to >> connect with rfcomm to my mobile. When I ran 'pon <connection_name>' pppd >> started, but I got errors like: >> >> Apr 26 18:15:12 dell_xps chat[29579]: -- write failed: Transport endpoint >> is >> not connected >> Apr 26 18:15:12 dell_xps chat[29579]: Failed >> >> >> This was despite the fact that I had created manually the rfcomm0 device and >> binded it to the bdaddr of my phone as you suggested. >> >> Googling for this error revealed that this is because the rfcomm code has >> changed - but there is a patch which may fix things: >> >> http://comments.gmane.org/gmane.linux.bluez.kernel/42303 >> >> >> I ran out of time and did not try 'rfcomm connect' instead of 'rfcomm bind' >> to >> see if it makes a difference in my case. >> >> FYI, I'm on net-wireless/bluez-5.15 and kernel 3.12.13-gentoo. >> > > I just upgraded to 3.12.13 and it stopped working with the same error > you have. > > I did see some other messages saying that certain kernel versions are > broken but I'll now need to look into that now. > > BillK > > >
I used the patch from the reply above - worked! It did take a couple of goes but after restarting the bluetooth initscript before using bluetoothctl via expect (took 3 goes before I got a clean run from "expect" - timing might need adjusting?) BillK