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

Geolocalisation via LTE when not connected

Hi everyone,

I am trying to develop an application and I need to solve this situation : when the modem is not able to connect to LTE-M network, I still want to be able to retrieve cell-id information if available in order to track localisation of my device. So is it possible to get cell-id information when not connected via LTE-M ? Thanks

Parents Reply Children
  • Hm, are you on the latest modem firmware? And it could be that it only works if connected to LTE, however I am not sure about the details. 

  • I suspect this to be the issue:

    Neighboring cell measurements are valid and available only when neighbors are being monitored, which means that the strength and quality of the current cell signal do not meet the network configured level. For more information, see the requirements in 3GPP TS 36.304.

    To save energy, nRF9160 does not search and measure neighboring cells for mobility purposes if the level and quality of the serving cell signal are above the thresholds defined by the network.

    If you are in areas with good cell coverage, but e.g. deliberately do not want to connect (or can't because of your SIM), you don't get neighboring cell information.
  • Hello Mister Tacker, I am very sorry that I didn't answer you earlier. I am still interested if you have a solution, I am now trying to use the LTE LC module to achieve retrieving the cell information without being connected. Unfortunately, this is still not working. From what I understood, the function and more specifically the line doing the connection is this:

    static int w_lte_lc_connect(bool blocking)
    {
    int err;
    bool retry;

    if (!is_initialized) {
    LOG_ERR("The LTE link controller is not initialized");
    return -EPERM;
    }

    k_sem_init(&link, 0, 1);

    do {
    retry = false;

    err = lte_lc_system_mode_set(sys_mode_target);
    if (err) {
    return err;
    }

    err = lte_lc_normal();
    if (err || !blocking) {
    return err;
    }

    err = k_sem_take(&link, K_SECONDS(CONFIG_LTE_NETWORK_TIMEOUT));
    if (err == -EAGAIN) {
    LOG_INF("Network connection attempt timed out");

    if (IS_ENABLED(CONFIG_LTE_NETWORK_USE_FALLBACK) &&
    (sys_mode_target == sys_mode_preferred)) {
    sys_mode_target = sys_mode_fallback;
    retry = true;

    err = lte_lc_offline();
    if (err) {
    return err;
    }

    LOG_INF("Using fallback network mode");
    } else {
    err = -ETIMEDOUT;
    }
    }
    } while (retry);

    return err;
    }

    However, I didn't understand what is happening inside the k_sem_take function.

    Thank you for your help, Best regards,

  • The k_sem_take(&link, <duration>) blocks the execution of the rest of the function until the semaphore is released (either by k_sem_give(&link); or by timeout). If not connected, the function will then retry to connect.

Related