Re: [gentoo-user] Re: bluez 5 not connecting

2014-06-01 Thread Mick
On Friday 30 May 2014 06:34:13 Mick wrote:
> On Thursday 29 May 2014 23:32:55 William Kenworthy wrote:
> > I am not using systemd either - there is no bluetoothctl service (its an
> > application and written with no remote control capabilities - why?: no
> > idea - in my reading I came across a message saying that its designed
> > for use with systemd but I thought it would still need the remote option
> > unless bluetoothctl like functions are natively included in systemd)
> > 
> > You will probably have to load the modules manually
> > (/etc/conf.d/modules) - mine do load automatically though
> 
> Right, so did mine until recently.  I'm guessing that it's something to do
> with udev, or with changes in the kernel that affect my Broadcom bluetooth
> chip.
> 
> > moriah ~ # lsmod|grep bt
> > btusb  14099  0
> > bluetooth 191573  24 bnep,btusb,rfcomm
> > usbcore   132770  10
> > btusb,usblp,uhci_hcd,usb_storage,usbserial,ehci_hcd,ehci_pci,usbhid,ftdi_
> > si o,cdc_acm moriah ~ #
> > 
> > Sounds like you have more than one problem and you need to get the
> > modules loaded and working first, then you can run bluetoothctl manually.
> 
> I already tried that.  The modules load, hciconfig works to bring up hci0,
> but bluetoothctl complains that there is no available bluetooth
> controller.  :-/

I tried bluetooth with another laptop - also broadcom bluetooth but a 
different chip.  Well, what do you know.  I had to manually modprobe bnep and 
rfcomm, but /etc/init.d/bluetooth started without complaining that it needs 
the rfcomm service and bluetoothctl worked fine showing the bt controller SSID 
and other devices in the vicinity.

