BLE Hexiwear connection fail

8 messages, 3 authors, 2016-08-23 · open the first message on its own page

BLE Hexiwear connection fail

From: Jay Aurabind <hidden>
Date: 2016-08-19 14:06:10

Hi,

I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.

I tried connecting to it, but fails with an error no implemented:

[root@fedaura-envy jayaura]# gatttool -b 00:20:40:0B:00:24 -I
[00:20:40:0B:00:24][LE]> connect
Attempting to connect to 00:20:40:0B:00:24
Error: connect error: Function not implemented (38)
[00:20:40:0B:00:24][LE]>


I have the log[3] while this is happening. Does the above error mean
that connect is not implemented in my device? That is highly unlikely
as I can read data through the Android app.

Please provide some recommendations to get some data out of this
device through bluez




[1]:http://www.hexiwear.com/
[2]:https://github.com/MikroElektronika/HEXIWEAR/blob/master/documentation/HEXIWEAR%20Bluetooth%20Specifications.pdf
[3]:https://paste.gnome.org/pcdgqjf9r

-- 

Thanks and Regards,
Aurabindo J

Re: BLE Hexiwear connection fail

From: Jay Aurabind <hidden>
Date: 2016-08-20 06:44:54

Here is the hcidump while I try to connect : https://paste.gnome.org/pbeiyudsh

I see the "LE Connection Complete" message, but immediately something
goes wrong and it disconnects. Is there a way to find out more
information ?

On 19 August 2016 at 19:36, Jay Aurabind [off-list ref] wrote:
Hi,

I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.

I tried connecting to it, but fails with an error no implemented:

[root@fedaura-envy jayaura]# gatttool -b 00:20:40:0B:00:24 -I
[00:20:40:0B:00:24][LE]> connect
Attempting to connect to 00:20:40:0B:00:24
Error: connect error: Function not implemented (38)
[00:20:40:0B:00:24][LE]>


I have the log[3] while this is happening. Does the above error mean
that connect is not implemented in my device? That is highly unlikely
as I can read data through the Android app.

Please provide some recommendations to get some data out of this
device through bluez




[1]:http://www.hexiwear.com/
[2]:https://github.com/MikroElektronika/HEXIWEAR/blob/master/documentation/HEXIWEAR%20Bluetooth%20Specifications.pdf
[3]:https://paste.gnome.org/pcdgqjf9r

--

Thanks and Regards,
Aurabindo J


-- 

Thanks and Regards,
Aurabindo J

Re: BLE Hexiwear connection fail

From: Jay Aurabind <hidden>
Date: 2016-08-22 05:01:07

Hi Luiz,

Can you please provide some insight into this issue ?

On 20 August 2016 at 12:14, Jay Aurabind [off-list ref] wrote:
Here is the hcidump while I try to connect : https://paste.gnome.org/pbeiyudsh

I see the "LE Connection Complete" message, but immediately something
goes wrong and it disconnects. Is there a way to find out more
information ?

On 19 August 2016 at 19:36, Jay Aurabind [off-list ref] wrote:
quoted
Hi,

I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.

I tried connecting to it, but fails with an error no implemented:

[root@fedaura-envy jayaura]# gatttool -b 00:20:40:0B:00:24 -I
[00:20:40:0B:00:24][LE]> connect
Attempting to connect to 00:20:40:0B:00:24
Error: connect error: Function not implemented (38)
[00:20:40:0B:00:24][LE]>


I have the log[3] while this is happening. Does the above error mean
that connect is not implemented in my device? That is highly unlikely
as I can read data through the Android app.

Please provide some recommendations to get some data out of this
device through bluez




[1]:http://www.hexiwear.com/
[2]:https://github.com/MikroElektronika/HEXIWEAR/blob/master/documentation/HEXIWEAR%20Bluetooth%20Specifications.pdf
[3]:https://paste.gnome.org/pcdgqjf9r

--

Thanks and Regards,
Aurabindo J


--

Thanks and Regards,
Aurabindo J


-- 

Thanks and Regards,
Aurabindo J

