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

Central receiving more than 23 bytes as a notification

Hello community,

I am working in a central device with SDK 13 v. 4, PCA10400 (NRF52832) and SD 132 and one task is to receive 30 bytes from a sensors as a notifcation, but unfortunally I dont get anything, the MTU is already set up in ble_stack_init() as the following:

 #define NRF_BLE_MAX_MTU_SIZE    34

// Configure the MTU
memset(&ble_cfg, 0, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag = CONN_CFG_TAG;
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_BLE_MAX_MTU_SIZE;
err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_cfg, ram_start);

What else should the programm have in order to receive the 30 bytes from the sensor?

Regards,

David Caraveo

Parents
  • Hi David,

    MTU size is agreed on every connection (BLE stacks are usually doing it automatically at the beginning) and it will settle down on value which is minimum of both max supported values on both sides. So also your peer must be able to support larger (G)ATT MTUs. Do you have a trace from BLE sniffer to see what is happening on the radio?

Reply
  • Hi David,

    MTU size is agreed on every connection (BLE stacks are usually doing it automatically at the beginning) and it will settle down on value which is minimum of both max supported values on both sides. So also your peer must be able to support larger (G)ATT MTUs. Do you have a trace from BLE sniffer to see what is happening on the radio?

Children
  • I dont have any sniifer, I am using pca10040 and the sniffer program does not support it. I've a doongle of Cypress company and it receives the 30 bytes via notication but when I use nRF connect with my pca10040 I can not receive any notification and if i read them it returns an error:

    Read operation failed: BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG (0x010B)

    why do you know i cannot get this 30 bytes?

  • Why? I don't know anything, I'm just giving you suggestions. The problem is that you give too high level hints (like "it works with Cypress but not with Nordic DK"). There can be so many things different... the only thing which is for sure (but from your description you seems to understand this so you are heading in the right direction for debugging): Notification cannot be longer then current ATT_MTU size agreed on the connection link. So now it's question how exactly you control both link sides and what ATT_MTU is agreed on particular link. Having the sniffer (and there is one unofficial Nordic sniffer binary released for PCA10040 nRF52 DK on this forum) is the best and fastest way but you can try to get glimps of that on higher debugging layers as well...

  • Hi DavidC. As Endnode mentioned, there is an unofficial sniffer app for the nrf52. You can find it here. Could also be useful to look at the nrf sniffer user guide here.

  • Thanks for the file, i'm able to check what is going on using nrf Connect to activate the notifications on the peripheral is ok but it's not receiving any notifcation, on the other hand when it tries to read the characteristics, the sniffer throws the following error: Source: Destination Protocol length Info Master Slave ATT 35 Rcvd Read Blob Request, Handle 0x0032, offset:22 Slave Master ATT 35 Rcvd Error response - Attribute not long, Handle: 0x0037 But when I am using the cysmart from Cypress in order to get the notification, i got the following: Source: Destination Protocol length Info Slave Master L2CAP 27 Rcvd Malformed packet But Im still having the data on my cellphone.

  • for readind using cypress

    Source: Destination Protocol length Info Master Slave ATT 33 Rcvd Read Request, Handle: 0x0037 Slave Master ATT 57 Rcvd Read Response

Related