Unix Technical Forum

bluetooth linux box not discoverable?

This is a discussion on bluetooth linux box not discoverable? within the Linux Operating System forums, part of the Unix Operating Systems category; --> hi, running 2.6.13 with bluez 3.4 and have come across a problem trying to connect bluetooth devices (in particular, ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 06:33 PM
-r dind
 
Posts: n/a
Default bluetooth linux box not discoverable?

hi,

running 2.6.13 with bluez 3.4 and have come across a problem trying to
connect bluetooth devices (in particular, my sony ericsson w800i) to my
linux box.

i am able to 12ping the w800i and "hcitool scan" works but when i ask
the w800i to discover new bluetooth, it is unable to find my linux box.

however, using "obexftp -b -l", the w800i gets a connection from my
linux box and states "unknown requests access to your items" and i
accept this request and it then tries to add the phone to its known
devices at which point it asks for pin which i enter (same as listed in
/etc/bluetooth and set in /etc/bluetooth/hcid.conf)

this connection fails and there are no obvious errors in the
/var/log/messages -- i've even disbaled the security manager in
hcid.conf (security none)

i dont know if this is because the hci device is not setup correctly
(iscan vs pscan?) as hcid.conf lists "iscan enable;" followd by "pscan
enable;"

does anyone know where i'm going wrong?
thanks
-r

# hciconfig -a
hci0: Type: USB
BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:12448 acl:176 sco:0 events:322 errors:0
TX bytes:4767 acl:157 sco:0 commands:104 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'BlueZ@marty (0)'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing, Object Transfer,
Audio
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 06:33 PM
gort
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


> however, using "obexftp -b -l", the w800i gets a connection from my
> linux box and states "unknown requests access to your items" and i
> accept this request and it then tries to add the phone to its known
> devices at which point it asks for pin which i enter (same as listed in
> /etc/bluetooth and set in /etc/bluetooth/hcid.conf)


This pin number, what do you mean its listed?. On my Mandriva box and
Nokia 6680 they both ask for the pin to be entered and I just make up a 4
digit pin usually 2222. Its a manual entry, nothing listed anywhere.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 06:33 PM
-r dind
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


gort wrote:
> > however, using "obexftp -b -l", the w800i gets a connection from my
> > linux box and states "unknown requests access to your items" and i
> > accept this request and it then tries to add the phone to its known
> > devices at which point it asks for pin which i enter (same as listed in
> > /etc/bluetooth and set in /etc/bluetooth/hcid.conf)

>
> This pin number, what do you mean its listed?. On my Mandriva box and
> Nokia 6680 they both ask for the pin to be entered and I just make up a 4
> digit pin usually 2222. Its a manual entry, nothing listed anywhere.
>
> Dave


the pin is listed in /etc/bluetooth/hcid.conf under the "options"
section, with the item:

# Default PIN code for incoming connections
passkey "1234";

and also in /etc/bluetooth/pin.

can you post your working hcid.conf file so i can compare?

the obexftp shows that the connection is refused.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 06:33 PM
-r dind
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?

the other thing that is a possibility, is that hciconfig reports

hci0: Type: USB
BD Address: 00:0E:9B:68:B8:37 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:2129 acl:33 sco:0 events:70 errors:0
TX bytes:1147 acl:29 sco:0 commands:32 errors:0

the problem is that there is no ISCAN listed (allow for incoming
inquiries/discoverable)

but since the /etc/bluetooth/hcid.conf has the iscan/pscan lines i
thought this would be sufficient.. can anyone tell me where i would
need to look to see where the hci device is setup so i can try changing
the scan mode?

thanks
-r

# /etc/bluetooth/hcid.conf
options {
autoinit yes;
security auto;
pairing multi;
passkey "1234";
}

device {
name "BlueZ@%h (%d)";

class 0x3e0100;

# Inquiry and Page scan
iscan enable;
pscan enable;

lm accept;
lp rswitch,hold,sniff,park;
}

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 06:33 PM
-r dind
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


-r dind wrote:
> the other thing that is a possibility, is that hciconfig reports
>
> hci0: Type: USB
> BD Address: 00:0E:9B:68:B8:37 ACL MTU: 192:8 SCO MTU: 64:8
> UP RUNNING PSCAN
> RX bytes:2129 acl:33 sco:0 events:70 errors:0
> TX bytes:1147 acl:29 sco:0 commands:32 errors:0
>
> the problem is that there is no ISCAN listed (allow for incoming
> inquiries/discoverable)


actually, killing off the hcid and sdpd daemons and doing:

hcid; sdpd; hciconfig hci0 up piscan noauth

still shows up as (just pscan!!!)

hci0: Type: USB
BD Address: 00:0E:9B:68:B8:37 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN

any thoughts?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 06:33 PM
gort
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


>> This pin number, what do you mean its listed?. On my Mandriva box and
>> Nokia 6680 they both ask for the pin to be entered and I just make up a 4
>> digit pin usually 2222. Its a manual entry, nothing listed anywhere.
>>
>> Dave

>
> the pin is listed in /etc/bluetooth/hcid.conf under the "options"
> section, with the item:
>
> # Default PIN code for incoming connections
> passkey "1234";
>
> and also in /etc/bluetooth/pin.
>
> can you post your working hcid.conf file so i can compare?


Here you are, but I don't think its going to help you

#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
#

# 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 user;

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

# PIN helper
pin_helper /bin/bluepin;

# D-Bus PIN helper
dbus_pin_helper;
}

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

