adafruit / adafruit/Adafruit_nRF52_Arduino

data drop sending long strings

Open
#182 19 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
699
Forks
570
PR merge metrics
No merged PRs in 30d

Description

Hi,
according to several issues adressing data drop, my problem could not be solved by those fixes yet.

Setup:
Win10 x64
Arduino IDE 1.8.6
bleuart sketch in full debug mode
Android Bluefruit LE App

Sending string from Bluefruit LE App via Uart to the Board.

Example String to send:
```
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
```

What I reveived:
```
{ "id": 1, "name": "Leanne Graham", "use{ "lat": "-37.3159",na", "catchPhrase": t-server neural-net"l-time e-markets" } }
```

I tried the pull request #178 , but it could not solve this problem.

Is there any other boundry, why this might not work?

What I realised is that up to 20 bytes it's safe to send data. Bigger junks are very likely to drop data.

Full Serial Log:
```
Bluefruit52 BLEUART Example
---------------------------

[CFG ] SoftDevice's RAM requires: 0x20002CE8
Please use Adafruit's Bluefruit LE app to connect in UART mode
Once connected, enter character(s) that you wish to send

BSP Library : 0.8.5
Firmware : S132 5.1.0, 5.1.0 dual banks
Serial No : 6F3Fxxxxx

--------- SoftDevice Config ---------
Max UUID128 : 10
ATTR Table Size : 2048
Service Changed : 0
Peripheral Connect Setting
- Max MTU : 247
- Event Length : 6
- HVN Queue Size : 3
- WrCmd Queue Size: 1

--------- BLE Settings ---------
Name : Bluefruit52
Max Connections : Peripheral = 1, Central = 0
Address : FD:9D:0C:BA:D2:AF (Static)
TX Power : 4 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Peripheral Paired Devices:

Central Paired Devices:

[BLE ] BLE_GAP_EVT_CONNECTED : Conn Handle = 0
[GAP ] Conn Interval= 48.750000
[BLE ] BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP : Conn Handle = 0
[GATTS ] Confirm received handle = 0x0000
Connected to Galaxy S7
[BLE ] BLE_GAP_EVT_CONN_PARAM_UPDATE : Conn Handle = 0
[GAP ] Conn Interval= 30.000000
[BLE ] BLE_GAP_EVT_CONN_PARAM_UPDATE : Conn Handle = 0
[GAP ] Conn Interval= 7.500000
[BLE ] BLE_GAP_EVT_CONN_PARAM_UPDATE : Conn Handle = 0
[GAP ] Conn Interval= 30.000000
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 01 00
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 00 00
[BLE ] BLE_GATTS_EVT_SYS_ATTR_MISSING : Conn Handle = 0
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 01 00
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 7B 20 22 69 64 22 3A 20 31 2C 20 22 6E 61 6D 65
10: 22 3A 20 22
[BLEUART] RX:
data: 7b 20 22 69 64 22 3a 20 31 2c 20 22 6e 61 6d 65 22 3a 20 22
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 4C 65 61 6E 6E 65 20 47 72 61 68 61 6D 22 2C 20
10: 22 75 73 65
[BLEUART] RX:
data: 4c 65 61 6e 6e 65 20 47 72 61 68 61 6d 22 2c 20 22 75 73 65
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 7B 20 22 6C 61 74 22 3A 20 22 2D 33 37 2E 33 31
10: 35 39 22 2C
[BLEUART] RX:
data: 7b 20 22 6c 61 74 22 3a 20 22 2d 33 37 2e 33 31 35 39 22 2c
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 6E 61 22 2C 20 22 63 61 74 63 68 50 68 72 61 73
10: 65 22 3A 20
[BLEUART] RX:
data: 6e 61 22 2c 20 22 63 61 74 63 68 50 68 72 61 73 65 22 3a 20
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 74 2D 73 65 72 76 65 72 20 6E 65 75 72 61 6C 2D
10: 6E 65 74 22
[BLEUART] RX:
data: 74 2d 73 65 72 76 65 72 20 6e 65 75 72 61 6c 2d 6e 65 74 22
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 6C 2D 74 69 6D 65 20 65 2D 6D 61 72 6B 65 74 73
10: 22 20 7D 20
[BLEUART] RX:
data: 6c 2d 74 69 6d 65 20 65 2d 6d 61 72 6b 65 74 73 22 20 7d 20
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's value, uuid = 0x0002
00: 7D 0A
[BLEUART] RX:
data: 7d 0a
{ "id": 1, "name": "Leanne Graham", "use{ "lat": "-37.3159",na", "catchPhrase": t-server neural-net"l-time e-markets" } }
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 01 00
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 00 00
[BLE ] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[GATTS ] attr's cccd
00: 00 00
[BLE ] BLE_GAP_EVT_DISCONNECTED : Conn Handle = 0
[GAP ] Disconnect Reason 0x13

Disconnected
[BLE ] BLE_GAP_EVT_TIMEOUT : Conn Handle = 65535
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the bleuart sketch and the BLEUART RX entries in the supplied serial log, comparing the 20-byte writes with the assembled output for the longer JSON payload. Reproduce the issue with the listed Windows, Arduino IDE, Android Bluefruit LE App, and firmware setup; done means the complete long string is received without dropped or reordered data.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.