This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Notifications not being received from the peripheral device

I'm building a project on the nRF52382 with the S132 SoftDevice. The project includes a Central device (GATT Client) that reads values from a peripheral device. I used the ble_app_hrs_c_pca10040 projects as a template.

The peripheral device in question needs to be paired to the central device for the communication to work. The connection is established and bonding is successful. The peripheral device has a write characteristic, where requests are written, and a notification characteristic where a response is sent to the central device.

The problem I have is that although the notification is enabled, the ble_evt_handler is not called when the notification is expected. On the nRF Master Control Panel(Android) this works well.

image description

So far I have noticed that the problem isn't that the messages are not being written as the logs below shows this (a command sent to the peripheral device to disconnect works as expected). Is there any way to be sure what exactly is wrong with the communication?

 0>  [DM]: >> dm_init.
 0>  [DM]: Initializing Application Instance 0x00000000.
 0>  [DM]: Initializing Connection Instance 0x00000000.
 0>  [DM]: Initializing Connection Instance 0x00000001.
 0>  [DM]: Initializing Connection Instance 0x00000002.
 0>  [DM]: Initializing Peer Instance 0x00000000.
 0>  [DM]: Initializing Peer Instance 0x00000001.
 0>  [DM]: Initializing Peer Instance 0x00000002.
 0>  [DM]: Initializing Peer Instance 0x00000003.
 0>  [DM]: Initializing Peer Instance 0x00000004.
 0>  [DM]: Initializing Peer Instance 0x00000005.
 0>  [DM]: Initializing Peer Instance 0x00000006.
 0>  [DM]: Storage handle 0x0007E000.
 0>  [DM]:[0x00]: Block handle 0x0007E000.
 0>  [DM]:[DI 0x00]: Device type 0x00.
 0>  [DM]: Device Addr 0x36 0x18 0x9A 0xE5 0xF3 0xA2
 0>  [DM]:[0x01]: Block handle 0x0007E05C.
 0>  [DM]:[DI 0x01]: Device type 0xFF.
 0>  [BLE_CLIENT_C]: notification_index: 1 
 0>  [BLE_CLIENT_C]: Configuring CCCD. 
 0>  [BLE_CLIENT_C]: Conn Handle = 0, CCCD Handle = 22, Value = 1
 0>  [BLE_CLIENT_C]: WRITE_REQ...
 0>  [BLE_CLIENT_C]: conn handle >> 0
 0>  [BLE_CLIENT_C]: SD API returns Success..
 0>  [DM]: >> BLE_GAP_EVT_CONN_SEC_UPDATE, Mode 0x01, Level 0x02
 0>  [DM]: --> gattc_context_apply
 0>  [DM]: Notifying application of event 0x15
 0>  [APPL]:[0x00] >> DM_LINK_SECURED_IND, result 0x00000000
 0>  [APPL]:[0x00] << DM_LINK_SECURED_IND 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_complete: 0) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_handle: 22) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_len: 0)
 ACTION: Send message to BLE peripheral to end connection
 0>  [APPL]: BTLE_END_CONNECTION 
 0>  [APPL]:transmitted message: 0x55 0xCA 0x00 0x00 0x00 0x00 0x00 0x00 0xCA  
 0>  [BLE_CLIENT_C]: Characteristic Handle = 18, Connection Handle = 0
 0>  [BLE_CLIENT_C]:transmitted message: 0x55 0xCA 0x00 0x00 0x00 0x00 0x00 0x00 0xCA  
 0>  [BLE_CLIENT_C]: Message length >> 9 
 0>  [BLE_CLIENT_C]: WRITE_REQ...
 0>  [BLE_CLIENT_C]: conn handle >> 0
 0>  [BLE_CLIENT_C]: SD API returns Success..
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_complete: 0) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_handle: 18) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_len: 0) 
 0>  [DM]: Disconnect Reason 0x0013
 0>  [DM]: --> device_context_store
 0>  [DM]:[DI 00]:[CI 00]: -> No update in bonding information.
 0>  [DM]: --> gattc_context_store
 0>  [DM]: Notifying application of event 0x12
 0>  [APPL]:[0x00] >> DM_EVT_DISCONNECTION
 0>  [APPL]:[0x00] << DM_EVT_DISCONNECTION
 0>  [DM]:[CI 0x00]: Freeing connection instance
 0>  [DM]:[00]: Freed connection instance.
 0>  [DM]: Initializing Connection Instance 0x00000000.
 0>  [APPL]: BLE_GAP_EVT_DISCONNECTED - REASON 0x13
 ACTION: Start scan immediately after disconnection
 0>  [APPL]: Target - 20003300
 0>  [APPL]: Connection Request Successful 
 0>  [DM]: Request to allocation connection instance
 0>  [DM]:[00]: Connection Instance Allocated.
 0>  [DM]: Searching for device  0x36 0x18 0x9A 0xE5 0xF3 0xA2
 0>  [DM]:[DI 0x00]: Device type 0x00.
 0>  [DM]: Device Addr  0x36 0x18 0x9A 0xE5 0xF3 0xA2
 0>  [DM]: Found device at instance 0x00
 0>  [DM]:[00]:[Block ID 0x0007E000]:Loading bond information at 20003678, size 0x0000001C,                offset 0x00000018.
 0>  [DM]:[0x00]:[0xFF]: Bond context Event
 0>  [DM]: Notifying application of event 0x21
 0>  [APPL]:[0x00] >> DM_EVT_LINK_SECURED
 0>  [APPL]:[0x00] << DM_EVT_DEVICE_CONTEXT_LOADED
 0>  [DM]:[00]:Loading service context at 200036CC, size 0x0000000C, offset 0x00000034.
 0>  [DM]: --> gattc_context_load
 0>  [DM]: Notifying application of event 0x11
 0>  [APPL]:[0x00] >> DM_EVT_CONNECTION
 0>  [APPL]:[ 36 18 9A E5 F3 A2]: Connection Established
 0>  [DB]: Starting discovery of service with UUID 0xDF47 for Connection handle 0
 0>  [APPL]:[0x00] << DM_EVT_CONNECTION
 0>  [BLE_CLIENT_C]: BLE_GAP_EVT_CONNECTED 
 0>  [DB]: Discovery of service with UUID 0xDF47 completed with success for Connectionhandle 0
 0>  [BLE_CLIENT_C]: Client Service discovered at peer.
 0>  [BLE_CLIENT_C]: UUID: ABE3 
 0>  [BLE_CLIENT_C]: char_write_index: 0 
 0>  [BLE_CLIENT_C]: UUID: ABE4 
 0>  [BLE_CLIENT_C]: notification_index: 1 
 0>  [APPL]: Initiate bonding 
 0>  [DM]: >> dm_security_setup_req
 0>  [DM]: << dm_security_setup_req, 0x00000000
 ACTION: Enable notification on notify characteristic
 0>  [APPL]: Enable pump notification 
 0>  [BLE_CLIENT_C]: notification_index: 1 
 0>  [BLE_CLIENT_C]: Configuring CCCD. 
 0>  [BLE_CLIENT_C]: Conn Handle = 0, CCCD Handle = 22, Value = 1
 0>  [BLE_CLIENT_C]: WRITE_REQ...
 0>  [BLE_CLIENT_C]: conn handle >> 0
 0>  [BLE_CLIENT_C]: SD API returns Success..
 0>  [DM]: >> BLE_GAP_EVT_CONN_SEC_UPDATE, Mode 0x01, Level 0x02
 0>  [DM]: --> gattc_context_apply
 0>  [DM]: Notifying application of event 0x15
 0>  [APPL]:[0x00] >> DM_LINK_SECURED_IND, result 0x00000000
 0>  [APPL]:[0x00] << DM_LINK_SECURED_IND 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_complete: 0) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_handle: 22) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_len: 0) 
 ACTION: Read descriptor on notify characteristic
 0>  [BLE_CLIENT_C]: READ_REQ...
 0>  [BLE_CLIENT_C]: conn handle >> 0
 0>  [BLE_CLIENT_C]: SD API returns Success..
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_READ_RSP 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_READ_RSP (rx_handle: 22) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_READ_RSP (rx_len: 2) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_READ_RSP (rx_data: 01) 
 ACTION: Send request for internal time from peripheral device to the write characteristic
 0>  [APPL]: BLE_GET_INTERNAL_TIME 
 0>  [APPL]:transmitted message: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  
 0>  [APPL]:transmitted message: 0x55 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x01  
 0>  [BLE_CLIENT_C]: Characteristic Handle = 18, Connection Handle = 0
 0>  [BLE_CLIENT_C]:transmitted message: 0x55 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x01  
 0>  [BLE_CLIENT_C]: Message length >> 9 
 0>  [BLE_CLIENT_C]: WRITE_REQ...
 0>  [BLE_CLIENT_C]: conn handle >> 0
 0>  [BLE_CLIENT_C]: SD API returns Success..
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_complete: 0) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_handle: 18) 
 0>  [BLE_CLIENT_C]: BLE_GATTC_EVT_WRITE_RSP (tx_len: 0) 

--> no notification response
Related