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

lte link control outside coverage

I have been testing lte_lc_init_and_connect with my units inside a Faraday cage, This method doesn't terminate when it cannot get a signal (at least I haven't seen it). This, together with watchdogs to ensure reboots in case of eternal loops,will cause the unit to rebot constantly. This will drain the battery, and is not a desired behaviour. 

A good workaround is highly desired!

Parents
  • Hi.

    The lte_lc_init_and_connect function waits indefinitely for a semaphore which is signaled when the modem establishes a connection. The function not returning when there is no coverage is therefore intended behavior.

    If you do not want it to potentially wait forever you can change the timeout argument in the k_sem_take call on line 123 in ncs/nrf/drivers/lte_link_control/lte_lc.c.

    E.g. if you change it from

    k_sem_take(&link, K_FOREVER);

    to

    if (k_sem_take(&link, K_MINUTES(5)) != 0) {
        return -EAGAIN;
    }

    lte_lc_init_and_connect will return -EAGAIN if it were unable to connect within 5 minutes. I have not tested it properly so there might be unintended consequences. As we do not do anything with the modem it will still be active, but the application will not be notified if we establish a connection.

    Best regards,

    Didrik

Reply
  • Hi.

    The lte_lc_init_and_connect function waits indefinitely for a semaphore which is signaled when the modem establishes a connection. The function not returning when there is no coverage is therefore intended behavior.

    If you do not want it to potentially wait forever you can change the timeout argument in the k_sem_take call on line 123 in ncs/nrf/drivers/lte_link_control/lte_lc.c.

    E.g. if you change it from

    k_sem_take(&link, K_FOREVER);

    to

    if (k_sem_take(&link, K_MINUTES(5)) != 0) {
        return -EAGAIN;
    }

    lte_lc_init_and_connect will return -EAGAIN if it were unable to connect within 5 minutes. I have not tested it properly so there might be unintended consequences. As we do not do anything with the modem it will still be active, but the application will not be notified if we establish a connection.

    Best regards,

    Didrik

Children
No Data
Related