IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.61k stars 490 forks source link

Set MTU to 247 sucessfully yet only a payload of 20 bytes are written. #475

Open Nicolas72 opened 2 years ago

Nicolas72 commented 2 years ago

Howdy folks, I have this weird issue that i can not resolve. First off, I am using the compiled version of BluePy (1.3.0 with the MTU fix etc etc) Bluez is at version 5.53. My problem is that when i negotiate the new MTU I end up with 247 or 244 bytes as a payload. While i can write this perfectly fine, looking with wireshark, it says that the packets get disassembled and reassembled. In other words when i write 244 bytes it gets split into 12 packets which are sent separately so there is no speed gain whatsoever. I know that both my adapter and the peripheral are capable of handling this. Writing to the device using an Android app sends the 244 in one go just fine. When setting the MTU does the PDU get adjusted as well ? If not, how can i achieve this ? Is this something that is related to bluez or bluepy itself ? Compatibility etc etc. It is not a big issue but i was wondering what the purpose of negotiating a new MTU is if the payload stays the same.

444 19.136529 localhost () ef:9f:5c:0f:cb:41 () HCI_ACL 32(length)Sent [Reassembled in #454] 445 19.136548 localhost () ef:9f:5c:0f:cb:41 () HCI_ACL 32(length)Sent [Continuation to #444] [Reassembled in #454] etc etc.

Any advice on what is going here would be appreciated

Nicolas

pszkotak commented 1 year ago

@Nicolas72, did you find any fix?