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
  • 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,

Children
No Data
Related