Hi All,
I'm working with SDK 12.3.0 and an nrf52832. I currently have 3 characteristics in my custom service. They are 17, 11, and 6 bytes long and are used to send sensor data in various configurations.
What I've noticed is that if I send 20,000 notifications, the throughput drops proportionally to how large each characteristic is. For example, if I send 20,000 characteristic updates as fast as I can, I get the following throughput (using a Pixel 2 and nrfConnect timestamps):
- 17-byte characteristic: 8.7kB/s
- 11-byte characteristic: 5.5kB/s
- 6-byte characteristic: 3.5kB/s
I'm assuming this is because there is overhead associated with the sending of each PDU and every time I send a notification it sends out a PDU. This means that in order to maximize my throughput, I actually want to cram as much data that will fit into my PDU as I can.
I suppose one way around this would be to create a characteristic which is, say, 20 bytes in length, and then buffer the sensor data and then send out 20 bytes every time. However, in the case of larger MTU sizes and DLE, I guess I would need to take care of the following:
- I need to keep track of the connection MTU size so I can send the optimal number of bytes per notification
- I need to set the characteristic max length to the max MTU size and enable the variable length attribute
Is my perception here accurate?
I was having difficulty with setting and verifying the MTU size on connection for SDK 12.3.0 (I have it working fine for SDK 14.0.0), but I'll start another thread for that if necessary.