- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I attached CYW20706 to the embedded linux system by referring to the blog below.
And the bluetooth_6lowpan module was loaded in the host Linux and connected with the ble sensor with the following command.
(The linux kernel version is 3.18.)
insmod 6lowpan.ko
insmod bluetooth_6lowpan.ko
hcitool lescan
echo 35> /sys/kernel/debug/bluetooth/6lowpan_psm
echo "connect 00:DD:F6:FF:20:DD 1"> /sys/kernel/debug/bluetooth/6lowpan_control
However, after about 40 seconds, the connection is disconnected with the following log output.
> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 52.827451
Status: Success (0x00)
Handle: 64
Reason: LMP Response Timeout / LL Response Timeout (0x22)
What should I check?
Any help will appreciated, thanks in advance.
below is all logs to start from echo "connect 00:DD:F6:FF:20:DD 1"> /sys/kernel/debug/bluetooth/6lowpan_control
------ btmon Log -----
/ # btmon
Bluetooth monitor ver 5.33
= New Index: 51:51:05:97:58:13 (BR/EDR,UART,hci0) [hci0] 0.844470
< HCI Command: LE Create Connection (0x08|0x000d) plen 25 [hci0] 10.535435
Scan interval: 60.000 msec (0x0060)
Scan window: 30.000 msec (0x0030)
Filter policy: White list is not used (0x00)
Peer address type: Public (0x00)
Peer address: 00:9E:42:54:30:32 (OUI 00-9E-42)
Own address type: Public (0x00)
Min connection interval: 50.00 msec (0x0028)
Max connection interval: 70.00 msec (0x0038)
Connection latency: 0x0000
Supervision timeout: 420 msec (0x002a)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4 [hci0] 10.545040
LE Create Connection (0x08|0x000d) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19 [hci0] 12.526027
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 64
Role: Master (0x00)
Peer address type: Public (0x00)
Peer address: 00:9E:42:54:30:32 (OUI 00-9E-42)
Connection interval: 67.50 msec (0x0036)
Connection latency: 0.00 msec (0x0000)
Supervision timeout: 420 msec (0x002a)
Master clock accuracy: 0x00
< ACL Data TX: Handle 64 flags 0x00 dlen 18 [hci0] 12.526401
LE L2CAP: LE Connection Request (0x14) ident 1 len 10
PSM: 35 (0x0023)
Source CID: 64
MTU: 65535
MPS: 230
Credits: 10
@ Device Connected: 00:9E:42:54:30:32 (1) flags 0x0000
> ACL Data RX: Handle 64 flags 0x02 dlen 18 [hci0] 12.799229
LE L2CAP: LE Connection Response (0x15) ident 1 len 10
Destination CID: 64
MTU: 1280
MPS: 50
Credits: 0
Result: Connection successful (0x0000)
> HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 12.903041
Num handles: 1
Handle: 64
Count: 1
> ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 13.270589
> ACL Data RX: Handle 64 flags 0x01 dlen 7 [hci0] 13.270618
Channel: 64 len 30 [PSM 35 mode 0] {chan 0}
1c 00 7b 3b 3a 02 85 00 95 dc 00 00 00 00 01 02 ..{;:...........
00 9e 42 ff fe 54 30 32 00 00 00 00 00 00 ..B..T02......
> ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 13.270624
LE L2CAP: LE Flow Control Credit (0x16) ident 3 len 4
Source CID: 64
Credits: 1
> ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 13.272317
LE L2CAP: LE Flow Control Credit (0x16) ident 5 len 4
Source CID: 64
Credits: 1
< ACL Data TX: Handle 64 flags 0x00 dlen 54 [hci0] 14.151062
Channel: 64 len 50 [PSM 35 mode 0] {chan 0}
50 00 79 3b 00 16 3a 00 05 02 00 00 01 00 8f 00 P.y;..:.........
63 2f 00 00 00 03 04 00 00 00 ff 02 00 00 00 00 c/..............
00 00 00 00 00 01 ff 00 00 00 04 00 00 00 ff 02 ................
00 00 ..
< ACL Data TX: Handle 64 flags 0x00 dlen 36 [hci0] 14.151105
Channel: 64 len 32 [PSM 35 mode 0] {chan 0}
00 00 00 00 00 00 00 01 ff 97 58 13 04 00 00 00 ..........X.....
ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
> ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 14.217916
LE L2CAP: LE Flow Control Credit (0x16) ident 7 len 4
Source CID: 64
Credits: 3
< ACL Data TX: Handle 64 flags 0x00 dlen 46 [hci0] 14.279803
Channel: 64 len 42 [PSM 35 mode 0] {chan 0}
28 00 79 3b 00 16 3a 00 05 02 00 00 01 00 8f 00 (.y;..:.........
c1 0d 00 00 00 01 04 00 00 00 ff 02 00 00 00 00 ................
00 00 00 00 00 01 ff 00 00 00 ..........
> HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.283945
Num handles: 1
Handle: 64
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 54 [hci0] 14.300720
Channel: 64 len 50 [PSM 35 mode 0] {chan 0}
50 00 79 3b 00 16 3a 00 05 02 00 00 01 00 8f 00 P.y;..:.........
63 2f 00 00 00 03 04 00 00 00 ff 02 00 00 00 00 c/..............
00 00 00 00 00 01 ff 00 00 00 04 00 00 00 ff 02 ................
00 00 ..
< ACL Data TX: Handle 64 flags 0x00 dlen 36 [hci0] 14.300776
Channel: 64 len 32 [PSM 35 mode 0] {chan 0}
00 00 00 00 00 00 00 01 ff 97 58 13 04 00 00 00 ..........X.....
ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
> HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.421437
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 14.486576
LE L2CAP: LE Flow Control Credit (0x16) ident 9 len 4
Source CID: 64
Credits: 3
> HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.655443
Num handles: 1
Handle: 64
Count: 1
> ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 27.986759
> ACL Data RX: Handle 64 flags 0x01 dlen 25 [hci0] 27.986787
Channel: 64 len 48 [PSM 35 mode 0] {chan 0}
2e 00 7e 30 20 01 0d b8 00 00 00 00 00 00 00 00 ..~0 ...........
00 00 00 01 f0 16 33 16 33 3a 16 42 03 00 01 01 ......3.3:.B....
02 b5 63 68 65 63 6b 11 2a ff 00 9e 42 54 30 32 ..check.*...BT02
< ACL Data TX: Handle 64 flags 0x00 dlen 54 [hci0] 27.992309
Channel: 64 len 50 [PSM 35 mode 0] {chan 0}
50 00 7a 33 3a 01 02 6c 25 00 00 00 00 60 00 00 P.z3:..l%....`..
00 00 1d 11 40 fe 80 00 00 00 00 00 00 02 9e 42 ....@..........B
ff fe 54 30 32 20 01 0d b8 00 00 00 00 00 00 00 ..T02 ..........
00 00 ..
< ACL Data TX: Handle 64 flags 0x00 dlen 36 [hci0] 27.992381
Channel: 64 len 32 [PSM 35 mode 0] {chan 0}
00 00 01 16 33 16 33 00 1d 3a 16 42 03 00 01 01 ....3.3..:.B....
02 b5 63 68 65 63 6b 11 2a ff 00 9e 42 54 30 32 ..check.*...BT02
> HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 28.121657
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 28.188928
LE L2CAP: LE Flow Control Credit (0x16) ident 11 len 4
Source CID: 64
Credits: 2
> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 52.827451
Status: Success (0x00)
Handle: 64
Reason: LMP Response Timeout / LL Response Timeout (0x22)
@ Device Disconnected: 00:9E:42:54:30:32 (1) reason 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you please let us know what is the peer device you are trying to connect ?
Can you please try sending HCI commands using CyBluetool (CyBluetool (Linux Installer) ) and see if you still getting the disconnection?
Just want to check if the issue happens only with Bluez or not
Regards,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello
Thank you for your reply.
1. Can you please let us know what is the peer device you are trying to connect ?
- The device I'm trying to connect is a temperature sensor. (Nordic Semiconductor ASA)
- below is result of hcitool leinfo <bdaddr>
------------------------------------------------------------ Log Start ------------------------------------------------------------
@ Device Connected: 00:9E:42:54:30:32 (1) flags 0x0000
< HCI Command: Read Remote Version I.. (0x01|0x001d) plen 2 [hci0] 2059.058465
Handle: 64
> HCI Event: Command Status (0x0f) plen 4 [hci0] 2059.059763
Read Remote Version Information (0x01|0x001d) ncmd 1
Status: Success (0x00)
> HCI Event: Read Remote Version Complete (0x0c) plen 8 [hci0] 2059.103789
Status: Success (0x00)
Handle: 64
LMP version: Reserved (0x09) - Subversion 157 (0x009d)
Manufacturer: Nordic Semiconductor ASA (89)
< HCI Command: LE Read Remote Used F.. (0x08|0x0016) plen 2 [hci0] 2059.107982
Handle: 64
> HCI Event: Command Status (0x0f) plen 4 [hci0] 2059.108906
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
< HCI Command: Disconnect (0x01|0x0006) plen 3 [hci0] 2079.132169
Handle: 64
Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4 [hci0] 2079.133781
Disconnect (0x01|0x0006) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12 [hci0] 2079.150168
LE Read Remote Used Features (0x04)
Status: Connection Terminated By Local Host (0x16)
Handle: 64
Features: 0xff 0x00 0x00 0x08 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Slave-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
LL Privacy
Extended Scanner Filter Policies
Unknown features (0x0000000008000000)
> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 2079.150205
Status: Success (0x00)
Handle: 64
Reason: Connection Terminated By Local Host (0x16)
@ Device Disconnected: 00:9E:42:54:30:32 (1) reason 2
------------------------------------------------------------ Log End ------------------------------------------------------------
2. Can you please try sending HCI commands using CyBluetool (CyBluetool (Linux Installer) ) and see if you still getting the disconnection?
- I will reply the results after testing.
3. update the issue
- kernel version : 3.18.44, Bluez version : 5.33
- When connected to sensor by echo "connect 00:DD:F6:FF:20:DD 1"> /sys/kernel/debug/bluetooth/6lowpan_control,
icmpv6 bad checksum error occurs on the sensor side.
- below is sensor side log.
------------------------------------------------------------ Log Start ------------------------------------------------------------
<info> app: Physical layer: connected.
<info> app: Got IP Application Handler Event on interface 0x0x200058E8
<info> app: New interface added!
<info> app: Sending Router Solicitation to all routers!
<error> ipv6: Packet received on unknown address!
<error> ipv6: Got unsupported protocol packet. Protocol ID = 0x0!
<error> ipv6: Got unsupported protocol packet. Protocol ID = 0x0!
<error> ipv6: Packet received on unknown address!
<error> ipv6: Got unsupported protocol packet. Protocol ID = 0x0!
<error> ipv6: Packet received on unknown address!
<error> ipv6: Packet received on unknown address!
<info> app: Check Cloud Status:0xC344, Code:0x0
<error> icmp6: Bad checksum detected. Got 0x000030B6 but expected 0x00000400, 0x00000045
<info> app: CHECK: 536893672 0 0
<info> app: CHECK SERVER
<error> icmp6: Bad checksum detected. Got 0x000030B6 but expected 0x00000400, 0x00000045
<info> app: Got IP Application Handler Event on interface 0x0x200058E8
<info> app: Interface removed!
<info> app: Physical layer: disconnected.
<info> app: Physical layer in connectable mode.
<info> app: coap_error_handler: 0xC244
<info> app: Check Cloud Status:0xC344, Code:0x0
<info> app: RETCHK: 0 0 0 0
<info> app: coap_error_handler: 0xC244
<info> app: Check Cloud Status:0xC344, Code:0x0
<info> app: RETCHK: 0 0 0 0
------------------------------------------------------------ Log End ------------------------------------------------------------
- After connecting to the sensor, I must execute the command below to prevent the sensor from disconnecting.
hcitool lecup --handle 64 --min 6 --max 100 --latency 30 --timeout 3200
However, the command fails with the following log. And after about 40 seconds, the sensor disconnects.
Could not change connection params: Connection timed out(110)
- I think the issue is similar following link.
- If i'm wrong, ignore the following.
On the link, the nrf52840 is host controller.
Of course i know cyw20706 and nrf52840 are different.
But he solved the issue by defining BLE_6LOWPAN_LEGACY_MODE.
in nordic, BLE_6LOWPAN_LEGACY_MODE is descripted a following.
So I would like to ask if cyw20706 has similar features as above.
The following is the code downloaded to cyw20706 by referring to the link( Re: CYW20719 in HCI mode ).
------------------------------------------------------------ Code Start ------------------------------------------------------------
const wiced_transport_cfg_t transport_cfg =
{
.type = WICED_TRANSPORT_UART,
.cfg =
{
.uart_cfg =
{
.mode = WICED_TRANSPORT_UART_HCI_MODE,
.baud_rate = 115200
// .baud_rate = HCI_UART_DEFAULT_BAUD
},
},
.rx_buff_pool_cfg =
{
.buffer_size = 0,
.buffer_count = 0
},
.p_status_handler = NULL,
.p_data_handler = NULL,
.p_tx_complete_cback = NULL
};
APPLICATION_START() {
wiced_transport_init( &transport_cfg );
}
------------------------------------------------------------ Code end ------------------------------------------------------------
Thank you.