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

modem_info_short_get fails

Calling modem_info_short_get for the parameters MODEM_INFO_MCC, MODEM_INFO_MNC, MODEM_INFO_AREA_CODE and MODEM_INFO_CELLID fail. Call to modem_info_short_get works with MODEM_INFO_CUR_BAND.

I suspect the problem is in code. Tracing the MCC call shows that the call makes the correct AT query to the modem. However, the parameter returned is (rightly) a string. However the value expected for that parameter is a short so the call fails. Trying to call modem_info_string_get fails because the value is typed as a short in the parameter array.

I believe the answer is to pull the string then convert into a short. Or retype as a string and pull the first 3 characters of the string parameter.

Doug

Parents
  • Hi Doug, 

    Can you please give some more information on what version of modem firmware you are using? What version of NCS are you running? Where did you try to call these commands?

    Thanks!

    Kind regards,
    Øyvind

  • The modem firmware is 1.0.0.  The Connect SDK is 1.0.0. I loaded the AT_Client sample and entered the following commands to confirm.

    AT+CGMM returned nRF9160-SICA
    AT+CGMR returned mfw_nrf9160_1.0.0

    I called these commands after calling lte_lc_init_and_connect and it returning successfully.  Let me know if you need any more information.

    Doug

    
    
    
    
    
    
  • The commands you are referring to are part of NCS master branch, but you say you are using NCS v1.0.0. These commands will not work if you are using v1.0.0. Please verify. 

    Kind regards,
    Øyvind

  • Apparently, I have a documentation / code mismatch. My mistake cost me a fair amount of time.


    A small request would be that if an equate for a function is not supported, it not be defined in that version of the code.

  • I believe I have updated my build tree to 1.0.99. I have rebuilt my test code and the calls still fail. 

  • For v1.0.0, which is a stable release, we have not added these to documentation or code. 

    NCS Documentation for Master branch (updated weekly)

    NCS Documentation for tag v1.0.0

    To enable these commands, using the master branch, you must switch to master branch using

    cd <NCS_root>\nrf
    git checkout master
    west update

    This will enable these commands in modem_info.c (master branch)

    static const struct modem_info_data *const modem_data[] = {
    	[MODEM_INFO_RSRP]	= &rsrp_data,
    	[MODEM_INFO_CUR_BAND]	= &band_data,
    	[MODEM_INFO_SUP_BAND]	= &band_sup_data,
    	[MODEM_INFO_UE_MODE]	= &mode_data,
    	[MODEM_INFO_OPERATOR]	= &operator_data,
    	[MODEM_INFO_MCC]	= &mcc_data,
    	[MODEM_INFO_MNC]	= &mnc_data,
    	[MODEM_INFO_AREA_CODE]	= &area_data,
    	[MODEM_INFO_CELLID]	= &cellid_data,
    	[MODEM_INFO_IP_ADDRESS]	= &ip_data,
    	[MODEM_INFO_UICC]	= &uicc_data,
    	[MODEM_INFO_BATTERY]	= &battery_data,
    	[MODEM_INFO_TEMP]	= &temp_data,
    	[MODEM_INFO_FW_VERSION]	= &fw_data,
    	[MODEM_INFO_ICCID]	= &iccid_data,
    	[MODEM_INFO_LTE_MODE]	= &lte_mode_data,
    	[MODEM_INFO_NBIOT_MODE] = &nbiot_mode_data,
    	[MODEM_INFO_GPS_MODE]   = &gps_mode_data,
    };

    While in v1.0.0

     

    static const struct modem_info_data *const modem_data[] = {
    	[MODEM_INFO_RSRP] = &rsrp_data,
    	[MODEM_INFO_BAND] = &band_data,
    	[MODEM_INFO_MODE] = &mode_data,
    	[MODEM_INFO_OPERATOR] = &operator_data,
    	[MODEM_INFO_CELLID] = &cellid_data,
    	[MODEM_INFO_IP_ADDRESS] = &ip_data,
    	[MODEM_INFO_UICC] = &uicc_data,
    	[MODEM_INFO_BATTERY] = &battery_data,
    	[MODEM_INFO_TEMP] = &temp_data,
    	[MODEM_INFO_FW_VERSION] = &fw_data,
    	[MODEM_INFO_ICCID] = &iccid_data,
    };

    Let me know how that works for you.

Reply
  • For v1.0.0, which is a stable release, we have not added these to documentation or code. 

    NCS Documentation for Master branch (updated weekly)

    NCS Documentation for tag v1.0.0

    To enable these commands, using the master branch, you must switch to master branch using

    cd <NCS_root>\nrf
    git checkout master
    west update

    This will enable these commands in modem_info.c (master branch)

    static const struct modem_info_data *const modem_data[] = {
    	[MODEM_INFO_RSRP]	= &rsrp_data,
    	[MODEM_INFO_CUR_BAND]	= &band_data,
    	[MODEM_INFO_SUP_BAND]	= &band_sup_data,
    	[MODEM_INFO_UE_MODE]	= &mode_data,
    	[MODEM_INFO_OPERATOR]	= &operator_data,
    	[MODEM_INFO_MCC]	= &mcc_data,
    	[MODEM_INFO_MNC]	= &mnc_data,
    	[MODEM_INFO_AREA_CODE]	= &area_data,
    	[MODEM_INFO_CELLID]	= &cellid_data,
    	[MODEM_INFO_IP_ADDRESS]	= &ip_data,
    	[MODEM_INFO_UICC]	= &uicc_data,
    	[MODEM_INFO_BATTERY]	= &battery_data,
    	[MODEM_INFO_TEMP]	= &temp_data,
    	[MODEM_INFO_FW_VERSION]	= &fw_data,
    	[MODEM_INFO_ICCID]	= &iccid_data,
    	[MODEM_INFO_LTE_MODE]	= &lte_mode_data,
    	[MODEM_INFO_NBIOT_MODE] = &nbiot_mode_data,
    	[MODEM_INFO_GPS_MODE]   = &gps_mode_data,
    };

    While in v1.0.0

     

    static const struct modem_info_data *const modem_data[] = {
    	[MODEM_INFO_RSRP] = &rsrp_data,
    	[MODEM_INFO_BAND] = &band_data,
    	[MODEM_INFO_MODE] = &mode_data,
    	[MODEM_INFO_OPERATOR] = &operator_data,
    	[MODEM_INFO_CELLID] = &cellid_data,
    	[MODEM_INFO_IP_ADDRESS] = &ip_data,
    	[MODEM_INFO_UICC] = &uicc_data,
    	[MODEM_INFO_BATTERY] = &battery_data,
    	[MODEM_INFO_TEMP] = &temp_data,
    	[MODEM_INFO_FW_VERSION] = &fw_data,
    	[MODEM_INFO_ICCID] = &iccid_data,
    };

    Let me know how that works for you.

Children
Related