Bluetooth Serial Throughput / MTU using CoreBluetooth and Embedded IoT Accessory

Currently we are working on an IoT Accessory for Industrial Control connecting an iPadOS to an ESP32 bridge to ModBus/CanBus using CoreBluetooth.

We are concern about the Maximum Payload Size (MTU Limits) on Bluetooth as we need to send and receive long strings of ModBus/CanBus commands and responses. How to best use CoreBluetooth to ensure that the serial stream is reliable and smooth.

As the Maximum Payload Size (MTU Limits) will affect the baud rate which we need to sync with the ModBus/CanBus on the other end, what techniques we can use to ensure the stable connection so that this CoreBluetooth link doesn't become a bottleneck.

Are there any best practices we should be using or are we over thinking a simple Bluetooth Serial Characteristic

Answered by Engineer in 892971022

ok got it. From the CoreBluetooth connection, there is nothing to explicitly configure.

For large data transfer, you may be to make sure your accessory supports LE connection-oriented channels with enough credits allowed. If you see a particular issue with the throughput, is it possible to file a feedback request? We can then see the details since every accessories may have different configurations. Here are the instructions to file the feedback request :

https://developer.apple.com/feedback-assistant/profiles-and-logs/

Hi thanks for the question. You can read more about this topic here https://developer.apple.com/accessories/

In summary, the MTU will be negotiated between the device and accessory and we will pick the optimal value based on the link condition. You should confirm with your accessory if it allows the desired MTU size.

On our previous project we had issues doing large data transfers over BLE causing issues (Back then we had connected an iOS device to a RaspberryPI), This time due to connecting almost directly to ModBus/CanBus we worry about Bluetooth issues to ensure reliable serial connections and not cause issues on the other end of the bridge (The IoT Accessory is a simple bridge from BLE to Serial, no caching, no error checking)

On paper it seems not to be a major issue, but are there any settings or modes when we setup the CoreBluetooth Connection or techniques we should use to prevent Throughput and reliability issues.

Accepted Answer

ok got it. From the CoreBluetooth connection, there is nothing to explicitly configure.

For large data transfer, you may be to make sure your accessory supports LE connection-oriented channels with enough credits allowed. If you see a particular issue with the throughput, is it possible to file a feedback request? We can then see the details since every accessories may have different configurations. Here are the instructions to file the feedback request :

https://developer.apple.com/feedback-assistant/profiles-and-logs/

Bluetooth Serial Throughput / MTU using CoreBluetooth and Embedded IoT Accessory
 
 
Q