Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Issue with Receiving Data in Nordic Mesh Library with ESP32 BLE Mesh on Android

I am using the Nordic Mesh Library with an ESP32 IDF-based application on the ESP32 side, and I am using ESP32 BLE Mesh. On the Android side, I have created a node to send data using the vendor module. The data is sent properly, but the issue is that the data is being received with significant delay—approximately 10 seconds. Additionally, only 20 bytes are being received, even when I request an MTU of 517. The following log is from the device:

configureMTU() - device: XX:XX:XX:XX:03:8E mtu: 517
onConfigureMTU() - Device=88:13:BF:29:03:8E mtu=23 status=0

In the log above, the MTU is set to 517, but the return value is 23. How can I receive more than 20 bytes of data using meshMessage? I am able to retrieve data, but only in small chunks.

Request:

  • Guidance on how to receive more than 20 bytes of data using the mesh network.
  • Explanation of why the MTU is not matching the requested value of 517 and how to resolve it.
  • Hi,

    MTU size is for packets sent over the GATT connection between the phone and the Bluetooth Mesh device, over which Bluetooth Mesh packets are tunneled. MTU size does not impact the size of Bluetooth Mesh messages, it only affects how those messages are sent at the lower layers of the Bluetooth mesh stack. What MTU size you get for a BLE connection depend on the capabilities of both devices in the connection, and not all devices can handle larger MTU sizes.

    Bluetooth Mesh stacks for Android, including the one from Nordic, support longer Bluetooth Mesh messages regardless of what MTU sizes are supported by the smartphone.

    You mention 20 bytes, and if that is Bluetooth Mesh message payload you get, then you manage to send Bluetooth Mesh messages that uses Segmentation And Reassembly (SAR) from the Bluetooth Mesh specification. (The maximum unsegmented message size in Bluetooth Mesh is 11 bytes including opcode.) For SAR messages, the upper bound for payload size is be 377 to 379 bytes plus a 1 to 3 byte opcode, provided that both the Bluetooth Mesh stack on the smartphone and on the device can handle it.

    If you do not get full Bluetooth Mesh messages when using a Bluetooth Mesh stack on an ESP device, then I recommend that you contact Espressif support or consult forums or other communities revolving around ESP devices, for looking into the issue at the microcontroller side of things.

    Regards,
    Terje

Related