-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue sending payloads > 245 between esp32-c6 #260
Comments
..and
Am I missing something.. or you have a typo there? Both of these cannot be true. |
@hicklin Are you aware of this |
I have added some clarifications.
|
We didn't really touch the L2CAP side of things, making a workaround for the
How much rush do you have? Is there a meaningful workaround you can do, on your end? |
FYI: we will definitely make more things configurable on our side but it might not happen too soon since we are currently busy with a few higher prio tasks |
@hicklin Could you provide the output of this log line for the different cases? https://github.com/embassy-rs/trouble/blob/main/host/src/host.rs#L863-L866 I'm wondering if this might be related to different max acl data size vs. l2cap mtu. The l2cap channel does not do fragmenting according to ACL max (https://github.com/embassy-rs/trouble/blob/main/host/src/channel_manager.rs#L592), which causes issues if ACL max is lower than l2cap mtu. |
For all of the mentioned payload ranges between two esp32-c6s, that log says the same thing.
|
Environment
This issue was observed while running the
ble_l2cap
examples on esp32-c3 and esp32-c6 devices.Happy path
There are a few cases where the following issue is not observed. This might help identify what the issue might be.
esp32c6 <--> esp32c3
When running the
bel_l2cap_central
example on the esp32-c6 and theble_l2cap_peripheral
example on the esp32-c3, the example works. If thePAYLOAD_LEN
is set to500
or more, the example still works.esp32c6 <--> esp32c6 with
PAYLOAD_LEN < 246
When running both the
bel_l2cap_central
and exampleble_l2cap_peripheral
on two separate esp32-c6s the example works.The issues
The following issues are observed when running both the
bel_l2cap_central
and exampleble_l2cap_peripheral
on two separate esp32-c6s.PAYLOAD_LEN > 248
In this case, the
ch1.send::<_, L2CAP_MTU>(&stack, &tx).await.unwrap();
fails with the errorThis error was tracked to the
.write_acl_data
call inAclSender::send
method. This calls theAclPacket
'swrite_hci
method in thebt-hci-0.2.0/src/data.rs:202
which returns the errorFull
on the final linewriter.write_all(self.data)
.Possible cause
This may be caused by incorrect chunking of larger payloads when the
L2CAP_MTU != 251
. For the esp32-c3, theL2CAP_MTU == 251
while for the esp32-c6 this is set to 255. Hence, when the esp32-c6 and esp32-c3 are communicating, anL2CAP_MTU
of 251 is negotiated, and the example works. However, when two esp32-c6s are communicating, anL2CAP_MTU
of 255 is used. This may why it works when an esp32-c3 is involved.248 >= PAYLOAD_LEN > 245
With payloads in this range, the following different error is observed.
There seem to be issues in payload management for larger MTUs != 251.
The text was updated successfully, but these errors were encountered: