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

Unable to send more than 20 bytes per notification

Hi,

My requirement is to send a bulk of sensor data over BLE to view on the app, I have taken dummy 1000 samples and successfully transferred them by dividing it into chunks of 20 bytes per notification interval. In 10 seconds i'm able to send all the 1000 samples successfully, i would like to send more data samples per notification interval. I have read many comments and queries regarding this but haven't found any clear cut answer. I tried changing the "NRF_SDH_BLE_GATT_MAX_MTU_SIZE" to 247 but then my device is not being discovered at the app side. The code which i am working on contains a custom service with one characteristic which sends an integer data for every notification interval of 100ms.

i have attached the project below, currently working on nrf52832, sdk15 on segger embedded studio.

Please help.8484.ECG_BLE.zip

Parents
  • Hi Sandeep 

       I came across this issue before. I set the NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 247. I use my old android device to receive data packets but android ble rejects the request to extend the MTU size to 247. However, i change the android device and it works fine. You can sniff the ble packets with Wireshark to see mid-air data packets. 

    err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
    	
    err_code =nrf_ble_gatt_data_length_set(&m_gatt,BLE_CONN_HANDLE_INVALID,packet_length);  
    APP_ERROR_CHECK(err_code);

    You can use this function in the gatt_init function.

    Best regards. 

Reply
  • Hi Sandeep 

       I came across this issue before. I set the NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 247. I use my old android device to receive data packets but android ble rejects the request to extend the MTU size to 247. However, i change the android device and it works fine. You can sniff the ble packets with Wireshark to see mid-air data packets. 

    err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
    	
    err_code =nrf_ble_gatt_data_length_set(&m_gatt,BLE_CONN_HANDLE_INVALID,packet_length);  
    APP_ERROR_CHECK(err_code);

    You can use this function in the gatt_init function.

    Best regards. 

Children
No Data
Related