CYW 20719 BLE Congestion

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
rjmcc
Level 1
Level 1
First like received 10 sign-ins 5 sign-ins

Hi,

I am working on a project which is involving sending a large (right now on the order of 20-200KB, but eventually it could get up to a couple hundred MB) file from a NAND flash, which is hooked up to a CYW20719B1 chip, to an android app. In the interest of speed, I am sending the file from the board by using notifications, which the android app then subscribes to and uses to reconstruct the file on the phone. However, after sending a certain number of notifications, I get a GATT Congestion Event. I've tried handling the event the following ways:

1. When a congestion event is registered, the board stops reading from the flash and sending notifications, waiting for a decongestion event to occur. When I do this, I never get a decongestion event, and so the application never proceeds any further.

2. Increasing the buffer sizes: This changed the number of notifications I can send before getting the congestion event from 8 to 12, but there is not enough RAM to cover the entire file we need to send, so increasing the buffer size any more will not be a viable long term solution

3. Ignoring it: If I ignore the congestion event and keep sending data, I get errors from all the send notification calls until the last one, after which I immediately get a decongestion event. This is the only way I've found to register a decongestion event, but any data past the first 12 notifications doesn't make it to the android app.

The first two solutions are the only ones I have found recommended for solving this congestion error, and neither has worked for me, so I was wondering if there are any other ways I should be handling the congestion problem.

 

Thank you

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

We can get congestion state from wiced_bt_gatt_congestion_event_t which can be get from GATT_CONGESTION_EVT event. I think, based on it we get build the logic. One reference you can use is below example. Please check it.

https://github.com/Infineon/mtb-example-btsdk-ble-throughput/blob/master/GATT_client/tput_client_le....

Thanks,

-Dheeraj.P.K

View solution in original post

0 Likes
3 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

We can get congestion state from wiced_bt_gatt_congestion_event_t which can be get from GATT_CONGESTION_EVT event. I think, based on it we get build the logic. One reference you can use is below example. Please check it.

https://github.com/Infineon/mtb-example-btsdk-ble-throughput/blob/master/GATT_client/tput_client_le....

Thanks,

-Dheeraj.P.K

0 Likes

Thank you for the reply. The example does give me a bit of an idea of the structure that can be used around congestion issues. However, this project is built for the B2 chip, and we are using the B1 (we are trying to upgrade to the B2, but that won't happen for some time). I also did try a structure similar to this, using an if statement to check congestion before sending a notification, and when I did that the program never received an event saying it was decongested.

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Please share the working code. We can check it together.

I would recommend to create another query in the community.

0 Likes