You are not logged in.

#1 2007-04-30 11:00:05

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Problems with bluetooth

Hallo,

i have problem with my bluetooth devices. I have 4 devices:

1. Desktop (Archlinux, USB dongle bluetooth: Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode))
hci0:   Type: USB
        BD Address: 00:08:1B:02:35:16 ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN
        RX bytes:40784 acl:884 sco:0 events:1813 errors:0
        TX bytes:23923 acl:743 sco:0 commands:507 errors:0

2. Notebook (HP NX7400 with Archlinux, Integrated bluetooth, in lsusb is only Bus 001 Device 003: ID 03f0:171d Hewlett-Packard and its needn't be BT)
hci0:   Type: USB
        BD Address: 00:16:41:87:3D:92 ACL MTU: 1017:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:565 acl:0 sco:0 events:71 errors:0
        TX bytes:198 acl:0 sco:0 commands:31 errors:0

3. Palm Tungsten T2
4. Sony Ericsson T610

1. problem: Notebook and Desktop is switched to connectable (they isn't discoverable from T2 and T610) and I don't know how can i switch this mode sad If i change file /var/lib/bluetooth/00:16:41:87:3D:92/config at discoverable so it isn't work sad

2. problem: I can't pair my devices. T2 and T610 is OK, but Notebook with Desktop or T610 or T2 is problem. It same with Desktop and others. If i can found some devices at NB or Desktop so i cant connect with:

hcitool cc 00:16:41:87:3D:92

It create connection but only for few seconds sad

cx@delorean:~$ sudo hcitool cc 00:16:41:87:3D:92
cx@delorean:~$ sudo hcitool con
Connections:
        < ACL 00:16:41:87:3D:92 handle 42 state 1 lm MASTER
cx@delorean:~$ sudo hcitool con
Connections:
        < ACL 00:16:41:87:3D:92 handle 42 state 1 lm MASTER
cx@delorean:~$ sudo hcitool con
Connections:
cx@delorean:~$ sudo hcitool con
Connections:

If i try:

cx@delorean:~$ sudo hcitool cc 00:16:41:87:3D:92; sudo hcitool auth 00:16:41:87:3D:92

I get:

HCI authentication request failed: Connection timed out

3. problem: I don't know how but i paired my desktop and T2, but if i want create connection between desktop and T2 with rfcomm

sudo rfcomm bind 0 00:07:E0:10:74:7E 1

everything is ok, but if i try send some data to T2

pilot-xfer -p /dev/rfcomm0 -i data/inst/palm/new/Phoinix.prc

i get only

Listening for incoming connection on /dev/rfcomm0...

and T2 get "Connection in progress..." there is end and desktop send nothing to T2 sad

I don't know where i do mistake sad Can you help me? Same problems i have with my notebook.

Logs and files:

Apr 30 12:20:05 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool auth 00:16:41:87:3D:92
Apr 30 12:20:50 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:20:53 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:20:55 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:20:56 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:20:57 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:20:57 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:20:58 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:20:59 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:34:18 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:34:25 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool auth 00:16:41:87:3D:92
Apr 30 12:37:33 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:37:38 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:37:39 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:37:41 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:37:42 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:37:42 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:37:43 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool con
Apr 30 12:39:07 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:39:08 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool auth 00:16:41:87:3D:92
Apr 30 12:43:15 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:43:16 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool auth 00:16:41:87:3D:92
Apr 30 12:43:52 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:43:53 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:43:59 delorean sudo:       cx : TTY=pts/2 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/hcitool cc 00:16:41:87:3D:92
Apr 30 12:46:16 delorean sudo:       cx : TTY=pts/1 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/rfcomm bind 0 00:07:E0:10:74:7E 1
Apr 30 12:46:25 delorean sudo:       cx : TTY=pts/1 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/rfcomm release 0
Apr 30 12:46:26 delorean sudo:       cx : TTY=pts/1 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/rfcomm bind 0 00:07:E0:10:74:7E 1
Apr 30 12:51:33 delorean sudo:       cx : TTY=pts/1 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/tail -n 30 /var/log/everything.log
Apr 30 12:51:46 delorean sudo:       cx : TTY=pts/1 ; PWD=/home/cx ; USER=root ; COMMAND=/usr/bin/tail -n 30 /var/log/messages.log

Log is clean sad

cx@delorean:~$ lsmod | grep blue
bluetooth              46564  6 hidp,hci_uart,bnep,rfcomm,l2cap,hci_usb
cx@delorean:~$ ps aux | grep hci
root     24924  0.0  0.1   2076   864 ?        Ss   12:53   0:00 /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
cx       24933  0.0  0.1   2340   812 pts/1    R+   12:53   0:00 grep hci
cx@delorean:~$ ps aux | grep sdp
root     18903  0.0  0.0   1632   508 ?        Ss   Apr29   0:00 /usr/sbin/sdpd
cx       24935  0.0  0.1   2344   816 pts/1    R+   12:54   0:00 grep sdp
cx@delorean:~$ ps aux | grep dbus
dbus     19060  0.0  0.1   2208   924 ?        Ss   Apr29   0:00 /usr/bin/dbus-daemon --system
cx       24940  0.0  0.1   2344   812 pts/1    R+   12:54   0:00 grep dbus
cx@delorean:~$ cat /etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security auto;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        #pin_helper /usr/local/bin/static_pin;
        # PIN helper
        pin_helper /etc/bluetooth/givepin;

        # Default PIN code for incoming connections
        #passkey "1111";
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "BlueZ (%d)";

        #pin_helper /usr/local/bin/static_pin;
        # Local device class
        class 0x3e0100;
        #class 0x000100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable;
        pscan enable;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm accept;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;
}
cx@delorean:~$ /etc/bluetooth/givepin
PIN:1111

Offline

#2 2007-05-01 11:43:31

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

Hallo again,

i solved first problem.  Problem was in hcid.conf.
pin_helper give me error so i must used passkey and set security to auto. Pairing from T2 to Notebook is OK. Pairing from notebook to T2 is still problem sad (but it's not so bad:) )

Next problem was in discoverable of device. Discoverable i seted in /var/lib/bluetooth/<BDADDR>/config and i changed "connecable" to "discoverable". After restart bluetooth daemons it was ok. Next modification in my hcid.conf is add "discove 0;" to device part. It set up device on discoverable all of time.

Offline

#3 2007-05-02 09:45:45

sH
Member
From: Braunschweig, Germany
Registered: 2007-05-02
Posts: 145

Re: Problems with bluetooth

Hi Cx,

as it seems you have a lot of experience with command-line tools, maybe you can answer a question.
I have problems with bluetooth using kdebluetooth.
I googled the net and found out, that new "bluez" dropped "pin_helper" support. Kdebluetooth expects a pin-helper to be present,
when trying to pair devices. So the mobile phone is asked a PIN and then the connection will break because the workstation does not
pop up a PIN-dialog.
When using "bluez-gnome" you can set your workstation to "visible" and then pairing works. bluez-gnome uses a way to connect that
is compatible with the new bluez.

But from my understanding I think it must be possible without all these GUI programs to connect the devices, even more when I have set "security" to "none" or "auto", it should not need a dialog on the workstation as there should be no PIN needed.

But my Workstation is not visible from the mobile phone, only with gnome "bluetooth-applet" running that seems to make it's own settings.

Do you know how to set my Workstation "visible" for the mobile phone with command line stuff?

Thanks.

Offline

#4 2007-05-02 11:10:19

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

Yeah.. i wrote it.

You must edit file /var/lib/bluetooth/<BDADDR_YOUR_DEVICE>/config. There "connecable" change to "discoverable" and then restart the bluetooth daemons (maybe only hcid). Next thing is hcid change your visibility in the time. You can change this with "discove 0;" in hcid.conf (in device part). It set discoverable to all time.

Good website is this: http://www.die.net/doc/linux/man/man5/hcid.conf.5.html

Enjoy smile

Offline

#5 2007-05-03 15:48:25

Oafed
Member
Registered: 2007-05-03
Posts: 3

Re: Problems with bluetooth

Cx - I am having a very similar issue to your problem 2.

I am trying to connect a device and it stays connected for only a couple seconds after I do "sudo hcitool cc [mac]".  The only difference from yours is that when I do sudo hcitool cc [mac]; sudo hcitool auth [mac] I get "HCI authentication request failed: input/output error".  I can see the device just fine when I run "hcitool scan".  Just cant get it to stay connected.

I've tried different bluetooth dongles and they all do the same thing.  I would really appreciate any suggestions you have.

Offline

#6 2007-05-03 16:47:06

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

Oafed: Now i have problem only if i pairing from linux to device. If i pairing different way it's everything ok, i don't know why sad Try set hcid.conf as me and try pair from device to linux.

Today solved my third problem. More likely i go around smile This is my rfcomm.conf:

#
# RFCOMM configuration file.
#

rfcomm0 {
#       # Automatically bind the device at startup
        bind yes;
#
#       # Bluetooth address of the device
        device 00:07:E0:10:74:7E;
#
#       # RFCOMM channel for the connection
        channel 3;
#
#       # Description of the connection
        comment "Moje T2";
}

I have problem with scan services on T2. On the net i found i can set channel 3 for rfcomm transfers and it's working. It's interesting sdptool browse don's show any services on T2, but on T610 is everything allright. Then i musted write to /etc/ppp/peers/dun this:

115200
noipdefault
proxyarp
ktune
192.168.2.30:192.168.2.31 # server : client
ms-dns 10.0.0.1
netmask 255.255.255.0
local
noauth
#nodefaultroute
noipx
debug
asyncmap 0

And finaly script which start dund, it's daemon which listening on incoming connection, create /dev/rfcommX link and run pppd. Script is here:

modprobe rfcomm
modprobe visor
modprobe l2cap

mknod /dev/ppp c 108 0

dund --listen --persist --msdun call dun

echo '1' > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i ppp0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

On the palm i musted set connection to PC, speed 115200, flux auto, bt connection to my linux and in the part of network a name of services (anything) and connection to our connection. Then sufficient press connect and it's working smile

I hope it have understandabled with my english and you can write me on my jabber cx@jabber.cz when you will want ask me for anything smile I'll try write some miniHOWTO with pictures smile

Offline

#7 2007-05-03 16:52:25

Oafed
Member
Registered: 2007-05-03
Posts: 3

Re: Problems with bluetooth

The device I use does not have the ability to initiate the pairing.  I have to pair it from Linux, which isn't working.  I'm still trying to figure out how to do it.  sad

Offline

#8 2007-05-03 16:55:33

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

It's bad sad What is it the device?

Offline

#9 2007-05-03 17:19:59

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

One idea:

try rfcomm connect 0 <btaddr>, it invoke pairing with my t2, but i din't know new bluez don't have pin_helper and my hcid.conf was bad.

Next, in man pages about hcid.conf is write this:

passkey "pin"
The default PIN for incoming connections if security has been set to auto.

so i don't know what PIN is using for outgoing connections sad  Good luck.

Offline

#10 2007-05-03 18:17:29

Oafed
Member
Registered: 2007-05-03
Posts: 3

Re: Problems with bluetooth

Below is what hcidump shows when I attempt to do an 'hcitool cc [mac]' on my device.  Its obviously disconnecting for some reason.  sad


hcidump result wrote:

< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
> HCI Event: Max Slots Change (0x1b) plen 3
> HCI Event: Command Status (0x0f) plen 4
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
> HCI Event: Command Complete (0x0e) plen 6
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4

Offline

#11 2007-05-03 20:54:38

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

I can't find hcidump in my arch, where are you find it? Can you try what is writing this: hcitool cc auth <bdaddr>? Every devices what i have tryed behavior same like this sad Maybe bug in bluez?

Offline

#12 2007-05-05 19:46:31

sH
Member
From: Braunschweig, Germany
Registered: 2007-05-02
Posts: 145

Re: Problems with bluetooth

Cx wrote:

Yeah.. i wrote it.

You must edit file /var/lib/bluetooth/<BDADDR_YOUR_DEVICE>/config. There "connecable" change to "discoverable" and then restart the bluetooth daemons (maybe only hcid). Next thing is hcid change your visibility in the time. You can change this with "discove 0;" in hcid.conf (in device part). It set discoverable to all time.

Good website is this: http://www.die.net/doc/linux/man/man5/hcid.conf.5.html

Enjoy smile

Still my SE W300i can't find my computer when I let it search for bluetooth devices. sad
Any other hint?

Offline

#13 2007-05-05 21:38:59

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

You can try restart your computer... it have been work at my computer.

Offline

#14 2007-05-18 20:19:34

Cx
Member
From: Czech Republic, Pardubice
Registered: 2007-03-12
Posts: 15

Re: Problems with bluetooth

Hallo again.. finally i have functional bluetooth in my desktop. My problem was in visibility of device (desktop) so i removed /var/lib/bluetooth/<bdaddr>/config and everything start work smile I am using setting which you can find up.

Problem with pairing from linux to device still i have, but i don't need it so someone can try solve it smile

Offline

Board footer

Powered by FluxBB