Connecting to Bluetooth Low Energy devices
Hello
Trying to get started with Bluetooth Low Energy devices, i used hcitool and gatttool to enumerate device attributes, but did not get far:
# hcitool lescan LE Scan ... <MAC-Device1> Battery V1.0 <MAC-Device1> (unknown) <MAC-Device2> Battery V1.0 <MAC-Device2> (unknown) ^C
# gatttool -b <MAC-Device1> -I [ ][<MAC-Device1>][LE]> connect Connecting... connect error: connect error: Connection refused (111) [ ][<MAC-Device1>][LE]>
This is all i get.
The devices are Nordic Semiconductor nRF8001 based and currently run a simple BTLE demo application by Nordic Semiconductor. It does not use bind/paring but simple connect. Unfornately that doesn't seem to work.
The host uses an of-the-shelf USB Bluetooth 4.0 Stick with a Broadcom BCM20702A0 Chip inside.
Am i doing something obviously wrong?
Any tips where to get more information about the error (dmesg shows nothing)?
Regards
Philipp Claves
Signature · 9 lines
Budelmann Elektronik GmbH Von-Renesse-Weg 60 48163 Münster Germany Tel. +49 (0)2501 9208440 Fax +49 (0)2501 5887024 [email protected] www.budelmann-elektronik.com
Hi Philipp,
Quoted 13 lines · Philipp Claves
Hello
Trying to get started with Bluetooth Low Energy devices, i used hcitool and gatttool to enumerate device attributes, but did not get far:
# hcitool lescan LE Scan ... <MAC-Device1> Battery V1.0 <MAC-Device1> (unknown) <MAC-Device2> Battery V1.0 <MAC-Device2> (unknown) ^C
Quoted 6 lines
# gatttool -b <MAC-Device1> -I [ ][<MAC-Device1>][LE]> connect Connecting... connect error: connect error: Connection refused (111) [ ][<MAC-Device1>][LE]>This is all i get.
Which kernel version are you running?
Quoted 2 lines
Am i doing something obviously wrong?
Any tips where to get more information about the error (dmesg shows nothing)?
run "hcidump -X" and check the logs while you run "hcitool lescan". Then check the type of advertising those devices are sending. They should be connectable advertisings to be able to connect to them. Also check the address type, if it is "Random" you need to pass "-t random" to gatttool.
Regards,
Signature · 3 lines
Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil
Hi Anderson
Quoted 18 lines · Anderson Lizardo
Hi Philipp,
On Thu, Sep 13, 2012 at 11:34 AM, Philipp Claves
Quoted 13 lines · <[email protected]> wrote:
Hello
Trying to get started with Bluetooth Low Energy devices, i used hcitool and gatttool to enumerate device attributes, but did not get far:
# hcitool lescan LE Scan ... <MAC-Device1> Battery V1.0 <MAC-Device1> (unknown) <MAC-Device2> Battery V1.0 <MAC-Device2> (unknown) ^C
Quoted 8 lines
Quoted 6 lines
# gatttool -b <MAC-Device1> -I [ ][<MAC-Device1>][LE]> connect Connecting... connect error: connect error: Connection refused (111) [ ][<MAC-Device1>][LE]>This is all i get.
Which kernel version are you running?
Linux 3.5.3
Which is the minimum version required?
Quoted 9 lines
Quoted 4 lines
Am i doing something obviously wrong?
Any tips where to get more information about the error (dmesg shows nothing)?run "hcidump -X" and check the logs while you run "hcitool lescan". Then check the type of advertising those devices are sending. They should be connectable advertisings to be able to connect to them. Also check the address type, if it is "Random" you need to pass "-t random" to gatttool.
Thanks, -t random did the trick.
But it's still strange, the device addresses never changed even once while working with them. The bluetooth SIG talk about LE adresses mentioned random adresses to change every 15 minutes or so....
I need to investigate this more.
Thanks for your help!
Philipp Claves
Signature · 9 lines
Budelmann Elektronik GmbH Von-Renesse-Weg 60 48163 Münster Germany Tel. +49 (0)2501 9208440 Fax +49 (0)2501 5887024 [email protected] www.budelmann-elektronik.com
Hi,
Quoted 3 lines · Philipp Claves
Quoted 1 line
Which kernel version are you running?
Linux 3.5.3
Which is the minimum version required?
If you run a too old kernel with a recent bluez, bluez will complain (due to mgmt channel change), so I think this version is fine.
Quoted 5 lines
Thanks, -t random did the trick.
But it's still strange, the device addresses never changed even once while working with them. The bluetooth SIG talk about LE adresses mentioned random adresses to change every 15 minutes or so....
I need to investigate this more.
This behavior depends on which random address type is used.
static random addresses are not required to change. Some (all?) devices change their static random address when battery is removed.
private random addresses need to change periodically to avoid tracking.
Regards,
Signature · 3 lines
Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil