This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MODEM_EVT_ERROR causes a boot loop when the SIM card is missing

I am testing the Asset_tracker_v2 application on thingy-91. I took the SIM card out so the device goes into the boot loop.

The on_state_init () function has the condition MODEM_EVT_ERROR which happens here. As a result, a reboot is performed.

The question is how do I know that now the SIM card is missing?

Can I check based on sim-id (iccid)? That is zero in this situation.

Best Regards

-Alpo

  • Hello Alpo,

    The question is how do I know that now the SIM card is missing?

    I’m not sure if I understand your question and use case.

    Since you removed the SIM card and as a result, Asset Tracker v2 sends a reset request, you should be aware of that your device doesn’t operate with a SIM card at that time?

    Regards,

    Markus

  • Hello Markus,

    I want to make the application so that the lack of a SIM card does not cause a reset request. But the application remains in a fault state to flash the red LED.

    Where does the application get information that the SIM card is missing?

    Regards,

    -Alpo

  • Hi, I wish to tag a long for this. Sometimes my sensors won't have signal and will require separate code to be run. Is there anyway to check if the sim card is inserted or not? This would provide a nice way of telling what mode should be run. If not, is there a way to check for connectivity and then decide?

    Regards

  • Hello Alpo & Niclas,

    AlpoLe said:

    Where does the application get information that the SIM card is missing?

    The modem will report an UICC failure during connect, see lte_evt_handler() in Asset Tracker v2. Additional information can be requested using %XSIM.

    Regards,

    Markus

  • Thanks Markus,

    With this information, I will be able to continue the development work.

    case LTE_LC_EVT_NW_REG_STATUS:
    		if (evt->nw_reg_status == LTE_LC_NW_REG_UICC_FAIL) {
    			LOG_ERR("No SIM card detected!");
    			SEND_ERROR(modem, MODEM_EVT_ERROR, -ENOTSUP);
    			break;
    		}
    

    Regards,

    -Alpo

Related