2010-04-06 17:08:32

by Garry Paxinos

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

Is there a practical upper limit of the number of devices that can be
bonded to a single computer?

I am considering reworking the bonding code to use a MySQL DB to store
the list of devices, but was wondering if there was any other limit
(either coding or practical).?? For example, can a single computer
bond with 1k devices?? what about 100K or even 1M ?

Thanks,
Pax.


2010-04-07 13:07:32

by Garry Paxinos

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

Thanks to both of your for your info.

I was able to get RSSI iinfo, but it took a little fiddling with the
extended_inquiry_info structure but I have it working.

I have complete control over the computer but no control over the
device. It would be best if I could cause the device to initiate the
connection but do not have a practical way to implement.

I have seen a couple times when I'm initiating a connection from the
computer to one device, another device will initiate a connection to
the computer without any explicit prompting on my part. But I need to
investigate this further to see if I can reliably repeat this and then
if it is a usable side effect.

Having only a very limited number of active connection is not a
problem for my project.

Thanks again,
Pax.

On Tue, Apr 6, 2010 at 7:53 PM, Peter Dons Tychsen <[email protected]> wrote:
> Hi Iain & Garry,
>
> On Tue, 2010-04-06 at 20:57 +0100, Iain Hibbert wrote:
>> Sure, but consider that the page timeout (time to failure of a
>> connection
>> attempt) is usually around 20 seconds.. and most Bluetooth controllers
>> (that I have tried) can only page a single device at a time.. So, if
>> you
>> don't know which devices are in range, you might be waiting a *long*
>> time
>> before you connect to anything..
>
> 20 seconds for a "page-timeout" is unusual for the reason you just
> mentioned. However, the "link-timeout" is usually around 10-20 seconds,
> but that is only applicable if an existing links needs to drop. The page
> timeout use usually more like 3-5 seconds. Even if it were as high as
> you describe, it is easily re-configurable. Going below ~2 seconds is
> not a good idea though as you push the odds of hitting the page-scan
> window (i do not remember the exact number, look in the spec). Even
> better test it (and tune accordingly). For an application like this you
> want a low page-timeout.
>
> On Tue, 2010-04-06 at 19:11 +0100, Iain Hibbert wrote:
>> you will probably find that because the HS device is very limited in
>> resources, it does not keep records of more than one paired device.
>> So, if
>> you pair with another device it forgets about the first and you will
>> not
>> be able to connect except that you pair it again.
>
> Many headset devices store store 8 devices they have previously paired
> with (the major brands). It is however not a guarantee, so some might
> not have it.
>
>>On Tue, 2010-04-06 at 13:08 -0400, Garry Paxinos wrote:
>> Is there a practical upper limit of the number of devices that can be
>> bonded to a single computer?
>
> The number of devices is almost limitless. However, as Iain said, in
> theory this cannot be done with one controller as the maximum devices
> for a unit is 7. In practice it looks even worse, as many controllers
> become unstable if you go beyond 2 links. The link itself also becomes
> unstable when many devices are connected, as you run out of air-time
> (your radio can only service one at any time), and you risk loosing a
> link. I recommend people to stick with one link pr. application if
> stability and speed is the name of the game. If not, test it!
>
> Recently i created a large setup of lots of BT-USB dongles connected via
> some hubs to a single box running Bluez. To my delight it was remarkably
> easy and stable. The well designed Bluez-API really is a bonus. Doing
> this on any other system has only ended in agony. Just having that many
> USB devices can cause problems on many systems. This is definitely the
> way to go if you are trying to connect to lots of devices in a reliable
> way. It is pretty cheap as well, as even good dongles are getting
> cheaper even as i type (down to $10-$15)! :-)
>
> Good luck on your project,
>
> Thanks,
>
> /Pedro
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

2010-04-06 23:53:53

by Peter Dons Tychsen

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

Hi Iain & Garry,

On Tue, 2010-04-06 at 20:57 +0100, Iain Hibbert wrote:
> Sure, but consider that the page timeout (time to failure of a
> connection
> attempt) is usually around 20 seconds.. and most Bluetooth controllers
> (that I have tried) can only page a single device at a time.. So, if
> you
> don't know which devices are in range, you might be waiting a *long*
> time
> before you connect to anything..

20 seconds for a "page-timeout" is unusual for the reason you just
mentioned. However, the "link-timeout" is usually around 10-20 seconds,
but that is only applicable if an existing links needs to drop. The page
timeout use usually more like 3-5 seconds. Even if it were as high as
you describe, it is easily re-configurable. Going below ~2 seconds is
not a good idea though as you push the odds of hitting the page-scan
window (i do not remember the exact number, look in the spec). Even
better test it (and tune accordingly). For an application like this you
want a low page-timeout.

On Tue, 2010-04-06 at 19:11 +0100, Iain Hibbert wrote:
> you will probably find that because the HS device is very limited in
> resources, it does not keep records of more than one paired device.
> So, if
> you pair with another device it forgets about the first and you will
> not
> be able to connect except that you pair it again.

Many headset devices store store 8 devices they have previously paired
with (the major brands). It is however not a guarantee, so some might
not have it.

>On Tue, 2010-04-06 at 13:08 -0400, Garry Paxinos wrote:
> Is there a practical upper limit of the number of devices that can be
> bonded to a single computer?

