user3712524
user3712524

Reputation: 101

Bluetooth LE connection only lasts 10 seconds

I was wondering if anyone else has had trouble with a ble connection only lasting 10 seconds. I am attempting to connect a mac (running ubuntu) as a central and an iPhone app running as a peripheral. I have verified that the app is connectable with lightblue. I am using the hcitool lescan to get the MAC address and then using gatttool-b -I -t random which gives me the [ ][MAC ADDRESS]> prompt, and then I type connect, which gives me [CON][MAC ADDRESS]> for exactly 10 seconds before reverting to [ ][MAC ADDRESS]>. I did run hcidump and here is the output:

HCI sniffer - Bluetooth packet analyzer ver 2.2 device: hci0 snap_len: 1028 filter: 0xffffffffffffffff

HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7 type 0x01 (active) interval 10.000ms window 10.000ms own address: 0x00 (Public) policy: All

HCI Event: Command Complete (0x0e) plen 4 LE Set Scan Parameters (0x08|0x000b) ncmd 1 status 0x00

HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2 value 0x01 (scanning enabled) filter duplicates 0x01 (enabled)

HCI Event: Command Complete (0x0e) plen 4 LE Set Scan Enable (0x08|0x000c) ncmd 1 status 0x00

HCI Event: LE Meta Event (0x3e) plen 33 LE Advertising Report ADV_IND - Connectable undirected advertising (0) bdaddr 78:96:3C:DB:D9:9D (Random) Flags: 0x1a Unknown type 0x07 with 16 bytes data RSSI: -37

HCI Event: LE Meta Event (0x3e) plen 12 LE Advertising Report SCAN_RSP - Scan Response (4) bdaddr 78:96:3C:DB:D9:9D (Random) RSSI: -37

HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2 value 0x00 (scanning disabled) filter duplicates 0x01 (enabled)

HCI Event: Command Complete (0x0e) plen 4 LE Set Scan Enable (0x08|0x000c) ncmd 1 status 0x00

HCI Command: LE Create Connection (0x08|0x000d) plen 25 bdaddr 78:96:3C:DB:D9:9D type 1

HCI Event: Command Status (0x0f) plen 4 LE Create Connection (0x08|0x000d) status 0x00 ncmd 1

HCI Event: LE Meta Event (0x3e) plen 19 LE Connection Complete status 0x00 handle 64, role master bdaddr 78:96:3C:DB:D9:9D (Random)

ACL data: handle 64 flags 0x02 dlen 11 ATT: Read By Group req (0x10) start 0x0001, end 0xffff type-uuid 0x2800

HCI Command: Read Remote Version Information (0x01|0x001d) plen 2 handle 64

HCI Event: Read Remote Ver Info Complete (0x0c) plen 8 status 0x00 handle 64 LMP Version: 4.0 (0x6) LMP Subversion: 0x2203 Manufacturer: Broadcom Corporation (15)

HCI Event: Command Status (0x0f) plen 4 Read Remote Version Information (0x01|0x001d) status 0x00 ncmd 1

HCI Event: Disconn Complete (0x05) plen 4 status 0x00 handle 64 reason 0x13 Reason: Remote User Terminated Connection

Any suggestions to help me break out of this rut?

Thanks in advance.

Upvotes: 0

Views: 2308

Answers (3)

user4826904
user4826904

Reputation: 55

I believe this could be due to the bluez version as well. What versions of bluez were you using at the time? And you might also see following from hcidump:

Reason: Remote User Terminated Connection (0x13)

Upvotes: 0

user1012131
user1012131

Reputation: 139

This is just my guest: I think this is iOS part of conserving things. If you connect manually and don't do anything in 10 sec, it will simply disconnect. Mostly program don't idle (not doing anything) in 10 sec. Why don't you subscribe to notify/identify chars or do bonding pairing, my guess again that should prevent iOS from disconnecting. Could be tricky to that with gatttool withing 10 secs, but should be easy if you use lightblue.

Upvotes: -1

Mr. Jones
Mr. Jones

Reputation: 405

I have experienced (on Android) that Estimote BLE beacons will interrupt a connection exactly after 10 seconds. How do you turn your iPhone into a peripheral? Do you use the Estimte app? Maybe they implemented the app the same way they implemented the beacons.

If you use the Estiomte app, you could try to use another app to turn your iPhone into a peripheral and check if it shows the same behaviour.

Upvotes: 0

Related Questions