Hey guys.
I'm a bit lost on MTU, DLE and PHY. Hoping to run my understanding by you guys and see if it's correct.
Project is have 3 balls of sensors sending data continuously to a central device. At the moment using NRf52840 Express, may upgrade to sense later. Current goal is sorting out the Bluetooth communication.
I have managed to successfully send data via BLEUArt from one micro controller to another with the amount of character that will be used with the sensor balls. I believe this is taking place over 2 packets.
Looking at the throughput examples I am having trouble with what should be applied in my case.
As the project needs continuous updates from all 3 balls of sensors, I am thinking it is more efficient to send all data in one packet with the central cycling through connection events for each ball with low connection intervals (7.5ms).
My understanding is that MTU defines how long the total information coming through is and assist is organizing headers to packets? Then DLE can be altered so that all the information can be fit in one packet. Is this correct? Am I correct that wanting to contain the sensor info in one packet per connection event will result in more frequent updating between the 3 sensor balls? Is using 2 PHY going to improve this as well?
Thanks for the help.
Confused about MTU and DLE (nrf52840 express)
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- alunj
- Posts: 10
- Joined: Wed Jun 14, 2017 8:15 pm
Re: Confused about MTU and DLE (nrf52840 express)
I found this code in a github somewhere in the Adafruit tree (an example called "throughput.ino"), and it served to take my nrf52840 express traffic from 20 bytes per UART packet to ~240 - maybe the code is useful to you:
Obviously, that's if you're in C, and there's probably some other functionality to do the same if you're in CIrcuitPython.
What I understand from https://www.novelbits.io/bluetooth-5-sp ... hroughput/ is that the PHY gives faster throughput IF both peripheral and central are on BLE version 5; the DLE says "we want bigger data packets" and is a requirement for the larger MTU, and then the "requestMtuExchange" finally sets the MTU.
Since this is a communications protocol, you'll want to see if the other end needs modifications to support the higher MTU, too.
Code: Select all
void connectCallback(uint16_t conn_handle)
{
BLEConnection *connection = Bluefruit.Connection(conn_handle);
char central_name[32] = {0};
connection->getPeerName(central_name, sizeof(central_name));
Serial.print("Connected to ");
Serial.println(central_name);
// request PHY changed to 2MB
Serial.println("Request to change PHY");
connection->requestPHY();
// request to update data length
Serial.println("Request to change Data Length");
connection->requestDataLengthUpdate();
// request mtu exchange
Serial.println("Request to change MTU");
connection->requestMtuExchange(247);
What I understand from https://www.novelbits.io/bluetooth-5-sp ... hroughput/ is that the PHY gives faster throughput IF both peripheral and central are on BLE version 5; the DLE says "we want bigger data packets" and is a requirement for the larger MTU, and then the "requestMtuExchange" finally sets the MTU.
Since this is a communications protocol, you'll want to see if the other end needs modifications to support the higher MTU, too.
Please be positive and constructive with your questions and comments.