# Local device class
class 0x3e0100;

# 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;

# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}

I think you just need to enter any old 4 digit pin on both devices.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-18-2008, 06:33 PM
gort
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


Just had a look at /etc/bluetooth/pin, shows just 1234, I think thats
just a place holder. But it always asks for pin when I connect phone so
I am still convinced you just need to make up a pin, same for both
devices, when you connect.

HTH

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-18-2008, 06:33 PM
-r dind
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


gort wrote:
> Just had a look at /etc/bluetooth/pin, shows just 1234, I think thats
> just a place holder. But it always asks for pin when I connect phone so
> I am still convinced you just need to make up a pin, same for both
> devices, when you connect.
>
> HTH
>
> Dave


hciconfig show that ISCAN is not configured on the device so according
to the manpages this is the underlying problem -- the linux bluetooth
system is not allow itself to be discovered (also addressed here
http://thread.gmane.org/gmane.linux....86/focus=10386)

can you tell me which version of the bluez-utils you are using
("hcitool --version" should do it)

i can't test the solution detailed in the link at the moment but will
try it when i get out of the office

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-18-2008, 06:33 PM
gort
 
Posts: n/a
Default Re: bluetooth linux box not discoverable?


> hciconfig show that ISCAN is not configured on the device so according
> to the manpages this is the underlying problem -- the linux bluetooth
> system is not allow itself to be discovered (also addressed here
> http://thread.gmane.org/gmane.linux....86/focus=10386)
>
> can you tell me which version of the bluez-utils you are using
> ("hcitool --version" should do it)
>
> i can't test the solution detailed in the link at the moment but will
> try it when i get out of the office


Hcitool is version 2.19. I can see where yours is going wrong now, having
reread your post. I was wrong.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-18-2008, 06:34 PM
-r dind
 
Posts: n/a
Default Re: [RESOLVED] bluetooth linux box not discoverable?

success (thanks to the bluez mailing lists)!!!

there appears to be a bug in the bluez-libs 3.4 which means the linux
box will NOT be discoverable (ie ISCAN disabled)

to fix this, your /etc/bluetooth/hcid.conf must contains the line
"discovto 0" -- this option not listed in the hcid.conf manpage
(unfortunately).. below is my working cfg file

options {
autoinit yes;
security auto;
pairing multi;
passkey "1234";
}

device {
name "BlueZ@%h (%d)";
class 0x3e0100;

iscan enable;
pscan enable;
discovto 0; ### IMPORTANT ###

lm accept;
lp rswitch,hold,sniff,park;
}


restarting everything, i am able to have incoming connections and
hciconfig reports the correct cfg (PSCAN and ISCAN listed):

# hciconfig -a
hci0: Type: USB
BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:672 acl:0 sco:0 events:20 errors:0
TX bytes:322 acl:0 sco:0 commands:19 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'BlueZ@marty (0)'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing, Object Transfer,
Audio
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

and now 'obexftp -b -l' works!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com