This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE peripheral: Missing responses to write-with-response requests.

Hi,

I am using a 52832 part as a peripheral communicating with a central running on an ESP32.  It operates in the following manner:

1. When it is active, the peripheral sends a notification to the central.

2. When the central receives the notification, it performs a write-with-response to write a state update to the peripheral.

(Note that the UUID that is notified is always the same, and the UUID that is written is always the same).

So what I'd expect to see in a sniffer log is something like this:

P -> C: Notify

C -> P: Write

P -> C: Response

P -> C: Notify

C -> P: Write

P -> C: Response

etc.

Most of the time, everything works fine.  When the peripheral receives a write, our application sees the BLE_GATTS_EVT_WRITE event.  

The trouble is that sometimes, our application does not see the BLE_GATTS_EVT_WRITE event, and the response to the write is never sent by the peripheral.  This causes the central to close the connection due to the write-with-response timing out.

I have attached a Wireshark capture showing the failure.  The notification/write/response sequence begins around 124 seconds.  You can see things proceed normally, with matched write requests and write responses.  

An example of a failure case is between 130.172 and 130.471.  There, you see two write requests, but the only response is sent at 130.474, and our application only receives BLE_GATTS_EVT_WRITE for one of the two writes.  I don't believe there could be a lost packet because there is no error in the sequence numbers.  It looks like the peripheral processed, but otherwise completely ignored, one of the write requests.  

Any idea what's going on?  

My connection parameters are as follows: min_int = 60, max_int = 120,conn_int = 120,latency = 90, timeout = 3000

BLE_Failure.pcapng

Parents
  • Hi zacwbond,

    Which SDK and SoftDevice version is used by your application? I see that there is a similar situation with packet number 9051 and 9053 as well. The weird thing is that the ESP32 is sending the second Write Request before receiving the response from the nRF52. This is in violation of the Bluetooth specification,

    Core_v5.2, Vol 3, Part F, Section 3.3.2:
    Once a client sends a request to a server, that client shall send no other request to the same server on the same ATT bearer until a response PDU has been received.

    so I believe that the SoftDevice on the nRF52 will ignore the second request.

    Best regards

    Bjørn

Reply
  • Hi zacwbond,

    Which SDK and SoftDevice version is used by your application? I see that there is a similar situation with packet number 9051 and 9053 as well. The weird thing is that the ESP32 is sending the second Write Request before receiving the response from the nRF52. This is in violation of the Bluetooth specification,

    Core_v5.2, Vol 3, Part F, Section 3.3.2:
    Once a client sends a request to a server, that client shall send no other request to the same server on the same ATT bearer until a response PDU has been received.

    so I believe that the SoftDevice on the nRF52 will ignore the second request.

    Best regards

    Bjørn

Children
No Data
Related