Problem with function modem_info_params_get() in TN/NTN usecase

Hello,

I am getting an error with the modem_info_params_get() function when I try to get the modem parameters. I am currently using SDK 3.2.0 with the FW MFW_nRF9151-NTN_v1.0.0-1.prealpha modem. In the code, I have TN and NTN configured where the PDN has been configured as follows:

uint8_t cid_tn = 10, cid_ntn = 0;

err = lte_lc_pdn_ctx_configure(cid_tn, "APN", LTE_LC_PDN_FAM_IPV4, NULL);
if (err) {
    LOG_ERR("Error to configure CID_TN: %d", err);
    return err;
}

err = lte_lc_pdn_ctx_configure(cid_ntn, "APN", LTE_LC_PDN_FAM_IPV4, NULL);
if (err) {
    LOG_ERR("Error to configure CID_NTN: %d", err);
    return err;
}



The error message is as follows:
[00:00:07.766,845] <err> modem_info_params: Link data not obtained: 21 -134
[00:00:07.766,845] <err> main: Error -134, modem_info_params_get


The value 21 corresponds to MODEM_INFO_APN (access point name) from the modem_info enum. I used this function on TN-only devices and had no problems. Is this function not yet supported in cases where the device has two APNs (one for TN and one for NTN)?

Regards,
GoncaloS

