How to set MTU for BLEUARTClient
-
Hello, I am trying to receive data on a Core2 that I am sending from an Atom S3 Lite.
On the S3, I send the data via BLE server with a simple ‘write’ and I can read the data on a smartphone.
When I establish a connection on the Core2 as a BLE client, the connection works, but with ‘read’ I only get the first 20 characters of the sent data.
This is probably normal for BLE connections, but I get the full length on the smartphone, so sending is not the problem. Normally, you can set an MTU on the receiving side. However, the ‘set_mtu’ command does not seem to exist on the Core2.
The ‘new’ library contains this ‘set_mtu’ command.
HOW can you set the MTU on the Core2 BLE client?
-
I have now tested the ‘new’ BLE Brick, and although it has an MTU command, the following error occurs:
Traceback (most recent call last):
File ‘<stdin>’, line 27, in ble_client_on_connected_event
File ‘m5ble/m5ble.py’, line 556, in set_mtu
ValueError: Not connected to a serverI set the MTU within the ‘ble_client_on_connected_event’ function, which is only called after connecting to the server, and I can both read and write with the server.
-
Btw:
The BLE server can send and receive long messages.
The BLE client can send long messages, but has this limitation for received messages.