2006-08-23 21:18:07

by Jaime Alberto Silva

[permalink] [raw]
Subject: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

I'm forwarding this message I recently posted to debian-bugs in order
to see if some of you know how to solve the problem:

---------- Forwarded message ----------
From: Jaime Alberto Silva <[email protected]>
Date: Aug 23, 2006 3:53 PM
Subject: bluez-utils: The inquiry scan (ISCAN) gets turned off
To: Debian Bug Tracking System <[email protected]>


Package: bluez-utils
Version: 3.1-3.1
Severity: important

Whenever I try to discover the local system (Debian computer) from a remote
system (mobile device, or other computer) it can't be found. After
some research I found out that the ISCAN mode is disabled:

--------------------------------------------------------------------
# hciconfig hci0
hci0: Type: USB
BD Address: 00:0E:6D:3B:31:AE ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:3190 acl:16 sco:0 events:208 errors:0
TX bytes:1840 acl:17 sco:0 commands:105 errors:0
--------------------------------------------------------------------

But according to my hcid.conf file it should be enabled by default for
all devices, I'm using the prepackaged hcid.conf :

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

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

# 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
pscan enable; iscan 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;
}
--------------------------------------------------------------------

In an effort to make the Debian computer visible to other devices
I'm running the following command:

--------------------------------------------------------------------
# hciconfig hci0 piscan
# hciconfig hci0
hci0: Type: USB
BD Address: 00:0E:6D:3B:31:AE ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:3294 acl:16 sco:0 events:221 errors:0
TX bytes:1878 acl:17 sco:0 commands:112 errors:0
--------------------------------------------------------------------

But after a while the ISCAN mode gets disabled and I must keep running
hciconfig to make the computer visible again.

I have tried with two USB-BLUETOOTH dongles of different brands
and the problem persists.

I have also tried it in sid and etch with the same results.

-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-k7
Locale: LANG=es_CO, LC_CTYPE=es_CO (charmap=ISO-8859-1)

Versions of packages bluez-utils depends on:
ii libbluetooth2 3.1-1 Library to use the BlueZ Linux Blu
ii libc6 2.3.6-18 GNU C Library: Shared libraries
ii libdbus-1-2 0.62-4 simple interprocess messaging syst
ii libdbus-glib-1-2 0.62-4 simple interprocess messaging syst
ii libglib2.0-0 2.10.3-3 The GLib library of C routines
ii libusb-0.1-4 2:0.1.12-2 userspace USB programming library
ii lsb-base 3.1-12 Linux Standard Base 3.1 init scrip
ii makedev 2.3.1-82 creates device files in /dev
ii module-init-tools 3.2.2-3 tools for managing Linux kernel mo
ii modutils 2.4.27.0-6 Linux module utilities
ii sysvinit 2.86.ds1-15 System-V-like init utilities
ii udev 0.093-1 /dev/ and hotplug management daemo

bluez-utils recommends no packages.

-- no debconf information


--
Jaime Alberto Silva L I N U X .~.
The Choice /V\
of a GNU / ( ) \
Generation ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2006-08-24 20:31:30

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> Can you, please, point me to some documentation about dbus usage and
> how to discover the methods registered by bluez?.

You can find a description of the bluez D-Bus API in the
hcid/dbus-api.txt file that comes along with bluez-utils (you'll have to
use version 3.3 since it wasn't included before that).

About D-Bus usage, well, by googling you should be able to find several
places with some documentation, though I have to admit that some of the
higher level bindings lack good documentation. E.g. the lowlevel API
description can be found here:
http://dbus.freedesktop.org/doc/api/html/group__DBus.html

If you want to specifically use the bluez D-Bus API you could e.g. take
a look at the source code of the new bluez-gnome package (which uses the
GLib bindings of D-Bus) or the hcid/dbus-test script which is part of
the bluez-utils package (it uses the python bindings and contains
examples of pretty much every feature of the bluez D-Bus API).

> Another example will be nice, something like... How to set the
> discover timeout with dbus

Set the discoverable timeout:
dbus-send --system --dest=org.bluez /org/bluez/hci0 \
org.bluez.Adapter.SetDiscoverableTimeout uint32:100

Get the discoverable timeout:
dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0 \
org.bluez.Adapter.GetDiscoverableTimeout

> Thanks for your help!

No problem :)

Johan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-24 14:51:49

by Jaime Alberto Silva

[permalink] [raw]
Subject: Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

On 8/24/06, Johan Hedberg <[email protected]> wrote:
> On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> > Is there any tool in bluez-utils to achieve that? or some new entries
> > in the hcid.conf? so it can be done in an init script.
>
> Adding "discovto 0;" to hcid.conf should do the trick.
>
> You can change the settings from the command line using dbus-send, but I
> don't think it's a good idea to put it into a init script. E.g. the
> following would put the device in discoverable mode:
> dbus-send --system --dest=org.bluez /org/bluez/hci0 \
> org.bluez.Adapter.SetMode string:discoverable
>

Can you, please, point me to some documentation about dbus usage and
how to discover the methods registered by bluez?. Another example will
be nice, something like... How to set the discover timeout with dbus
;^)

Thanks for your help!

--
Jaime Alberto Silva L I N U X .~.
The Choice /V\
of a GNU / ( ) \
Generation ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-24 14:11:34

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> Is there any tool in bluez-utils to achieve that? or some new entries
> in the hcid.conf? so it can be done in an init script.

Adding "discovto 0;" to hcid.conf should do the trick.

You can change the settings from the command line using dbus-send, but I
don't think it's a good idea to put it into a init script. E.g. the
following would put the device in discoverable mode:
dbus-send --system --dest=org.bluez /org/bluez/hci0 \
org.bluez.Adapter.SetMode string:discoverable

Johan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-24 13:46:04

by Jaime Alberto Silva

[permalink] [raw]
Subject: Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

Hi Marcel,

Thanks a lot for your help!

I still have some questions:

On 8/24/06, Marcel Holtmann <[email protected]> wrote:
> Hi Jaime,
>
> > Whenever I try to discover the local system (Debian computer) from a remote
> > system (mobile device, or other computer) it can't be found. After
> > some research I found out that the ISCAN mode is disabled:
>
> this should have been fixed in bluez-utils-3.3. You have to set the
> discoverable timeout to 0 and the mode to "discoverable" over the new
> D-Bus API and then it will stay visible forever. Otherwise it goes back
> to being non-discoverable after the discoverable timeout.
>

Is there any tool in bluez-utils to achieve that? or some new entries
in the hcid.conf? so it can be done in an init script.

--
Jaime Alberto Silva L I N U X .~.
The Choice /V\
of a GNU / ( ) \
Generation ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-24 09:01:29

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off

Hi Jaime,

> Whenever I try to discover the local system (Debian computer) from a remote
> system (mobile device, or other computer) it can't be found. After
> some research I found out that the ISCAN mode is disabled:

this should have been fixed in bluez-utils-3.3. You have to set the
discoverable timeout to 0 and the mode to "discoverable" over the new
D-Bus API and then it will stay visible forever. Otherwise it goes back
to being non-discoverable after the discoverable timeout.

Regards

Marcel



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users