Parents
  • Hi GoncaloS, could you please provide a modem trace and full application log of your issue? What application are you running on your side? Do you have a nRF9151 SMA DK do test with? Have you followed the steps provided in Evalute NTN on nRF9151 SMA DK product page?

    As the instructed in the latter link, please test with the provided application.

    Kind regards,
    Øyvind

  • Hi  ,

    Sorry for the delayed response, but I needed to run some additional tests to verify whether the issue would occur again.
    I performed further testing, and the error does not appear consistently. Below are some logs from my application:

    // Error -134, modem_info_params_get() with LTE
    [23:50:28.978,240] <wrn> main: --ST_CONNECT--
    [23:50:28.998,565] <inf> main: Vbat: 100% (5.2 V)
    [23:50:28.999,450] <inf> main: MODE_OFFLINE set
    [23:50:29.000,579] <inf> main: SYSTEM_MODE_LTEM_GPS set
    [23:50:29.000,579] <inf> main: Connecting to LTE network...
    [23:50:29.041,961] <inf> main: MODE_NORMAL set
    [23:50:30.377,868] <inf> main: UE is currently trying to attach or searching ...
    [23:50:34.725,128] <inf> main: PDN connection activated
    [23:50:34.826,080] <inf> main: Registered, roaming
    [23:50:34.826,385] <inf> main: LTE_LC_MODEM_EVT_SEARCH_DONE
    [23:50:34.826,538] <inf> main: Connected to LTE network
    [23:50:34.826,568] <inf> main: Time to connect: 5.8 s
    [23:50:34.836,944] <err> modem_info_params: Link data not obtained: 21 -134
    [23:50:34.836,944] <err> main: Error -134, modem_info_params_get
    
    [23:50:34.837,097] <wrn> main: --ST_SEND_DATA--
    [23:50:34.837,127] <inf> main: Create the socket
    [23:50:34.837,738] <inf> main: Connect the socket to the server
    
    [23:50:34.838,043] <inf> main: [SEND DATA - INTERNAL DATA]
    [23:50:34.838,104] <inf> main: Total Size (buffer2send): 247 bytes
    [23:50:34.838,104] <inf> main: Sending data...
    [23:50:34.839,385] <inf> main: Sent 247 bytes
    [23:50:35.936,828] <inf> main: Received 21 bytes
    [23:50:35.936,920] <inf> main: Time to send+recv pck: 1.098 s
    [23:50:35.936,950] <inf> main: Sent all data
    [23:50:36.345,977] <inf> main: MODE_OFFLINE set
    
    
    
    // Without error with LTE
    [22:39:30.886,291] <wrn> main: --ST_CONNECT--
    [22:39:30.906,616] <inf> main: Vbat: 100% (5.2 V)
    [22:39:30.907,501] <inf> main: MODE_OFFLINE set
    [22:39:30.908,630] <inf> main: SYSTEM_MODE_LTEM_GPS set
    [22:39:30.908,630] <inf> main: Connecting to LTE network...
    [22:39:30.949,981] <inf> main: MODE_NORMAL set
    [22:39:32.284,179] <inf> main: UE is currently trying to attach or searching ...
    [22:39:36.019,439] <inf> main: PDN connection activated
    [22:39:36.120,391] <inf> main: Registered, roaming
    [22:39:36.120,666] <inf> main: LTE_LC_MODEM_EVT_SEARCH_DONE
    [22:39:36.120,849] <inf> main: Connected to LTE network
    [22:39:36.120,880] <inf> main: Time to connect: 5.2 s
    [22:39:36.159,729] <inf> main: IP: 10.137.22.228; RSRP: -120dBm; Cell ID: 580621; TAC: 48720; Op: 26806; TimeDate: 26/03/01,09:43:05+00
    [22:39:36.159,759] <inf> main: Band: 20; Supported bands: (8,20)
    
    [22:39:36.160,186] <wrn> main: --ST_SEND_DATA--
    [22:39:36.160,217] <inf> main: Create the socket
    [22:39:36.160,644] <inf> main: Connect the socket to the server
    
    [22:39:36.160,980] <inf> main: [SEND DATA - INTERNAL DATA]
    [22:39:36.161,041] <inf> main: Total Size (buffer2send): 215 bytes
    [22:39:36.161,041] <inf> main: Sending data...
    [22:39:36.162,200] <inf> main: Sent 215 bytes
    [22:39:37.140,319] <inf> main: Received 21 bytes
    [22:39:37.140,411] <inf> main: Time to send+recv pck: 0.979 s
    [22:39:37.140,472] <inf> main: Sent all data
    [22:39:37.491,485] <inf> main: MODE_OFFLINE set


    In this application, data transmission to the server occurs mostly over LTE, but occasionally some data is sent via NTN. From time to time, some NTN errors also occur, and I am not sure whether they might be related to the error in the modem_info_params function. Based on the analysis of my logs, the error in the modem_info_params() function occurs only when using LTE. Below are the errors I am encountering with NTN:

    16:05:14.920 [02:26:36.997,619] <inf> main: %XMONITOR: 2
    16:05:14.922 OK
    16:05:14.926 
    16:05:14.926 [02:26:36.998,321] <inf> main: +CEREG: 5,2,"0FB4","001E9434",14
    16:05:14.931 OK
    16:05:14.931 
    16:05:16.926 [02:26:39.007,904] <inf> main: %SQP: -124,-9,4,-115
    16:05:16.928 OK
    16:05:16.932 
    16:05:16.932 [02:26:39.008,789] <inf> main: %XMONITOR: 2
    16:05:16.934 OK
    16:05:16.935 
    16:05:16.935 [02:26:39.009,490] <inf> main: +CEREG: 5,2,"0FB4","001E9434",14
    16:05:16.941 OK
    16:05:16.942 
    16:05:18.936 [02:26:41.019,073] <inf> main: %SQP: -123,-8,4,-115
    16:05:18.942 OK
    16:05:18.942 
    16:05:18.943 [02:26:41.019,958] <inf> main: %XMONITOR: 2
    16:05:18.947 OK
    16:05:18.947 
    16:05:18.947 [02:26:41.020,660] <inf> main: +CEREG: 5,2,"0FB4","001E9434",14
    16:05:18.955 OK
    16:05:18.955 
    16:05:18.957 [02:26:42.023,773] <err> main: ESM Error - Code: 38
    16:05:18.962 [02:26:42.024,078] <wrn> lte_lc: Registration rejected, EMM cause: 19, Cell ID: 2004020, Tracking area: 4020, LTE mode: 14
    16:05:42.178 [02:27:05.135,040] <inf> main: Timeout - connecting NTN
    16:05:42.184 [02:27:05.135,101] <inf> main: Time to try connect: 120.4 s


    Below is modem_info_get()  and modem_data_get() functions:

    void modem_info_get(void){
        int err = modem_info_params_get(&modem_param);
    	if(err != 0){
    		LOG_ERR("Error %d, modem_info_params_get", err);
    	}
    	else{
    		LOG_INF("IP: %s; RSRP: %ddBm; Cell ID: %d; TAC: %d; Op: %s; TimeDate: %s", modem_param.network.ip_address.value_string, 
    			RSRP_IDX_TO_DBM(modem_param.network.rsrp.value), (uint32_t)modem_param.network.cellid_dec, modem_param.network.area_code.value, 
    			modem_param.network.current_operator.value_string, modem_param.network.date_time.value_string); 
    		LOG_INF("Band: %d; Supported bands: %s", modem_param.network.current_band.value, modem_param.network.sup_band.value_string);
    	}
    }

    static int modem_data_get(struct lte_param *param)
    {
    	enum modem_info_data_type data_type;
    	int ret;
    
    	data_type = modem_info_data_type_get(param->type);
    
    	if (data_type == MODEM_INFO_DATA_TYPE_INVALID) {
    		return -EINVAL;
    	}
    
    	if (data_type == MODEM_INFO_DATA_TYPE_STRING) {
    		ret = modem_info_string_get(param->type,
    				param->value_string,
    				sizeof(param->value_string));
    		if (ret < 0) {
    			LOG_ERR("Link data not obtained: %d %d", param->type, ret);
    			return ret;
    		}
    	} else if (data_type == MODEM_INFO_DATA_TYPE_NUM_INT) {
    		ret = modem_info_short_get(param->type, &param->value);
    		if (ret < 0) {
    			LOG_ERR("Link data not obtained: %d", ret);
    			return ret;
    		}
    	}
    
    	return 0;
    }


    Could you please help me understand what might be causing this issue?

    Best regards,
    GoncaloS

  • Hi  ,

    Do you have any updates about this issue? Attached to this comment, I will attach a file with the modem configuration that is done when the program starts.

    /* Configurations for modem */
    int modem_configurations(void){
    	char reply_buffer[64];
    	char imei[25]; 
    
    	// Modem configure 
    	int err = modem_init();
    	if (err) {
    		LOG_ERR("Failed to configure the modem");
    		return err;
    	}
    
    	// Enable modem events
    	err = lte_lc_modem_events_enable();
    	if(err != 0){
    		LOG_ERR("lte_lc_modem_events_enable, err: %d", err);
    	}
    
    	// Register LTE event handler 
    	lte_lc_register_handler(lte_lc_evt_handler);
    
    	// Modem Info init 
    	err = modem_info_init();
    	if(err != 0){
    		LOG_ERR("Failed to initialize the modem information module");
    	}
    	err = modem_info_params_init(&modem_param);
    	if(err != 0){
    		LOG_ERR("Failed to initialize the struture that stores information");
    	}
    
    
    	ntn_profile = (struct lte_lc_cellular_profile){
    		.id = 0,
    		.act = LTE_LC_ACT_NTN,
    		.uicc = LTE_LC_UICC_PHYSICAL,
    	};
    
    	tn_profile = (struct lte_lc_cellular_profile){
    		.id = 1,
    		.act = LTE_LC_ACT_LTEM,
    		.uicc = LTE_LC_UICC_PHYSICAL,
    	};
    
    
    	set_modem_func_mode(LTE_LC_FUNC_MODE_POWER_OFF);
    	set_modem_system_mode(LTE_LC_SYSTEM_MODE_NTN_NBIOT, LTE_LC_SYSTEM_MODE_PREFER_AUTO);
    	
    
    	// Set locked bands
    	err = nrf_modem_at_printf("AT%%XBANDLOCK=2,,\"23,255,256,20,8\"");
    	if (err) {
    		LOG_ERR("Failed to set NTN band lock, error: %d", err);
    		return err;
    	}
    
    	// Set NTN profile (index = 0) 
    	err = lte_lc_cellular_profile_configure(&ntn_profile);
    	if (err) {
    		LOG_ERR("Failed to set NTN profile, error: %d", err);
    		return err;
    	}
    
    	// Set TN profile (index = 1) 
    	err = lte_lc_cellular_profile_configure(&tn_profile);
    	if (err) {
    		LOG_ERR("Failed to set TN profile, error: %d", err);
    		return err;
    	}
    
    	// Register handler for default PDP context 0
    	err = lte_lc_pdn_default_ctx_events_enable();
    	if (err) {
    		LOG_ERR("lte_lc_pdn_default_ctx_events_enable, error: %d", err);
    		return err;
    	}
    
    	return 0;
    }
    
    
    int pdn_configuration(void)
    {
    	int err;
    
    	// (CID = (cid 0...9) + 10 * profile_index)
    	uint8_t cid_tn = 10, cid_ntn = 0;  
    	
    	err = lte_lc_pdn_ctx_configure(cid_tn, apn, LTE_LC_PDN_FAM_IPV4, NULL);
    	if (err) {
    		LOG_ERR("Error to configure CID_TN: %d", err);
    		return err;
    	}
    
    	err = lte_lc_pdn_ctx_configure(cid_ntn, apn, LTE_LC_PDN_FAM_IPV4, NULL);
    	if (err) {
    		LOG_ERR("Error to configure CID_NTN: %d", err);
    		return err;
    	}
    
    	return err;
    }

    After that, I use the following:

    // For enable/change for LTE
    lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE);
    lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_LTEM_GPS, LTE_LC_SYSTEM_MODE_PREFER_AUTO);
    lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL);
    
    // For enable/change for NTN
    lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE);
    lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_NTN_NBIOT, LTE_LC_SYSTEM_MODE_PREFER_AUTO);
    ntn_location_set(latitude, longitude, altitude, 0);
    lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL);
    


    The ESM error 38 occurs randomly, sometimes with a signal considered good enough to connect to the network, and then the error occurs. 

    Other times, I am also unable the modem parameters, and the error "modem_info_params: Link data not obtained: 21 -134" occurs (this occurs a few hours after program the board). This error is also random, with no pattern causing it to occur.

    In both errors, it seems to me that the error may be related to the configuration of the PDP contexts, in which these errors may occur some time after the application starts running.

    Can you confirm that my configs are correct? Have you encountered any errors of this kind on your end? What can I do to try to resolve these errors?

    Thanks for help.


    Regards,
    GoncaloS

  • Hi GoncaloS,

     

    My apologies for the late reply.

    The error:

    modem_info_params: Link data not obtained: 21 -134

    is emitted when the context is not up.

     

    The second log shows ESM/EMM cause codes:

    16:05:18.957 [02:26:42.023,773] <err> main: ESM Error - Code: 38
    16:05:18.962 [02:26:42.024,078] <wrn> lte_lc: Registration rejected, EMM cause: 19, Cell ID: 2004020, Tracking area: 4020, LTE mode: 14

     

    Have you followed the getting started, as Øyvind pointed towards?

     

    Kind regards,

    Håkon

