nrf9160 lte_handler() functuion not working properly

Hi,

I have using  lte_handler(const struct lte_lc_evt *const evt)  function to get the connection details.

I'm facing a problem when i remove the antenna its still show LTE connected  and pushing data to AWS but in AWS we are not getting any data after that i tried to reset the device then its showing LTE not available may i know why lte_handler not giving LTE not available after remove the antenna

static void lte_handler(const struct lte_lc_evt *const evt)
{
    switch (evt->type)
    {
    case LTE_LC_EVT_NW_REG_STATUS:
        if ((evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_HOME) &&
            (evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_ROAMING))
        {
            printk("Network registration status: %d\n", evt->nw_reg_status);
            if (!lte_connected)
            {
                break;
            }

            lte_connected = false;
            /* Notify main function that LTE is disconnected */
            lte_cb(LTE_CONNECTION_DISCONNECTED);
            if (k_delayed_work_remaining_get(&lte_reconnect_work) > 0)
            {
                printk("LTE Reconnect work already scheduled\n");
            }
            else
            {
                scheduleLTEReconnect(lte_reconnection_delay_s[atomic_get(
                    &lte_reconnection_attempts)]);
            }
            break;
        }

        printk("Network registration status: %s\n",
               evt->nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME
                   ? "Connected - home network"
                   : "Connected - roaming");
        /* Notify main function that LTE is connected */
        lte_cb(LTE_CONNECTION_CONNECTED);

        k_sem_give(&lte_connected_sem);
        k_delayed_work_cancel(&lte_reconnect_work);
        atomic_set(&lte_reconnection_attempts, 0);
        lte_connected = true;
        break;

    case LTE_LC_EVT_PSM_UPDATE:
        printk("PSM parameter update: TAU: %d, Active time: %d\n",
               evt->psm_cfg.tau, evt->psm_cfg.active_time);
        break;

    case LTE_LC_EVT_RRC_UPDATE:
        printk("RRC mode: %s\n", evt->rrc_mode == LTE_LC_RRC_MODE_CONNECTED
                                     ? "Connected"
                                     : "Idle");
        break;

    case LTE_LC_EVT_CELL_UPDATE:
        printk("LTE cell changed: Cell ID: %d, Tracking area: %d\n",
               evt->cell.id, evt->cell.tac);
        last_cellID = evt->cell.id;
        last_tac    = evt->cell.tac;
        break;

    case LTE_LC_EVT_EDRX_UPDATE:
    default:
        break;
    }
}

 if ((err = lte_lc_connect_async(lte_handler)) != NBIOT_ERROR_OK)
    {
        printk("Modem could not be configured, error: %d\n", err);
        errorHandler_process(err);
    }

Thanks 

Parents
  • Hi Bhanu,

    I did a similar test with nRF9160: UDP — nRF Connect SDK 2.4.0 documentation (nordicsemi.com) sample by adding "printk("Network registration status: %d, LTE not connected!!!\n", evt->nw_reg_status);"into let_handler function in main.c.

    	case LTE_LC_EVT_NW_REG_STATUS:
    		if ((evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_HOME) &&
    		     (evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_ROAMING)) {
    			printk("Network registration status: %d, LTE not connected!!!\n", evt->nw_reg_status);
                            break;
    		}

    I put the nRF9160DK into a metal box, and close it after one UDP send action and get the following information immediately.

    Transmitting UDP/IP payload of 38 bytes to the IP address 8.8.8.8, port number 2469
    Network registration status: 2, LTE not connected!!!
    LTE cell changed: Cell ID: -1, Tracking area: -1
    Transmitting UDP/IP payload of 38 bytes to the IP address 8.8.8.8, port number 2469
    

    Could you do similar tests? Adding the following prj.conf will help to get more debug information.

    CONFIG_SERIAL=y
    CONFIG_UDP_DATA_UPLOAD_FREQUENCY_SECONDS=30
    CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y

    Best regards,

    Charlie

  • HI,

    but in our case after remove the antenna its showing lte connected but while sending data to AWS its showing it transmitting but we are not able to data in AWS. if we do a reset then its showing lte not connected.

Reply Children
No Data
Related