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

Error 133 (0x85): GATT ERROR with custom service tutorial

Hello,

I am new to the Nordic Environment. I am following the excellent tutorial to create a custom service and characteristic.

Everything worked fine until Step 6(Handling the Write event from soft device). 

However, after working on Step 7 & 8(Propagating Custom Service Events to Application and Notifying the Custom Value Characteristic), I get Error 133: GATT ERROR on the nRF Connect app (on a One Plus 5) when I try to connect to the advertised label. 

I have read the other posts related to this issue but can't my sense of them with respect to my case.  What could be the reason for sudden occurrence of this error?

Please help.

Thanks

Parents
  •  I have followed your excellent tutorial on developing a custom service. However as soon as I invoke the event handler from ble_cus.c by calling p_cus->evt_handler(p_cus, &evt), I get a GATT ERROR when trying to connect from the app. What could be happening? I would greatly appreciate your help. Thanks

  • Hi RO, have you added the line that sets on_cus_evt as the event handler in services_init() as shown below?

            // Initialize CUS Service init structure to zero.
            ble_cus_init_t      cus_init = {0};
    
            // Set Custom Service Event handler
            cus_init.evt_handler                = on_cus_evt;
        
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.cccd_write_perm);
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.read_perm);
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.write_perm);
        
            err_code = ble_cus_init(&m_cus, &cus_init);
            APP_ERROR_CHECK(err_code);

Reply
  • Hi RO, have you added the line that sets on_cus_evt as the event handler in services_init() as shown below?

            // Initialize CUS Service init structure to zero.
            ble_cus_init_t      cus_init = {0};
    
            // Set Custom Service Event handler
            cus_init.evt_handler                = on_cus_evt;
        
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.cccd_write_perm);
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.read_perm);
            BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cus_init.custom_value_char_attr_md.write_perm);
        
            err_code = ble_cus_init(&m_cus, &cus_init);
            APP_ERROR_CHECK(err_code);

Children
Related