Re: BLE Hexiwear connection fail

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2016-08-22 08:51:34

Hi Jay,
I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.
does it work on Android? If so, then enable Bluetooth HCI tracing/logging in Android and send around the /sdcard/btsnoop_hci.log file. You can read that wit btmon by yourself and compare.

I would also propose you start using btmon instead of hcidump.

Regards

Marcel

Re: BLE Hexiwear connection fail

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2016-08-22 10:57:59

Hi Jay, Marcel,

On Mon, Aug 22, 2016 at 11:51 AM, Marcel Holtmann [off-list ref] wrote:
Hi Jay,
quoted
I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.
does it work on Android? If so, then enable Bluetooth HCI tracing/logging in Android and send around the /sdcard/btsnoop_hci.log file. You can read that wit btmon by yourself and compare.

I would also propose you start using btmon instead of hcidump.
The D-Bus GATT should be able to handle those, if we are able to
connect, but there seems to be something wrong with the specification
as it does seems to use UUID range reserved by the SIG instead of
using proper 128 bits UUIDs.

-- 
Luiz Augusto von Dentz

Re: BLE Hexiwear connection fail

From: Jay Aurabind <hidden>
Date: 2016-08-23 06:18:42

On 22 August 2016 at 16:27, Luiz Augusto von Dentz [off-list ref] wrote:
Hi Jay, Marcel,

On Mon, Aug 22, 2016 at 11:51 AM, Marcel Holtmann [off-list ref] wrote:
quoted
Hi Jay,
quoted
I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.
does it work on Android? If so, then enable Bluetooth HCI tracing/logging in Android and send around the /sdcard/btsnoop_hci.log file. You can read that wit btmon by yourself and compare.

I would also propose you start using btmon instead of hcidump.
Hi Marcell, Luiz,

I took the btsnoop log from Android while the device is being paired.
To my surprise btmon crashes as I scroll down. The file is attached.
The crash is probably a different discussion,  but given below is the
backtrace. Can you please check if the same file crashes your btmon as
well?

#0  0x00007ffff7a4b6f5 in raise () from /lib64/libc.so.6
#1  0x00007ffff7a4d2fa in abort () from /lib64/libc.so.6
#2  0x00007ffff7a8c670 in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff7b2bc57 in __fortify_fail () from /lib64/libc.so.6
#4  0x00007ffff7b29d80 in __chk_fail () from /lib64/libc.so.6
#5  0x00007ffff7b29339 in _IO_str_chk_overflow () from /lib64/libc.so.6
#6  0x00007ffff7a905a0 in __GI__IO_default_xsputn () from /lib64/libc.so.6
#7  0x00007ffff7a635ac in vfprintf () from /lib64/libc.so.6
#8  0x00007ffff7b293cc in __vsprintf_chk () from /lib64/libc.so.6
#9  0x00007ffff7b2931d in __sprintf_chk () from /lib64/libc.so.6
#10 0x000055555558a533 in print_uuid ()
#11 0x0000555555588352 in att_packet ()
#12 0x00005555555888f3 in l2cap_frame ()
#13 0x000055555557f517 in packet_hci_acldata ()
#14 0x000055555557fae7 in packet_monitor ()
#15 0x000055555556a1c6 in control_reader ()
#16 0x00005555555670bc in main ()

The D-Bus GATT should be able to handle those, if we are able to
connect, but there seems to be something wrong with the specification
as it does seems to use UUID range reserved by the SIG instead of
using proper 128 bits UUIDs.
Since I do not know about much bluez stack, are you telling that some
changes needs to be done within the bluez stack so as to connect/pair
to such BLE devices which use  UUIDs reserved by SIG rather than
private ones? And could you please clarify about "something wrong with
the specification" ?
--
Luiz Augusto von Dentz


-- 

Thanks and Regards,
Aurabindo J

Re: BLE Hexiwear connection fail

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2016-08-23 11:53:56

Hi Jay,
quoted
quoted
quoted
I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.
does it work on Android? If so, then enable Bluetooth HCI tracing/logging in Android and send around the /sdcard/btsnoop_hci.log file. You can read that wit btmon by yourself and compare.

