at_cmd_set_notification_handler handler not called


I have nRF9160 modem DK. I am working a project based on http sample.

The LTE is initialized through the call:


But after ( in the function : w_lte_lc_init_and_connect(); )

    k_sem_take(&link, K_FOREVER);

    // IF I send a command here: the at_handler() is not called: at_cmd_write("AT+CMD=?", NULL, 0, NULL);


After the initialization, in the main.c, if I add:


And if I send modem command:

    at_cmd_write("AT+CMD=?", NULL, 0, NULL);

static void MyModemAtHandler (char* msg) {  // THIS IS NEVER CALLED


What did I miss?

Thank you,


  • Hi,

    The at_cmd_set_notification_handler() has been replaced by
    at_notif_register_handler() in order to support several notification handlers. This happend in PR 1163. So try using at_notif_register_handler() instead. If you are on tag v1.0.0, you should update to release/tag v1.1.0 or v1.2.0