Reply
  • Hi GoncaloS,

     

    My apologies for the late reply.

    The error:

    modem_info_params: Link data not obtained: 21 -134

    is emitted when the context is not up.

     

    The second log shows ESM/EMM cause codes:

    16:05:18.957 [02:26:42.023,773] <err> main: ESM Error - Code: 38
    16:05:18.962 [02:26:42.024,078] <wrn> lte_lc: Registration rejected, EMM cause: 19, Cell ID: 2004020, Tracking area: 4020, LTE mode: 14

     

    Have you followed the getting started, as Øyvind pointed towards?

     

    Kind regards,

    Håkon

Children
  • Hello  ,

    Yes, I tried to follow the guide available NTN guide and only used the available functions for the NTN configuration instead AT commands. The configurations I did at the start of the code are included in my last reply. After that, I only connected to LTE and NTN using the commands i Had already sent. Both errors occur randomly, but most of the time it works without problems. Could these errors be caused by a bug in the PDN configuration for more than one profile ?


    Regards,
    GoncaloS

  • Hi GoncaloS,

     

    Which SIM card / telecom vendor are you using for connection towards GEO/LEO?

    As mentioned, it seems that the NTN network you're connecting to, or have coverage for in your area, is rejecting your attach.

     

    Kind regards,

    Håkon

  • Hi  ,

    I am using a Monogoto SIM Card. On the Monogoto management page, I can see the following:

    // Failed Connection
    28-Feb-2026 16:43:00 | Event=HSS_ULR | Operator=Skylo NTN Technologies | MME=core02.prod-eu.epc.mnc098.mcc901.3gppnetwork.org
    28-Feb-2026 16:43:00 | Event=HSS_ULA | Result=SUCCESS | Operator=Skylo NTN Technologies 
    
    // Successful connection
    28-Feb-2026 13:47:11 | Event=HSS_ULR | Operator=Skylo NTN Technologies | MME=core02.prod-eu.epc.mnc098.mcc901.3gppnetwork.org
    28-Feb-2026 13:47:11 | Event=HSS_ULA | Result=SUCCESS | Operator=Skylo NTN Technologies 
    28-Feb-2026 13:47:16 | Event=GGSN_AUTHENTICATE_PDP_CONTENT | Operator=Skylo NTN Technologies | Action=authenticate_pdp_context v2 | SGSN=10.99.5.199 | RAI=null | AllowedBytes=20971520
    28-Feb-2026 13:47:16 | Event=GGSN_AUTHENTICATE_PDP_CONTENT_RESULT | Result=SUCCESS | Operator=Skylo NTN Technologies | SessionID=1223969419 | AllowedBytes=20971520 | IP=10.137.22.230
    28-Feb-2026 13:48:12 | Event=DATA | Operator=Skylo NTN Technologies | SessionID=2.40076E+14 | Usage=412 bytes
    28-Feb-2026 13:48:12 | Event=GGSN_DELETE_PDP_CONTENT | Operator=Skylo NTN Technologies | Action=delete_pdp_context | SessionID=1223969419 | Upload=314 | Download=98 | Total=412 | IP=10.137.22.230 | InitialTime=28/02/2026 13:47 | Cause=User Request


    I talked with them, and they said that on their side, there is no limitations on the NTN network. 

    Regards,
    GoncaloS

  • Hi GoncaloS,

     

    I checked with R&D, and confirmed that the ESM/EMM cause codes that you are seeing is very similar in NTN as they are in "normal" LTE-M or NB-IoT mode.

    The cause code of 38 indicates:

    Cause #38 – Network failure
    
          This ESM cause is used by the network to indicate that the requested service was rejected due to an error situation in the network.

     

    The UE in this case is only the messenger, and cannot actively tell anything else than to relay the ESM/EMM cause code it receives from the network. If this is a situation that occurs often, please let the network provider know about this.

     

    Kind regards,

    Håkon

  • Hi  ,

    So, what can we do when these errors appear? What about the error "modem_info_params: Link data not obtained: 21 -134" ?


    Regards,
    GoncaloS

Related