[SOLVED] Can't send payload > 23bytes(MTU setted to 128bytes)

That event block looks like an unlikely place to request an MTU change.

From the name of the event, I imagine it is confirming the success of the attempt to change the MTU that you did not yet submit (a temporal anomaly)

Here is the doc page:
http://iot.appinventor.mit.edu/#/bluetoothle/bluetoothleintro

Here is the doc for the event:

  • MTUChanged – The MTUChanged event is run when the two BluetoothLE devices have successfully changed their maximum transmission unit (MTU) to a different value. This event will only run in response to a call to the method block RequestMTU. Parameters :
    • bytes ( number ) — The new size, in bytes, of the new MTU.

Here is the doc for the request MTU block:

  • RequestMTU – Requests a new minimum transmission unit (MUT) for the BluetoothLE connection. This feature is only supported when both devices support Bluetooth 4.2 or higher. If the MTU is changed successfully, the MTUChanged event will be run. The default MTU is 20.This block is intended for advanced apps that need to change the size of the messages sent between the BLE devices. Most developers will not need to adjust this value. Parameters :
    • bytes ( number ) — The desired MTU size.

call BluetoothLE1 RequestMTUbytes

So from the docs, you have done this completely backwards.

Just ask for the 192 MTU in AI2, and start transmitting after you got the event that tells you both sides can handle the 192 size.

1 Like