I would also propose you start using btmon instead of hcidump.

I took the btsnoop log from Android while the device is being paired.
To my surprise btmon crashes as I scroll down. The file is attached.
The crash is probably a different discussion,  but given below is the
backtrace. Can you please check if the same file crashes your btmon as
well?

#0  0x00007ffff7a4b6f5 in raise () from /lib64/libc.so.6
#1  0x00007ffff7a4d2fa in abort () from /lib64/libc.so.6
#2  0x00007ffff7a8c670 in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff7b2bc57 in __fortify_fail () from /lib64/libc.so.6
#4  0x00007ffff7b29d80 in __chk_fail () from /lib64/libc.so.6
#5  0x00007ffff7b29339 in _IO_str_chk_overflow () from /lib64/libc.so.6
#6  0x00007ffff7a905a0 in __GI__IO_default_xsputn () from /lib64/libc.so.6
#7  0x00007ffff7a635ac in vfprintf () from /lib64/libc.so.6
#8  0x00007ffff7b293cc in __vsprintf_chk () from /lib64/libc.so.6
#9  0x00007ffff7b2931d in __sprintf_chk () from /lib64/libc.so.6
#10 0x000055555558a533 in print_uuid ()
#11 0x0000555555588352 in att_packet ()
#12 0x00005555555888f3 in l2cap_frame ()
#13 0x000055555557f517 in packet_hci_acldata ()
#14 0x000055555557fae7 in packet_monitor ()
#15 0x000055555556a1c6 in control_reader ()
#16 0x00005555555670bc in main ()
it does not crash for me with the latest btmon from git. So maybe that is already fixed. If not, then lets us know and we have to figure out what is crashing here.

So the trace is funny. It seems that Android tries to connect to the LE device over and over again. And on the 3rd attempt it gets through. However I see nothing different in Android. Minus the fact that Bluedroid is not even keeping track of Disconnect Events and sending packets anyway. That stack really has no clue what state it is in :(

Can you just keep trying to connect and see if it eventually succeeds. If so, then please tell the manufacturer of that device to fix their BLE stack on the peripheral. Since there is little we can do to make this more reliable.

Regards

Marcel

Re: BLE Hexiwear connection fail

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2016-08-23 12:24:20

Hi Jay,

On Tue, Aug 23, 2016 at 9:18 AM, Jay Aurabind [off-list ref] wrote:
On 22 August 2016 at 16:27, Luiz Augusto von Dentz [off-list ref] wrote:
quoted
Hi Jay, Marcel,

On Mon, Aug 22, 2016 at 11:51 AM, Marcel Holtmann [off-list ref] wrote:
quoted
Hi Jay,
quoted
I have the IoT device Hexiwear[1], which connects through BLE. They
have an android app which can take data from it. I want to use from my
linux machine. Its BLE API is provided at their github[2] page.
does it work on Android? If so, then enable Bluetooth HCI tracing/logging in Android and send around the /sdcard/btsnoop_hci.log file. You can read that wit btmon by yourself and compare.

I would also propose you start using btmon instead of hcidump.
quoted
The D-Bus GATT should be able to handle those, if we are able to
connect, but there seems to be something wrong with the specification
as it does seems to use UUID range reserved by the SIG instead of
using proper 128 bits UUIDs.
Since I do not know about much bluez stack, are you telling that some
changes needs to be done within the bluez stack so as to connect/pair
to such BLE devices which use  UUIDs reserved by SIG rather than
private ones? And could you please clarify about "something wrong with
the specification" ?
The 16 Bits UUIDs used for the custom service (0x2000-0x2040) are
reserved to be used by the SIG:

https://www.bluetooth.com/specifications/assigned-numbers/16-bit-UUIDs-for-SDOs

Alternatively if you really want to use 16 Bits UUIDs:

https://www.bluetooth.com/specifications/assigned-numbers/16-bit-UUIDs-for-Members

Note: this has nothing to do with the connection problem, but it is
perhaps even worst problem because you won't be able to pass Bluetooth
qualification.


-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help