cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Reconnection issues, event not triggered

ALedi.1
Associate III

Hello community,

I am running a modified version of the p2p_routeur_app example and everything is running smoothly except for some rare reconnection issues. The peripheral is a remote control that sends a lever signal to the central and often the peripheral looses connection because the remote is being used in maritime environment (occasional signal loss is totally fine), the problem is that only 5 times a connection can be lost and reconnected because at every reconnection, a new connection is established instead of the old one being reused.

Only 6 simultaneous connections can be handled because of BLE_CFG_CLT_MAX_NBR_CB = 6 . So every time the connection is lost for more than 5 times i have to restart the central, otherwise the peripheral will not reconnect.

 

I solved the issue by simply reusing and overriding the old connections via aP2PClientContext[index] by using index 0 for new connections. This fixed the limitation of only 5 possible reconnections. Now occasionally and randomly after sometimes 20, 50 or even 100 reconnection attempts, the Client_Event_Handler() is not called with the event ACI_ATT_READ_RESP_VSEVT_CODE , which is essential to update the lever signal of the peripheral connection.

The connection is successful and appears as a working connection, but the lever signal is not being updated via BLE

The events in the client_event_handler() are triggered by the stack I assume, so its impossible for me to find the reason why this particular event is sometimes missing. The correct order of events should be:

(...)
Client Event Handler() called with eventcode ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE
-->

Client Event Handler() called with eventcode ACI_ATT_READ_RESP_VSEVT_CODE
-->
Client Event Handler() called with eventcode ACI_GATT_PROC_COMPLETE_VSEVT_CODE

But as mentioned in some rare cases, the events triggered are like this:

(...)
Client Event Handler() called with eventcode ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE
-->
Client Event Handler() called with eventcode ACI_GATT_PROC_COMPLETE_VSEVT_CODE

and then its stuck where Client_Event_Handler() is only being called with event ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE until eternity.

Any help why this occurs or any additional information to how events are triggered (or how i can manually trigger certain events), or maybe even a graph or table that shows how the different events are interconnected with each other would be highly appreciated.


1 REPLY 1
ALedi.1
Associate III

solved it.