The number of devices is almost limitless. However, as Iain said, in
theory this cannot be done with one controller as the maximum devices
for a unit is 7. In practice it looks even worse, as many controllers
become unstable if you go beyond 2 links. The link itself also becomes
unstable when many devices are connected, as you run out of air-time
(your radio can only service one at any time), and you risk loosing a
link. I recommend people to stick with one link pr. application if
stability and speed is the name of the game. If not, test it!

Recently i created a large setup of lots of BT-USB dongles connected via
some hubs to a single box running Bluez. To my delight it was remarkably
easy and stable. The well designed Bluez-API really is a bonus. Doing
this on any other system has only ended in agony. Just having that many
USB devices can cause problems on many systems. This is definitely the
way to go if you are trying to connect to lots of devices in a reliable
way. It is pretty cheap as well, as even good dongles are getting
cheaper even as i type (down to $10-$15)! :-)

Good luck on your project,

Thanks,

/Pedro

2010-04-06 19:57:30

by Iain Hibbert

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

On Tue, 6 Apr 2010, Garry Paxinos wrote:

> Thanks for the quick reply! We actually have an application that
> could conceivable pair with over 1M devices if the project is
> successful.
>
> There are really two other issues to resolve in this scenario -
>
> 1. Is it possible to have the computer initiate the connection to a
> bonded device without previously knowing what devices are currently in
> the vicinity? Especially when our bonded DB is excessively large.

Sure, but consider that the page timeout (time to failure of a connection
attempt) is usually around 20 seconds.. and most Bluetooth controllers
(that I have tried) can only page a single device at a time.. So, if you
don't know which devices are in range, you might be waiting a *long* time
before you connect to anything..

I have not read the 3.0 spec though, and using another transport (wifi)
might make some things faster and make what you want possible.

> 2. Is there a way (even if we need to do device driver work) to gain
> access to signal strength before bonding to a device? And before
> connecting to a device? We really need to limit ourselves to bonding
> and connecting with devices that are located in a very close
> proximity.

Hrm, you can do inquiry-with-rssi which will tell you the signal strength.
But, that requires the remote device to be discoverable. And, it takes
more time (most Bluetooth controllers are not able to make connections at
the same time as discovering nearby devices). And, I read of experiments
trying to correlate signal strength with distance which were not that
successful anyway.

You don't say too much about the role and ownership of different devices
in your application network, and if you really need the generic
interoperability of Bluetooth. By this, I mean for instance if you need to
be able to contact standard devices (eg phones owned by third-parties,
possibly running your app amongst other things) or if the devices will be
custom built for your application (in which case, you can control
everything about how the device behaves)

There is unused capability in the "class of device" identifier which is
provided in inquiry results and can be used to filter inquiry results
before trying connections. But, in a 'standard' device you might have
trouble using it for your own purposes..

regards,
iain



2010-04-06 18:32:06

by Garry Paxinos

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

Thanks for the quick reply! We actually have an application that
could conceivable pair with over 1M devices if the project is
successful.

There are really two other issues to resolve in this scenario -

1. Is it possible to have the computer initiate the connection to a
bonded device without previously knowing what devices are currently in
the vicinity? Especially when our bonded DB is excessively large.

2. Is there a way (even if we need to do device driver work) to gain
access to signal strength before bonding to a device? And before
connecting to a device? We really need to limit ourselves to bonding
and connecting with devices that are located in a very close
proximity.

Thanks,
Pax.

On Tue, Apr 6, 2010 at 2:19 PM, Iain Hibbert <[email protected]> wrote:
> On Tue, 6 Apr 2010, Garry Paxinos wrote:
>
>> Is there a practical upper limit of the number of devices that can be
>> bonded to a single computer?
>>
>> I am considering reworking the bonding code to use a MySQL DB to store
>> the list of devices, but was wondering if there was any other limit
>> (either coding or practical).?? For example, can a single computer
>> bond with 1k devices?? what about 100K or even 1M ?
>
> There is no reason it cannot pair with such a number of devices though I
> can't think how you will fit them all in your pocket..
>
> ..but bear in mind that it cannot connect with more than 7 in a Bluetooth
> piconet at any one time. (perhaps with other transports it can do more)
> and because pairing generally involves human interaction, it is not a
> frequently occurring event.
>
> I suspect the vast majority of usage case is pairing with <10 in the
> lifetime of the device and that using a MySQL database would be just
> overkill.. but perhaps there are other, more minimal, data-storage front
> ends that can be used (cdb?), if you wanted to provide generic access to
> the information..
>
> regards,
> iain
>

2010-04-06 18:19:31

by Iain Hibbert

[permalink] [raw]
Subject: Re: upper limit of bonded devices?

On Tue, 6 Apr 2010, Garry Paxinos wrote:

> Is there a practical upper limit of the number of devices that can be
> bonded to a single computer?
>
> I am considering reworking the bonding code to use a MySQL DB to store
> the list of devices, but was wondering if there was any other limit
> (either coding or practical).?? For example, can a single computer
> bond with 1k devices?? what about 100K or even 1M ?

There is no reason it cannot pair with such a number of devices though I
can't think how you will fit them all in your pocket..

..but bear in mind that it cannot connect with more than 7 in a Bluetooth
piconet at any one time. (perhaps with other transports it can do more)
and because pairing generally involves human interaction, it is not a
frequently occurring event.

I suspect the vast majority of usage case is pairing with <10 in the
lifetime of the device and that using a MySQL database would be just
overkill.. but perhaps there are other, more minimal, data-storage front
ends that can be used (cdb?), if you wanted to provide generic access to
the information..

regards,
iain