So the problem seems to be with the particular broadcom BCM2046 Bluetooth 
device that I have on my laptop.  :-(

I've posted in the forums in case someone there has any ideas.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-29 Thread Mick
On Thursday 29 May 2014 23:32:55 William Kenworthy wrote:

> I am not using systemd either - there is no bluetoothctl service (its an
> application and written with no remote control capabilities - why?: no
> idea - in my reading I came across a message saying that its designed
> for use with systemd but I thought it would still need the remote option
> unless bluetoothctl like functions are natively included in systemd)
> 
> You will probably have to load the modules manually
> (/etc/conf.d/modules) - mine do load automatically though

Right, so did mine until recently.  I'm guessing that it's something to do 
with udev, or with changes in the kernel that affect my Broadcom bluetooth 
chip.


> moriah ~ # lsmod|grep bt
> btusb  14099  0
> bluetooth 191573  24 bnep,btusb,rfcomm
> usbcore   132770  10
> btusb,usblp,uhci_hcd,usb_storage,usbserial,ehci_hcd,ehci_pci,usbhid,ftdi_si
> o,cdc_acm moriah ~ #
> 
> Sounds like you have more than one problem and you need to get the
> modules loaded and working first, then you can run bluetoothctl manually.

I already tried that.  The modules load, hciconfig works to bring up hci0, but 
bluetoothctl complains that there is no available bluetooth controller.  :-/
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-29 Thread William Kenworthy
On 29/05/14 18:18, Mick wrote:
> On Thursday 29 May 2014 07:27:24 Mick wrote:
>> On Thursday 29 May 2014 00:05:16 William Kenworthy wrote:
>>> On 29/05/14 06:28, Mick wrote:
 On Wednesday 28 May 2014 20:02:29 Samuli Suominen wrote:
> On 28/05/14 21:42, Mick wrote:
>> Hmm ... am I alone in this quest?
>
> See here, http://bugs.gentoo.org/show_bug.cgi?id=505362

 Thanks!  I missed this bug when I glanced earlier.  However, it does
 not mention rfcomm is now missing, or the fact that the gentoo rc
 script fails to initialise bluethooth and complains about rfcomm
 service not having started/exist, or that bluetoothctl now does not
 work at all.  Is all this down to a missing udev rule?
>>>
>>> No its the fact that bluez 5 has been redesigned to fit in more with the
>>> systemd world.
>>

I am not using systemd either - there is no bluetoothctl service (its an
application and written with no remote control capabilities - why?: no
idea - in my reading I came across a message saying that its designed
for use with systemd but I thought it would still need the remote option
unless bluetoothctl like functions are natively included in systemd)

You will probably have to load the modules manually
(/etc/conf.d/modules) - mine do load automatically though

moriah ~ # lsmod|grep bt
btusb  14099  0
bluetooth 191573  24 bnep,btusb,rfcomm
usbcore   132770  10
btusb,usblp,uhci_hcd,usb_storage,usbserial,ehci_hcd,ehci_pci,usbhid,ftdi_sio,cdc_acm
moriah ~ #

Sounds like you have more than one problem and you need to get the
modules loaded and working first, then you can run bluetoothctl manually.

BillK




Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-29 Thread Mick
On Thursday 29 May 2014 07:27:24 Mick wrote:
> On Thursday 29 May 2014 00:05:16 William Kenworthy wrote:
> > On 29/05/14 06:28, Mick wrote:
> > > On Wednesday 28 May 2014 20:02:29 Samuli Suominen wrote:
> > >> On 28/05/14 21:42, Mick wrote:
> > >>> Hmm ... am I alone in this quest?
> > >> 
> > >> See here, http://bugs.gentoo.org/show_bug.cgi?id=505362
> > > 
> > > Thanks!  I missed this bug when I glanced earlier.  However, it does
> > > not mention rfcomm is now missing, or the fact that the gentoo rc
> > > script fails to initialise bluethooth and complains about rfcomm
> > > service not having started/exist, or that bluetoothctl now does not
> > > work at all.  Is all this down to a missing udev rule?
> > 
> > No its the fact that bluez 5 has been redesigned to fit in more with the
> > systemd world.
> 
> I see.  No systemd here, other than systemd's udev.
> 
> > it works if:
> > 
> > remove rfcomm using rc-update
> 
> I didn't have to remove it because it wasn't there ... no rfcomm service
> anymore, or any /etc/conf.d/rfcomm file.  There is a /etc/conf.d/bluetooth
> showing:
> 
> # Bluetooth configuraton file
> 
> # Bind rfcomm devices (allowed values are "true" and "false")
> RFCOMM_ENABLE=true
> 
> # Config file for rfcomm
> RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"
> 
> 
> > /etc/init.d/bluetoothctl restart (get rid of any existing config)
> 
> Ahh!  I have no /etc/init.d/bluetoothctl service, only
> /etc/init.d/bluetooth
> 
> Am I missing some package for it?  Interestingly the module bt_rfcomm was
> not initialised by udev and I had to modprobe it manually ...
> 
> # lsmod | grep bt
> btusb  14115  0
> bluetooth 173578  5 btusb,rfcomm
> 
> > bluetoothctl
> > power on
> > scan on
> > agent on
> > default-agent
> > trust [MAC ADDRESS OF CLIENT]
> > pair [MAC ADDRESS OF CLIENT]
> > enter PIN when requested
> > wait for "Connected: no"
> > exit
> 
> Unfortunately, none of the above works anymore for me:
> 
> [bluetooth]# power on
> No default controller available
> [bluetooth]# scan on
> No default controller available
> [bluetooth]# agent on
> Agent registration enabled
> [bluetooth]# default-agent
> No agent is registered
> [bluetooth]#
> 
> > After this you should have an rfcomm channel available to the client.  I
> > have the above in an expect script as bluetoothctl has no inate remote
> > controllability capabilities.  No separate pairing app or rfcomm init
> > script needed.
> 
> I do not get a /dev/rfcommX, unless I manually set it up like so:
> 
> # rfcomm bind rfcomm0 hci0
> # ls -la /dev/rfcomm*
> crw-rw 1 root uucp 216, 0 May 29 07:06 /dev/rfcomm0
> 
> and hci0 will not come up unless I start it with hciconfig.  Despite all
> this manual intervention bluetooth does not have access or use the rfcomm
> device, although 'hcitool scan' and 'sdptool browse' return results from
> my mobile phone.
> 
> Please note I have not used the previous patch you have posted on the list.
> 
> These are the BT modules in my 3.12.20-gentoo kernel:
> 
> $ grep -i BT /usr/src/linux/.config
> CONFIG_BT=m
> CONFIG_BT_RFCOMM=m
> CONFIG_BT_RFCOMM_TTY=y
> CONFIG_BT_BNEP=m
> CONFIG_BT_BNEP_MC_FILTER=y
> CONFIG_BT_BNEP_PROTO_FILTER=y
> CONFIG_BT_HIDP=m
> CONFIG_BT_HCIBTUSB=m
> CONFIG_BT_HCIBTSDIO=m
> # CONFIG_BT_HCIUART is not set
> CONFIG_BT_HCIBCM203X=m
> # CONFIG_BT_HCIBPA10X is not set
> # CONFIG_BT_HCIBFUSB is not set
> # CONFIG_BT_HCIDTL1 is not set
> # CONFIG_BT_HCIBT3C is not set
> # CONFIG_BT_HCIBLUECARD is not set
> # CONFIG_BT_HCIBTUART is not set
> # CONFIG_BT_HCIVHCI is not set
> # CONFIG_BT_MRVL is not set
> # CONFIG_BT_ATH3K is not set
> CONFIG_MAC_EMUMOUSEBTN=y
> # CONFIG_INPUT_ATLAS_BTNS is not set
> # CONFIG_VIDEO_USBTV is not set
> # CONFIG_SND_BT87X is not set
> # CONFIG_USB_BTMTK is not set
> # CONFIG_TOSHIBA_BT_RFKILL is not set
> # CONFIG_BTRFS_FS is not set
> # CONFIG_RBTREE_TEST is not set
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> 
> and I don't recall changing any of them since the good ol' bluez-4 days.


Hmm... also noticed that BT_HCIBCM203X is not loaded either.  This is what 
dmesg shows:
=
... 
[2.778306] usb 2-1.6: new full-speed USB device number 3 using ehci-pci
[2.795308] hub 2-1:1.0: port 6 not reset yet, waiting 10ms
[2.844701] psmouse serio1: synaptics: Touchpad model: 1, fw: 7.2, id: 
0x1c0b1, caps: 0xd04733/0xa4/0xa, board id: 3655, fw id: 579772
[2.870246] usb 2-1.6: ep0 maxpacket = 8
[2.873102] usb 2-1.6: default language 0x0409
[2.873610] usb 2-1.6: udev 3, busnum 2, minor = 130
[2.873617] usb 2-1.6: New USB device found, idVendor=0a5c, idProduct=4500
[2.879698] usb 2-1.6: New USB device strings: Mfr=1, Product=2, 
SerialNumber=0
[2.884038] usb 2-1.6: Product: BCM2046B1
[2.888341] usb 2-1.6: Manufacturer:

Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-28 Thread Mick
On Thursday 29 May 2014 00:05:16 William Kenworthy wrote:
> On 29/05/14 06:28, Mick wrote:
> > On Wednesday 28 May 2014 20:02:29 Samuli Suominen wrote:
> >> On 28/05/14 21:42, Mick wrote:
> >>> Hmm ... am I alone in this quest?
> >> 
> >> See here, http://bugs.gentoo.org/show_bug.cgi?id=505362
> > 
> > Thanks!  I missed this bug when I glanced earlier.  However, it does not
> > mention rfcomm is now missing, or the fact that the gentoo rc script
> > fails to initialise bluethooth and complains about rfcomm service not
> > having started/exist, or that bluetoothctl now does not work at all.  Is
> > all this down to a missing udev rule?
> 
> No its the fact that bluez 5 has been redesigned to fit in more with the
> systemd world.

I see.  No systemd here, other than systemd's udev.


> it works if:
> 
> remove rfcomm using rc-update

I didn't have to remove it because it wasn't there ... no rfcomm service 
anymore, or any /etc/conf.d/rfcomm file.  There is a /etc/conf.d/bluetooth 
showing:

# Bluetooth configuraton file

# Bind rfcomm devices (allowed values are "true" and "false")
RFCOMM_ENABLE=true

# Config file for rfcomm
RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"



> /etc/init.d/bluetoothctl restart (get rid of any existing config)

Ahh!  I have no /etc/init.d/bluetoothctl service, only /etc/init.d/bluetooth

Am I missing some package for it?  Interestingly the module bt_rfcomm was not 
initialised by udev and I had to modprobe it manually ...

# lsmod | grep bt
btusb  14115  0 
bluetooth 173578  5 btusb,rfcomm

> bluetoothctl
> power on
> scan on
> agent on
> default-agent
> trust [MAC ADDRESS OF CLIENT]
> pair [MAC ADDRESS OF CLIENT]
> enter PIN when requested
> wait for "Connected: no"
> exit

Unfortunately, none of the above works anymore for me:

[bluetooth]# power on
No default controller available
[bluetooth]# scan on
No default controller available
[bluetooth]# agent on
Agent registration enabled
[bluetooth]# default-agent 
No agent is registered
[bluetooth]#


> After this you should have an rfcomm channel available to the client.  I
> have the above in an expect script as bluetoothctl has no inate remote
> controllability capabilities.  No separate pairing app or rfcomm init
> script needed.

I do not get a /dev/rfcommX, unless I manually set it up like so:

# rfcomm bind rfcomm0 hci0
# ls -la /dev/rfcomm*
crw-rw 1 root uucp 216, 0 May 29 07:06 /dev/rfcomm0

and hci0 will not come up unless I start it with hciconfig.  Despite all this 
manual intervention bluetooth does not have access or use the rfcomm device, 
although 'hcitool scan' and 'sdptool browse' return results from my mobile 
phone.

Please note I have not used the previous patch you have posted on the list.

These are the BT modules in my 3.12.20-gentoo kernel:

$ grep -i BT /usr/src/linux/.config
CONFIG_BT=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTSDIO=m
# CONFIG_BT_HCIUART is not set
CONFIG_BT_HCIBCM203X=m
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIDTL1 is not set
# CONFIG_BT_HCIBT3C is not set
# CONFIG_BT_HCIBLUECARD is not set
# CONFIG_BT_HCIBTUART is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
# CONFIG_BT_ATH3K is not set
CONFIG_MAC_EMUMOUSEBTN=y
# CONFIG_INPUT_ATLAS_BTNS is not set
# CONFIG_VIDEO_USBTV is not set
# CONFIG_SND_BT87X is not set
# CONFIG_USB_BTMTK is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_RBTREE_TEST is not set
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y

and I don't recall changing any of them since the good ol' bluez-4 days.
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-28 Thread William Kenworthy
On 29/05/14 06:28, Mick wrote:
> On Wednesday 28 May 2014 20:02:29 Samuli Suominen wrote:
>> On 28/05/14 21:42, Mick wrote:
>>> Hmm ... am I alone in this quest?
>>
>> See here, http://bugs.gentoo.org/show_bug.cgi?id=505362
> 
> Thanks!  I missed this bug when I glanced earlier.  However, it does not 
> mention rfcomm is now missing, or the fact that the gentoo rc script fails to 
> initialise bluethooth and complains about rfcomm service not having 
> started/exist, or that bluetoothctl now does not work at all.  Is all this 
> down to a missing udev rule?
> 

No its the fact that bluez 5 has been redesigned to fit in more with the
systemd world.

it works if:

remove rfcomm using rc-update
/etc/init.d/bluetoothctl restart (get rid of any existing config)

bluetoothctl
power on
scan on
agent on
default-agent
trust [MAC ADDRESS OF CLIENT]
pair [MAC ADDRESS OF CLIENT]
enter PIN when requested
wait for "Connected: no"
exit

After this you should have an rfcomm channel available to the client.  I
have the above in an expect script as bluetoothctl has no inate remote
controllability capabilities.  No separate pairing app or rfcomm init
script needed.

BillK




Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-28 Thread Mick
On Wednesday 28 May 2014 20:02:29 Samuli Suominen wrote:
> On 28/05/14 21:42, Mick wrote:
> > Hmm ... am I alone in this quest?
> 
> See here, http://bugs.gentoo.org/show_bug.cgi?id=505362

Thanks!  I missed this bug when I glanced earlier.  However, it does not 
mention rfcomm is now missing, or the fact that the gentoo rc script fails to 
initialise bluethooth and complains about rfcomm service not having 
started/exist, or that bluetoothctl now does not work at all.  Is all this 
down to a missing udev rule?

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-28 Thread Samuli Suominen

On 28/05/14 21:42, Mick wrote:
> Hmm ... am I alone in this quest? 

See here, http://bugs.gentoo.org/show_bug.cgi?id=505362



Re: [gentoo-user] Re: bluez 5 not connecting

2014-05-28 Thread Mick
On Sunday 27 Apr 2014 08:27:31 William Kenworthy wrote:
> 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 
> >>> trust 
> >>> exit
> >>> 
> >>> In a shell:
> >>> rfcomm bind rfcomm0 
> >>> 
> >>> 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
> >> ' 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?)

This is getting worse!  O_O

I am on net-wireless/bluez-5.18 and gentoo-sources-3.12.20 without the patch.

Now I have no rfcomm service at all listed under rc-update and if I try to 
start /etc/init.d/bluetooth I get:

# /etc/init.d/bluetooth restart
 * ERROR: bluetooth needs service(s) rfcomm


Creating /dev/rfcomm0 with:

# rfcomm bind rfcomm0 hci0

does not change the error.  Starting KDE's BlueDevil shows no adaptor found.  
Indeed, hci0 is not configured.  O_o

So, running:

# hciconfig hci0 up

allows me to list it:

$ hcitool dev 
Devices:
hci090:4C:E5:FA:F2:A8

but NOT under bluetoothctl!

[bluetooth]# power on
No default controller available
[bluetooth]# show
No default controller available
[bluetooth]# list
[bluetooth]#
[bluetooth]# devices
[bluetooth]# 

NOTE: using hcitool I can scan my mobile phone, but without rfcomm I can't use 
it.


Hmm ... am I alone in this quest?

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-04-27 Thread William Kenworthy
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 
>>> trust 
>>> exit
>>>
>>> In a shell:
>>> rfcomm bind rfcomm0 
>>>
>>> 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 ' 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




Re: [gentoo-user] Re: bluez 5 not connecting

2014-04-26 Thread William Kenworthy
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 
>> trust 
>> exit
>>
>> In a shell:
>> rfcomm bind rfcomm0 
>>
>> 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 ' 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





Re: [gentoo-user] Re: bluez 5 not connecting

2014-04-26 Thread Mick
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 
> trust 
> exit
> 
> In a shell:
> rfcomm bind rfcomm0 
> 
> 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 ' 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.
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: bluez 5 not connecting

2014-04-23 Thread William Kenworthy
On 04/24/14 01:06, James wrote:
> William Kenworthy  iinet.net.au> writes:
> 
> 
>> The bluez-5 stack is causing me some problems. 
>> What am I missing/misunderstanding?
> 
> These wireless protocols, have many versions (variants) and 
> nuances via the prticular hardware that is used. Some light 
> reading might better postion you?
> 
> 
> https://www.usenix.org/legacy/event/woot07/tech/full_papers/
> spill/spill_html/index.html
> 
> http://www.ti.com/tool/packet-sniffer
> 
> net-wireless/bluez-hcidump (never tried this one)
> 
> 
> I would think that there should be some open-source Bluetooth packet
> sniffers that may help diagnose the problem.
> 
> I was able to find :
> 
> MAC Address PrefixManufacturer
> 001103kawamura electric inc.
> 
> 
> using the MAC address. Perhaps an email to their tech support
> descriping your problems might help?
> 
> I suggest you dissect the packets and hardware and look for the issue
> to your problem. Can you move the BT device to a winblozs box and 
> see if it works? Amplifiers die all the time, particularly if they
> are overheated or fed noisy power..
> 
> could be hardware or software related. dissect the pieces,
> 
> HTH,
> good_hunting!
> James
> 
> 

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 
trust 
exit

In a shell:
rfcomm bind rfcomm0 

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