<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126266/ntn-support-and-application-feasibility-on-nrf9151</link><description>Inquiry: NTN Support and Application Feasibility on nRF9151 
 I would like to seek clarification regarding Non-Terrestrial Network (NTN) support on the nRF9151 . 
 There have been discussions and references suggesting NTN capability on the nRF9151, and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Feb 2026 08:20:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126266/ntn-support-and-application-feasibility-on-nrf9151" /><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561429?ContentTypeID=1</link><pubDate>Wed, 18 Feb 2026 08:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b0c13d9-8906-4ad7-91ec-e17b2e953599</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;&lt;span&gt;Yes, but I am referring to a modem trace. We&amp;#39;ll need it to see the full picture. You can find instructions for enabling it in the&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-7-cellular-fundamentals/topic/lesson-7-modem-trace/"&gt;DevAcademy&lt;/a&gt;.&amp;nbsp;Please upload the file here so we can inspect it.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561345?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 11:41:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bb2dc3b-8dd5-4f3a-8095-250022c38c93</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;Yes that&amp;#39;s why i was thinking that it may be not ntn but the cellular. I have already added the code above.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561343?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 11:10:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a28e11d-1075-4c7f-803c-eb7837f6e21d</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi Priyesh,&lt;br /&gt;That sounds strange indeed.&amp;nbsp;If the modem&amp;nbsp;is moved more than 400m during or in between connections you need to update the location. This can be done&amp;nbsp;externally by using the %LOCAITON command or internally using a procedure involving the GPS. What exact firmware are you using?&lt;br /&gt;&lt;br /&gt;Could you share a modem trace? That will help us see what exactly is going on.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561309?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 04:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95b3a6a0-0b05-46d5-ab97-219818f33328</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p class="isSelectedEnd"&gt;&lt;span&gt;Hi Benjamin,&lt;/span&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;span&gt;Thank you for the clarification regarding AT+COPS?.&lt;/span&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;span&gt;In my testing, I set the location of the room where the board was initially operating, and NTN connectivity worked there as expected. However, I then moved approximately 30 km away from that location, and the device continued to connect successfully using the same previously configured location.&lt;/span&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;span&gt;This is where my confusion arises &amp;mdash; how is the device able to connect to NTN with an incorrect location configured? Does the modem internally determine or refine its location even if the %LOCATION value is not accurate? Or is the configured location only used as an initial hint for acquisition?&lt;/span&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;Best regards,&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;span&gt;Priyesh&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561238?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 13:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb6cffd7-ff13-4c48-909e-96e805ace1cb</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;You could use &lt;a href="https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1_ntn/page/REF/at_commands/nw_service/cops_read.html"&gt;AT+COPS?&lt;/a&gt;&lt;span&gt;&amp;nbsp;to check what type of network you are connected to. The value for NTN NB-IoT is 14.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I guess you are referring to the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1_ntn/page/REF/at_commands/ntn/location_set.html"&gt;%LOCATION set command&lt;/a&gt;? What specific questions do you have?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Benjamin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561199?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 08:46:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b88c252-5d83-4d4c-8a66-ed3ebc772b76</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p data-start="0" data-end="14"&gt;Hi Benjamin,&lt;/p&gt;
&lt;p data-start="16" data-end="357"&gt;The &lt;code data-start="20" data-end="27"&gt;#PING&lt;/code&gt; function was not working initially. However, I made a few changes to the code. Up to the connection stage, I used AT commands, and for the remaining operations I utilized functions from the socket library and CoAP library. After these modifications, it worked successfully, and I am now able to send payloads to my CoAP server.&lt;/p&gt;
&lt;p data-start="16" data-end="357"&gt;&lt;/p&gt;
&lt;p data-start="16" data-end="357"&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include &amp;lt;string.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;nrf_modem_at.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;modem/at_monitor.h&amp;gt;
#include &amp;lt;modem/modem_info.h&amp;gt;

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;ncs_version.h&amp;gt;

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/net/socket.h&amp;gt;

#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;modem/lte_lc.h&amp;gt;

#include &amp;lt;zephyr/random/random.h&amp;gt;
#include &amp;lt;zephyr/net/coap.h&amp;gt;

#include &amp;lt;modem/ntn.h&amp;gt;

#define SEND_REQ_THREAD_STACK_SIZE 1024
#define SEND_REQ_THREA_PRIORITY 5

/* Define the macros for the CoAP version and message length */
#define APP_COAP_VERSION 1
#define APP_COAP_MAX_MSG_LEN 1280

K_SEM_DEFINE(con_sem, 0, 1);

/* Declare the buffer coap_buf to receive the response. */
static uint8_t coap_buf[APP_COAP_MAX_MSG_LEN];

/* Define the CoAP message token next_token */
static uint16_t next_token;

static int sock;
static struct sockaddr_storage server;

K_SEM_DEFINE(cereg_sem, 0, 1);

uint8_t response[128] = {0};

LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);

AT_MONITOR(cmd_rsp, ANY, cmd_mon, ACTIVE);

/* AT monitor for network notifications */
AT_MONITOR(network, &amp;quot;CEREG&amp;quot;, cereg_mon);

static int cereg_status;
enum cereg_status {
	NO_NETWORK = 0,
	HOME = 1,
	SEARCHING = 2,
	DENIED = 3,
	UNKNOWN = 4,
	ROAMING = 5,
	UICC_FAILURE = 90
};

static const char *cereg_str_get(enum cereg_status status)
{
	switch (status) {
	case NO_NETWORK:
		return &amp;quot;no network&amp;quot;;
	case HOME:
		return &amp;quot;home&amp;quot;;
	case SEARCHING:
		return &amp;quot;searching&amp;quot;;
	case DENIED:
		return &amp;quot;denied&amp;quot;;
	case UNKNOWN:
		return &amp;quot;unknown&amp;quot;;
	case ROAMING:
		return &amp;quot;roaming&amp;quot;;
	case UICC_FAILURE:
		return &amp;quot;UICC failure&amp;quot;;
	default:
		return NULL;
	}
}

static void cereg_mon(const char *notif)
{
	const char *cereg_status_str;

	cereg_status = atoi(notif + strlen(&amp;quot;+CEREG: &amp;quot;));
	cereg_status_str = cereg_str_get(cereg_status);

	if (!cereg_status_str) {
		LOG_ERR(&amp;quot;Network registration status unknown: %d&amp;quot;, cereg_status);
		return;
	}

	LOG_INF(&amp;quot;Network registration status: %s&amp;quot;, cereg_status_str);

	if ((cereg_status == HOME) || (cereg_status == ROAMING)) {
		k_sem_give(&amp;amp;cereg_sem);
	}
}

static void cmd_mon(const char *notif)
{
	LOG_INF(&amp;quot;%s&amp;quot;, notif);
}

/**@brief Resolves the configured hostname. */
static int server_resolve(void)
{
	int err;
	struct addrinfo *result;
	struct addrinfo hints = {
		.ai_family = AF_INET,
		.ai_socktype = SOCK_DGRAM};
	char ipv4_addr[NET_IPV4_ADDR_LEN];

	err = getaddrinfo(CONFIG_COAP_SERVER_HOSTNAME, NULL, &amp;amp;hints, &amp;amp;result);
	if (err != 0)
	{
		LOG_ERR(&amp;quot;ERROR: getaddrinfo failed %d&amp;quot;, err);
		return -EIO;
	}

	if (result == NULL)
	{
		LOG_ERR(&amp;quot;ERROR: Address not found&amp;quot;);
		return -ENOENT;
	}

	/* IPv4 Address. */
	struct sockaddr_in *server4 = ((struct sockaddr_in *)&amp;amp;server);

	server4-&amp;gt;sin_addr.s_addr =
		((struct sockaddr_in *)result-&amp;gt;ai_addr)-&amp;gt;sin_addr.s_addr;
	server4-&amp;gt;sin_family = AF_INET;
	server4-&amp;gt;sin_port = htons(CONFIG_COAP_SERVER_PORT);

	inet_ntop(AF_INET, &amp;amp;server4-&amp;gt;sin_addr.s_addr, ipv4_addr,
			  sizeof(ipv4_addr));
	LOG_INF(&amp;quot;IPv4 Address found %s&amp;quot;, ipv4_addr);

	/* Free the address. */
	freeaddrinfo(result);

	return 0;
}

/**@brief Initialize the CoAP client */
static int client_init(void)
{
	int err;

	sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
	if (sock &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to create CoAP socket: %d.&amp;quot;, errno);
		return -errno;
	}

	err = connect(sock, (struct sockaddr *)&amp;amp;server,
				  sizeof(struct sockaddr_in));
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Connect failed : %d&amp;quot;, errno);
		return -errno;
	}

	LOG_INF(&amp;quot;Successfully connected to server&amp;quot;);

	/* Generate a random token after the socket is connected */
	next_token = sys_rand32_get();

	k_sem_give(&amp;amp;con_sem);

	return 0;
}

/**@brief Send CoAP POST request. */
static int client_post_send(void)
{
	int err;
	struct coap_packet request;

	next_token = sys_rand32_get();

	/* Initialize the CoAP packet and append the resource path */
	err = coap_packet_init(&amp;amp;request, coap_buf, sizeof(coap_buf),
						   APP_COAP_VERSION, COAP_TYPE_CON,
						   sizeof(next_token), (uint8_t *)&amp;amp;next_token,
						   COAP_METHOD_POST, coap_next_id());
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to create CoAP request, %d&amp;quot;, err);
		return err;
	}

	err = coap_packet_append_option(&amp;amp;request, COAP_OPTION_URI_HOST,
									(uint8_t *)CONFIG_COAP_SERVER_HOSTNAME,
									strlen(CONFIG_COAP_SERVER_HOSTNAME));
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to encode CoAP option, %d&amp;quot;, err);
		return err;
	}

	err = coap_packet_append_option(&amp;amp;request, COAP_OPTION_URI_PATH,
									(uint8_t *)CONFIG_COAP_TX_RESOURCE,
									strlen(CONFIG_COAP_TX_RESOURCE));
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to encode CoAP option, %d&amp;quot;, err);
		return err;
	}

	/* Add payload marker */
	err = coap_packet_append_payload_marker(&amp;amp;request);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to append payload marker, %d&amp;quot;, err);
		return err;
	}

	/* Format and append as payload */
	char payload[64];

	int len = snprintf(payload, sizeof(payload), &amp;quot;1234567890123456789012345678901&amp;quot;);
	if (len &amp;lt; 0 || len &amp;gt;= sizeof(payload))
	{
		LOG_ERR(&amp;quot;Failed to format counter payload&amp;quot;);
		return -EINVAL;
	}

	err = coap_packet_append_payload(&amp;amp;request, (uint8_t *)payload, len);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to append payload, %d&amp;quot;, err);
		return err;
	}

	err = send(sock, request.data, request.offset, 0);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to send CoAP request, %d&amp;quot;, errno);
		return -errno;
	}

	LOG_INF(&amp;quot;CoAP POST request sent: Token 0x%04x&amp;quot;, next_token);

	return 0;
}

/**@brief Handles responses from the remote CoAP server. */
static int client_handle_response(uint8_t *buf, int received)
{
	struct coap_packet reply;
	uint8_t token[8];
	uint16_t token_len;
	const uint8_t *payload;
	uint16_t payload_len;
	uint8_t temp_buf[128];
	/* Parse the received CoAP packet */
	int err = coap_packet_parse(&amp;amp;reply, buf, received, NULL, 0);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Malformed response received: %d&amp;quot;, err);
		return err;
	}

	/* Confirm the token in the response matches the token sent */
	token_len = coap_header_get_token(&amp;amp;reply, token);
	if ((token_len != sizeof(next_token)) ||
		(memcmp(&amp;amp;next_token, token, sizeof(next_token)) != 0))
	{
		LOG_ERR(&amp;quot;Invalid token received: 0x%02x%02x&amp;quot;,
				token[1], token[0]);
		return 0;
	}

	/* Retrieve the payload and confirm it&amp;#39;s nonzero */
	payload = coap_packet_get_payload(&amp;amp;reply, &amp;amp;payload_len);

	if (payload_len &amp;gt; 0)
	{
		snprintf(temp_buf, MIN(payload_len + 1, sizeof(temp_buf)), &amp;quot;%s&amp;quot;, payload);
	}
	else
	{
		strcpy(temp_buf, &amp;quot;EMPTY&amp;quot;);
	}

	/* Log the header code, token and payload of the response */
	LOG_INF(&amp;quot;CoAP response: Code 0x%x, Token 0x%02x%02x, Payload: %s&amp;quot;,
			coap_header_get_code(&amp;amp;reply), token[1], token[0], (char *)temp_buf);

	return 0;
}

int main(void)
{
	int err;

	int received;

	/* Register NTN handler (safe even if you start in TN mode) */
	// ntn_register_handler(app_ntn_event_handler);

	LOG_INF(&amp;quot;AT Monitor sample started&amp;quot;);

	err = nrf_modem_lib_init();
	if (err)
	{
		LOG_ERR(&amp;quot;Modem library initialization failed, error: %d&amp;quot;, err);
		return 0;
	}

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CFUN=0&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read AT+CFUN=0, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XFACTORYRESET=0&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read xfactoryreset, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XSYSTEMMODE=0,0,0,0,1&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read XSYSTEMMODE, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XBANDLOCK=2,,\&amp;quot;255,256\&amp;quot;&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read XBANDLOCK, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%LOCATION=2,\&amp;quot;36.33144938\&amp;quot;,\&amp;quot;-119.292130\&amp;quot;,\&amp;quot;0\&amp;quot;,0,0&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read LOCATION, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CGDCONT=0,\&amp;quot;IP\&amp;quot;,\&amp;quot;data.mono\&amp;quot;&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read CGDCONT, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%MDMEV=2&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read MDMEV, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CSCON=3&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read CSCON, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CNEC=24&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read CEREG, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CEREG=5&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read CEREG, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CFUN=1&amp;quot;);
	if (err)
	{
		LOG_ERR(&amp;quot;Failed to read CEREG, err %d&amp;quot;, err);
		return 0;
	}

	LOG_INF(&amp;quot;%s&amp;quot;, response);

	LOG_INF(&amp;quot;Waiting for network&amp;quot;);
	err = k_sem_take(&amp;amp;cereg_sem, K_SECONDS(200));

	if ((cereg_status == HOME) || (cereg_status == ROAMING)) {
		LOG_INF(&amp;quot;Network connection ready&amp;quot;);
	} else {
		if (err == -EAGAIN) {
			LOG_ERR(&amp;quot;Network connection timed out&amp;quot;);
		}
		LOG_WRN(&amp;quot;Continuing without network&amp;quot;);
	}

	k_msleep(1000);

	if (server_resolve() != 0)
	{
		LOG_ERR(&amp;quot;Failed to resolve server name&amp;quot;);
		return 0;
	}

	if (client_init() != 0)
	{
		LOG_ERR(&amp;quot;Failed to initialize client&amp;quot;);
		return 0;
	}

	while (1)
	{
		/* Receive response from the CoAP server */
		received = recv(sock, coap_buf, sizeof(coap_buf), 0);

		if (received &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;Socket error: %d, exit&amp;quot;, errno);
			break;
		}
		else if (received == 0)
		{
			LOG_INF(&amp;quot;Empty datagram&amp;quot;);
			continue;
		}

		/* Parse the received CoAP packet */
		err = client_handle_response(coap_buf, received);
		if (err &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;Invalid response, exit&amp;quot;);
			break;
		}
	}

	(void)close(sock);

	return 0;
}

void send_req_thread(void *arg1, void *arg2, void *arg3)
{
	k_sem_take(&amp;amp;con_sem, K_FOREVER);
	while (1)
	{
		client_post_send();
		k_sleep(K_SECONDS(30));
	}
}

K_THREAD_DEFINE(send_req, SEND_REQ_THREAD_STACK_SIZE, send_req_thread, NULL, NULL, NULL,
				SEND_REQ_THREA_PRIORITY, 0, 0);&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="359" data-end="652"&gt;How would&amp;nbsp;I confirm whether the network used to send the payload was exclusively NTN. I tested this in two different locations: first while inside a room, where it still connected successfully, and then approximately 30 km away, where it continued to connect without any issues.&lt;/p&gt;
&lt;p data-start="654" data-end="848"&gt;Could you please advise how I can confirm that the connection was established specifically over NTN? Additionally, could you explain how the set location functionality works in this context?&lt;/p&gt;
&lt;p data-start="850" data-end="877" data-is-last-node="" data-is-only-node=""&gt;Kind regards,&lt;br data-start="863" data-end="866" /&gt;Priyesh shahi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/561091?ContentTypeID=1</link><pubDate>Fri, 13 Feb 2026 10:25:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f763d903-326c-4b88-ac6c-92476467fb5b</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi Priyesh,&lt;/p&gt;
&lt;p&gt;The AT#XPING&amp;nbsp;(and other &lt;a href="https://docs.nordicsemi.com/bundle/addon-serial_modem-latest/page/app/at_commands.html"&gt;# style commands&lt;/a&gt;) are native to the Serial Modem application. They will not work on regular samples.&lt;br /&gt;&lt;br /&gt;For the failing sample, what exact CoAP sample are you referring to?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560733?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2026 05:29:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd5113a6-98f0-4823-9e1d-3008d316e2bb</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;I also tried with at monitor sample, where i modified commands.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include &amp;lt;string.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;nrf_modem_at.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;modem/at_monitor.h&amp;gt;
#include &amp;lt;modem/modem_info.h&amp;gt;

AT_MONITOR(cmd_rsp, ANY, cmd_mon, ACTIVE);

uint8_t response[128] = {0};

static void cmd_mon(const char *notif)
{

	printk(&amp;quot;%s\n&amp;quot;, notif);
}

int main(void)
{
	int err;

	printk(&amp;quot;AT Monitor sample started\n&amp;quot;);

	err = nrf_modem_lib_init();
	if (err)
	{
		printk(&amp;quot;Modem library initialization failed, error: %d\n&amp;quot;, err);
		return 0;
	}

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CFUN=0&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read AT+CFUN=0, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XFACTORYRESET=0&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read xfactoryreset, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XSYSTEMMODE=0,0,0,0,1&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read XSYSTEMMODE, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XBANDLOCK=2,,\&amp;quot;255,256\&amp;quot;&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read XBANDLOCK, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%LOCATION=2,\&amp;quot;36.33144938\&amp;quot;,\&amp;quot;-119.292130\&amp;quot;,\&amp;quot;0\&amp;quot;,0,0&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read LOCATION, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CGDCONT=0,\&amp;quot;IP\&amp;quot;,\&amp;quot;data.mono\&amp;quot;&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read CGDCONT, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%MDMEV=2&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read MDMEV, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);
	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CSCON=3&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read CSCON, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CNEC=24&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read CEREG, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CEREG=5&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read CEREG, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(1000);

	err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CFUN=1&amp;quot;);
	if (err)
	{
		printk(&amp;quot;Failed to read CEREG, err %d\n&amp;quot;, err);
		return 0;
	}

	printk(&amp;quot;%s\n&amp;quot;, response);
	k_msleep(200000);

	// err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT#XPING=\&amp;quot;8.8.8.8\&amp;quot;,32,30000,4,1000&amp;quot;);
	// if (err)
	// {
	// 	printk(&amp;quot;Failed to read XPING, err %d\n&amp;quot;, err);
	// }

	// printk(&amp;quot;%s\n&amp;quot;, response);

	while (true)
	{
		/* code */
		k_msleep(10000);
		err = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT%%XMONITOR&amp;quot;);
		if (err)
		{
			printk(&amp;quot;Failed to read CEREG, err %d\n&amp;quot;, err);
			return 0;
		}

		printk(&amp;quot;%s\n&amp;quot;, response);
	}
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560732?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2026 05:23:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6cd03aa-5c91-47a3-a230-15ee81ee7746</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ntn_5F00_log.txt"&gt;devzone.nordicsemi.com/.../ntn_5F00_log.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/serial_2D00_terminal_2D00_09022026_5F00_211807.txt"&gt;devzone.nordicsemi.com/.../serial_2D00_terminal_2D00_09022026_5F00_211807.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;earlier i was able to ping with these commands, but now even that is failing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560654?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2026 13:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d927da1a-48b3-4c9d-9e6c-9e952bdfd1e3</guid><dc:creator>Achim Kraus</dc:creator><description>[quote userid="129185" url="~/f/nordic-q-a/126266/ntn-support-and-application-feasibility-on-nrf9151/560633"]is there anything that I should change so that it connects to network.[/quote]
&lt;p&gt;I&amp;#39;m not sure, but I don&amp;#39;t see, that you select band 256 and 255, do you?&lt;/p&gt;
&lt;p&gt;AT%XBANDLOCK=2,,\&amp;quot;255,256\&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560633?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2026 11:06:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a298754-16c6-46af-9932-5bc9bfd5b934</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p&gt;&amp;nbsp;I will address CoAP timing later. In this case, the issue appears earlier, as the device does not seem to reach a connected state in NTN mode. The modem keeps requesting location updates, but the application does not progress beyond this, unlike in LTE mode where the same sample works. Therefore, this seems related to NTN attachment or modem state rather than CoAP behavior.&lt;br /&gt;&lt;br /&gt;is there anything that I should change so that it connects to network.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560628?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2026 10:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b01de16-d811-4bea-a086-a86884165ca4</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;CoAP in general assumes a default timeout, which is based on constrained networks.&lt;/p&gt;
&lt;p&gt;But NTN is even &amp;quot;more constraint&amp;quot;. In my experience, at least the first message exchange (request/response) takes up to 30s (sometimes even 50s) after the device is RRC active and registered in the network. Follow-up message may be faster (10-15s) but there will be also cases, where more time is needed. I use in the meantime 50s ACK timeout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/560622?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2026 10:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2a33eb6-5309-4239-8256-4f15ccdbbf4c</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p data-start="280" data-end="675"&gt;I am working with an&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="301" data-end="319"&gt;nRF9151 SMA DK&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="326" data-end="352"&gt;nRF Connect SDK v3.2.1&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and testing&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="365" data-end="385"&gt;NTN connectivity&lt;/strong&gt;. When using the precompiled&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="414" data-end="426"&gt;Eval HEX&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and issuing AT commands, the device is able to register on the NTN network, successfully ping external hosts, and establish UDP communication with a server. This indicates that basic NTN registration and IP connectivity are functioning as expected.&lt;/p&gt;
&lt;p data-start="677" data-end="1070"&gt;However, while using AT commands, I was not able to construct a valid CoAP payload in hexadecimal format suitable for transmission over NTN. To address this, I switched to the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="853" data-end="911"&gt;CoAP client sample from the Nordic DevAcademy exercise&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and modified it to enable NTN, configure the required NTN settings, and provide device location using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code data-start="1014" data-end="1034"&gt;ntn_location_set()&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;together with an NTN event handler.&lt;/p&gt;
&lt;p data-start="1072" data-end="1518"&gt;The modified CoAP application builds and flashes successfully, and there are no compile-time or obvious runtime errors. When running this application in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="1225" data-end="1237"&gt;LTE mode&lt;/strong&gt;, the CoAP sample behaves as expected and is able to connect to the server and exchange data. When switching the same application to&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="1370" data-end="1382"&gt;NTN mode&lt;/strong&gt;, however, the device does not establish the connection.&lt;/p&gt;
&lt;p data-start="1520" data-end="1994"&gt;Given that raw UDP communication over NTN works via AT commands and the same CoAP sample works correctly over LTE, I would like to understand whether there are additional requirements or limitations when using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong data-start="1730" data-end="1747"&gt;CoAP over NTN&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;on the nRF9151. Specifically, are there any required socket, CoAP, or modem configurations that differ between LTE and NTN, or any known constraints that would prevent the DevAcademy CoAP sample from working over NTN without further modification?&lt;/p&gt;
&lt;p data-start="1520" data-end="1994"&gt;&lt;/p&gt;
&lt;p data-start="1520" data-end="1994"&gt;is there anything that I should add in this code? I am using modem firmware from sma dk eval web page.&lt;/p&gt;
&lt;p data-start="1520" data-end="1994"&gt;code&amp;nbsp;&lt;/p&gt;
&lt;p data-start="1520" data-end="1994"&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2019 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;ncs_version.h&amp;gt;

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/net/socket.h&amp;gt;

#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;modem/lte_lc.h&amp;gt;

#include &amp;lt;zephyr/random/random.h&amp;gt;
#include &amp;lt;zephyr/net/coap.h&amp;gt;

#include &amp;lt;modem/ntn.h&amp;gt;

#define SEND_REQ_THREAD_STACK_SIZE 1024
#define SEND_REQ_THREA_PRIORITY 5

/* Define the macros for the CoAP version and message length */
#define APP_COAP_VERSION 1
#define APP_COAP_MAX_MSG_LEN 1280

K_SEM_DEFINE(con_sem, 0, 1);

/* Declare the buffer coap_buf to receive the response. */
static uint8_t coap_buf[APP_COAP_MAX_MSG_LEN];

/* Define the CoAP message token next_token */
static uint16_t next_token;

static int sock;
static struct sockaddr_storage server;

static uint8_t test_counter = 0;

K_SEM_DEFINE(lte_connected, 0, 1);

LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);

/**@brief Resolves the configured hostname. */
static int server_resolve(void)
{
        int err;
        struct addrinfo *result;
        struct addrinfo hints = {
            .ai_family = AF_INET,
            .ai_socktype = SOCK_DGRAM};
        char ipv4_addr[NET_IPV4_ADDR_LEN];

        err = getaddrinfo(CONFIG_COAP_SERVER_HOSTNAME, NULL, &amp;amp;hints, &amp;amp;result);
        if (err != 0)
        {
                LOG_ERR(&amp;quot;ERROR: getaddrinfo failed %d\n&amp;quot;, err);
                return -EIO;
        }

        if (result == NULL)
        {
                LOG_ERR(&amp;quot;ERROR: Address not found\n&amp;quot;);
                return -ENOENT;
        }

        /* IPv4 Address. */
        struct sockaddr_in *server4 = ((struct sockaddr_in *)&amp;amp;server);

        server4-&amp;gt;sin_addr.s_addr =
            ((struct sockaddr_in *)result-&amp;gt;ai_addr)-&amp;gt;sin_addr.s_addr;
        server4-&amp;gt;sin_family = AF_INET;
        server4-&amp;gt;sin_port = htons(CONFIG_COAP_SERVER_PORT);

        inet_ntop(AF_INET, &amp;amp;server4-&amp;gt;sin_addr.s_addr, ipv4_addr,
                  sizeof(ipv4_addr));
        LOG_INF(&amp;quot;IPv4 Address found %s\n&amp;quot;, ipv4_addr);

        /* Free the address. */
        freeaddrinfo(result);

        return 0;
}

/**@brief Initialize the CoAP client */
static int client_init(void)
{
        int err;

        sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
        if (sock &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to create CoAP socket: %d.\n&amp;quot;, errno);
                return -errno;
        }

        err = connect(sock, (struct sockaddr *)&amp;amp;server,
                      sizeof(struct sockaddr_in));
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Connect failed : %d\n&amp;quot;, errno);
                return -errno;
        }

        LOG_INF(&amp;quot;Successfully connected to server&amp;quot;);

        /* Generate a random token after the socket is connected */
        next_token = sys_rand32_get();

        k_sem_give(&amp;amp;con_sem);

        return 0;
}

static void lte_handler(const struct lte_lc_evt *const evt)
{
        switch (evt-&amp;gt;type)
        {
        case LTE_LC_EVT_NW_REG_STATUS:
                if ((evt-&amp;gt;nw_reg_status != LTE_LC_NW_REG_REGISTERED_HOME) &amp;amp;&amp;amp;
                    (evt-&amp;gt;nw_reg_status != LTE_LC_NW_REG_REGISTERED_ROAMING))
                {
                        break;
                }
                LOG_INF(&amp;quot;Network registration status: %s&amp;quot;,
                        evt-&amp;gt;nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME ? &amp;quot;Connected - home network&amp;quot; : &amp;quot;Connected - roaming&amp;quot;);
                k_sem_give(&amp;amp;lte_connected);
                break;
        case LTE_LC_EVT_RRC_UPDATE:
                LOG_INF(&amp;quot;RRC mode: %s&amp;quot;, evt-&amp;gt;rrc_mode == LTE_LC_RRC_MODE_CONNECTED ? &amp;quot;Connected&amp;quot; : &amp;quot;Idle&amp;quot;);
                break;
        default:
                break;
        }
}

static int modem_configure(void)
{
        int err;

        LOG_INF(&amp;quot;Initializing modem library&amp;quot;);
        err = nrf_modem_lib_init();
        if (err)
        {
                LOG_ERR(&amp;quot;Failed to initialize the modem library, error: %d&amp;quot;, err);
                return err;
        }
        lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_NTN_NBIOT, LTE_LC_SYSTEM_MODE_PREFER_AUTO);

        LOG_INF(&amp;quot;Connecting to LTE network&amp;quot;);
        err = lte_lc_connect_async(lte_handler);
        if (err)
        {
                LOG_ERR(&amp;quot;Error in lte_lc_connect_async, error: %d&amp;quot;, err);
                return err;
        }

        k_sem_take(&amp;amp;lte_connected, K_FOREVER);
        LOG_INF(&amp;quot;Connected to LTE network&amp;quot;);

        return 0;
}

/**@brief Send CoAP POST request. */
static int client_post_send(void)
{
        int err;
        struct coap_packet request;

        next_token = sys_rand32_get();

        /* Initialize the CoAP packet and append the resource path */
        err = coap_packet_init(&amp;amp;request, coap_buf, sizeof(coap_buf),
                               APP_COAP_VERSION, COAP_TYPE_CON,
                               sizeof(next_token), (uint8_t *)&amp;amp;next_token,
                               COAP_METHOD_POST, coap_next_id());
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to create CoAP request, %d\n&amp;quot;, err);
                return err;
        }

        err = coap_packet_append_option(&amp;amp;request, COAP_OPTION_URI_HOST,
                                        (uint8_t *)CONFIG_COAP_SERVER_HOSTNAME,
                                        strlen(CONFIG_COAP_SERVER_HOSTNAME));
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to encode CoAP option, %d\n&amp;quot;, err);
                return err;
        }

        err = coap_packet_append_option(&amp;amp;request, COAP_OPTION_URI_PATH,
                                        (uint8_t *)CONFIG_COAP_TX_RESOURCE,
                                        strlen(CONFIG_COAP_TX_RESOURCE));
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to encode CoAP option, %d\n&amp;quot;, err);
                return err;
        }

        /* Add payload marker */
        err = coap_packet_append_payload_marker(&amp;amp;request);
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to append payload marker, %d\n&amp;quot;, err);
                return err;
        }

        /* Format and append test_counter as payload */
        char payload[64];

        int len = snprintf(payload, sizeof(payload), &amp;quot;0000000000000000000000000000000&amp;quot;);
        if (len &amp;lt; 0 || len &amp;gt;= sizeof(payload))
        {
                LOG_ERR(&amp;quot;Failed to format counter payload&amp;quot;);
                return -EINVAL;
        }

        err = coap_packet_append_payload(&amp;amp;request, (uint8_t *)payload, len);
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to append payload, %d\n&amp;quot;, err);
                return err;
        }

        err = send(sock, request.data, request.offset, 0);
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Failed to send CoAP request, %d\n&amp;quot;, errno);
                return -errno;
        }

        LOG_INF(&amp;quot;CoAP POST request sent: Token 0x%04x\n&amp;quot;, next_token);

        return 0;
}

/**@brief Handles responses from the remote CoAP server. */
static int client_handle_response(uint8_t *buf, int received)
{
        struct coap_packet reply;
        uint8_t token[8];
        uint16_t token_len;
        const uint8_t *payload;
        uint16_t payload_len;
        uint8_t temp_buf[128];
        /* Parse the received CoAP packet */
        int err = coap_packet_parse(&amp;amp;reply, buf, received, NULL, 0);
        if (err &amp;lt; 0)
        {
                LOG_ERR(&amp;quot;Malformed response received: %d\n&amp;quot;, err);
                return err;
        }

        /* Confirm the token in the response matches the token sent */
        token_len = coap_header_get_token(&amp;amp;reply, token);
        if ((token_len != sizeof(next_token)) ||
            (memcmp(&amp;amp;next_token, token, sizeof(next_token)) != 0))
        {
                LOG_ERR(&amp;quot;Invalid token received: 0x%02x%02x\n&amp;quot;,
                        token[1], token[0]);
                return 0;
        }

        /* Retrieve the payload and confirm it&amp;#39;s nonzero */
        payload = coap_packet_get_payload(&amp;amp;reply, &amp;amp;payload_len);

        if (payload_len &amp;gt; 0)
        {
                snprintf(temp_buf, MIN(payload_len + 1, sizeof(temp_buf)), &amp;quot;%s&amp;quot;, payload);
        }
        else
        {
                strcpy(temp_buf, &amp;quot;EMPTY&amp;quot;);
        }

        /* Log the header code, token and payload of the response */
        LOG_INF(&amp;quot;CoAP response: Code 0x%x, Token 0x%02x%02x, Payload: %s\n&amp;quot;,
                coap_header_get_code(&amp;amp;reply), token[1], token[0], (char *)temp_buf);

        return 0;
}

/* Example location structure – exact type is defined by the NTN API
 * (not fully shown in the provided docs). Adjust to the real type.
 */
struct app_location
{
        double lat;
        double lon;
        float accuracy_m;
};

/* Stub: get location from external GNSS or other source */
static int app_get_location(struct app_location *loc)
{
        /* TODO: Implement real location acquisition */
        loc-&amp;gt;lat = 36.331449;
        loc-&amp;gt;lon = -119.292130;
        loc-&amp;gt;accuracy_m = 200.0f;
        return 0;
}

/* Convert app_location to NTN library location type and call ntn_location_set().
 * The docs state that validity time must be longer than the interval between updates.[[NTN usage](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/ntn.html#usage)]
 */
static int app_ntn_provide_location(uint32_t validity_time_s)
{
        struct app_location loc;
        int err = app_get_location(&amp;amp;loc);
        if (err)
        {
                LOG_ERR(&amp;quot;Failed to get location: %d&amp;quot;, err);
                return err;
        }

        err = ntn_location_set(loc.lat, loc.lon, 12, validity_time_s);
        if (err)
        {
                LOG_ERR(&amp;quot;ntn_location_set failed: %d&amp;quot;, err);
        }
        else
        {
                LOG_INF(&amp;quot;NTN location updated, valid for %u s&amp;quot;, validity_time_s);
        }

        return err;
}

/* NTN event handler – called when modem needs location updates.[[NTN usage](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/ntn.html#usage)] */
static void app_ntn_event_handler(const struct ntn_evt *evt)
{
        switch (evt-&amp;gt;type)
        {
        case NTN_EVT_LOCATION_REQUEST:
                LOG_INF(&amp;quot;NTN location request&amp;quot;);

                /* Decide update interval based on max device speed, as suggested in docs.
                 * Example: 200 m accuracy, 120 km/h =&amp;gt; update at least every 6 s.[[NTN usage](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/ntn.html#usage)]
                 */
                app_ntn_provide_location(60000); /* validity_time_s &amp;gt;= update interval */
                break;

        default:
                LOG_DBG(&amp;quot;Unhandled NTN event type: %d&amp;quot;, evt-&amp;gt;type);
                break;
        }
}

int main(void)
{
        int err;
        int received;

        /* Register NTN handler (safe even if you start in TN mode) */
        ntn_register_handler(app_ntn_event_handler);

        err = modem_configure();
        if (err)
        {
                LOG_ERR(&amp;quot;Failed to configure the modem&amp;quot;);
                return 0;
        }

        if (server_resolve() != 0)
        {
                LOG_INF(&amp;quot;Failed to resolve server name&amp;quot;);
                return 0;
        }

        if (client_init() != 0)
        {
                LOG_INF(&amp;quot;Failed to initialize client&amp;quot;);
                return 0;
        }

        while (1)
        {
                /* Receive response from the CoAP server */
                received = recv(sock, coap_buf, sizeof(coap_buf), 0);

                if (received &amp;lt; 0)
                {
                        LOG_ERR(&amp;quot;Socket error: %d, exit\n&amp;quot;, errno);
                        break;
                }
                else if (received == 0)
                {
                        LOG_INF(&amp;quot;Empty datagram\n&amp;quot;);
                        continue;
                }

                /* Parse the received CoAP packet */
                err = client_handle_response(coap_buf, received);
                if (err &amp;lt; 0)
                {
                        LOG_ERR(&amp;quot;Invalid response, exit\n&amp;quot;);
                        break;
                }
        }

        (void)close(sock);

        return 0;
}

void send_req_thread(void *arg1, void *arg2, void *arg3)
{
        k_sem_take(&amp;amp;con_sem, K_FOREVER);
        while (1)
        {
                client_post_send();
                k_sleep(K_SECONDS(10));
        }
}

K_THREAD_DEFINE(send_req, SEND_REQ_THREAD_STACK_SIZE, send_req_thread, NULL, NULL, NULL,
                SEND_REQ_THREA_PRIORITY, 0, 0);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558250?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 10:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fb7799d-a037-45f4-bbf7-e2edd7f996b6</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Thanks for the clarification on the SIM and network operator requirements.&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Priyesh&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558246?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 10:14:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35f8d6bf-c739-43b2-a346-e7eef95e9f34</guid><dc:creator>Benjamin</dc:creator><description>[quote user="Priyesh Shahi"]And also&amp;nbsp;we need a special eSIM/SIM for NTN, different from standard cellular NB-IoT?[/quote]
&lt;p&gt;No, t&lt;span&gt;he &lt;/span&gt;&lt;span&gt;nRF9151&lt;/span&gt;&lt;span&gt; supports switching between terrestrial and non-terrestrial radio access. You could use the same SIM card if that is what you are asking. However, you need&amp;nbsp;a network operator that supports&amp;nbsp;NTN.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558222?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 06:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f643686e-9b0b-49dc-a1b1-f49760662b4b</guid><dc:creator>Achim Kraus</dc:creator><description>[quote userid="129185" url="~/f/nordic-q-a/126266/ntn-support-and-application-feasibility-on-nrf9151/558220"]Achim mentioned adding NTN support using AT commands. [/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That was referring to NCS 3.1.0. With NCS 3.2.0 that&amp;#39;s included in the&amp;nbsp;nrf/lib/lte_link_control.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558220?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 04:33:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:693ceb46-acf6-458c-83b2-ac35473ecbb4</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;div class="ds-message _63c77b1"&gt;
&lt;div class="ds-markdown"&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Benjamin,&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Thanks for confirming CoAP/custom payloads work over NTN.&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;Achim mentioned adding NTN support using AT commands. Is there a library or code example for this, or is it a manual AT command configuration?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;And also&amp;nbsp;we need a special eSIM/SIM for NTN, different from standard cellular NB-IoT?&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Appreciate the guidance.&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Priyesh&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558170?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 13:51:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4085e54b-fa8d-4628-b4d7-97522ef8f94b</guid><dc:creator>Benjamin</dc:creator><description>&lt;p class="isSelectedEnd"&gt;&lt;span&gt;Yes, CoAP or other custom payloads are supported.&lt;/span&gt;&lt;/p&gt;
&lt;p class="isSelectedEnd"&gt;&lt;span&gt;This is NB-IoT over satellite rather than terrestrial cell towers. You can now access several satellite-based cellular networks in much the same way as traditional LTE-M or NB-IoT networks. Also see the answer from Achim Kraus.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Benjamin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/558146?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 12:20:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8804c5b-8f98-4405-834e-ad54961bc81f</guid><dc:creator>Priyesh Shahi</dc:creator><description>&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Hi Benjamin,&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Thanks for the info.&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Quick question:&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;br /&gt;&lt;span&gt;Can we connect to a CoAP server over NTN like we do on cellular, or is NTN only for location updates?&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Is custom payload upload supported beyond basic asset tracking?&lt;/span&gt;&lt;/p&gt;
&lt;p class="ds-markdown-paragraph"&gt;&lt;span&gt;Regards&amp;nbsp;,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Priyesh&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/557721?ContentTypeID=1</link><pubDate>Tue, 30 Dec 2025 11:05:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4f67650-f967-44c2-85bc-a849bb353edd</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi Priyesh,&lt;br /&gt;To fill out some more information not already answered by Achim:&lt;/p&gt;
[quote user=""]Which &lt;strong&gt;nRF Connect SDK versions&lt;/strong&gt; include sample applications or support for NTN on nRF9151?[/quote]
&lt;p&gt;The NCS version you need is v3.2.0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We recommend starting with either of this two options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://github.com/nrfconnect/ncs-serial-modem"&gt;Serial Modem Application&lt;/a&gt;&amp;nbsp;(modem only apporach, AT commands)&lt;/li&gt;
&lt;li&gt;Asset Tracker Template configured for satellite connectivity.&lt;strong&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;Note&lt;/strong&gt;:&amp;nbsp;To ensure NTN support is correctly implemented, please refer to our dedicated &lt;a href="https://github.com/nrfconnect/Asset-Tracker-Template/blob/ntn_usecase/README.md" rel="noopener noreferrer" target="_blank"&gt;NTN use case doc&lt;/a&gt;&amp;nbsp;and &lt;a href="https://github.com/nrfconnect/Asset-Tracker-Template/blob/tn_ntn_usecase/README.md" rel="noopener noreferrer" target="_blank"&gt;NTN and TN use case doc&lt;/a&gt;, as the standard template is not configured for NTN by default.&lt;/p&gt;
[quote user=""]If official samples are not yet available, is there a &lt;strong&gt;roadmap or expected timeline&lt;/strong&gt; for when they might be provided?[/quote]
&lt;p&gt;Please reach out to&amp;nbsp;the regional sales manager for your area as we cannot talk about roadmap on DevZone.&lt;/p&gt;
[quote user=""]&lt;span style="font-family:inherit;"&gt;What &lt;/span&gt;&lt;strong style="font-family:inherit;"&gt;type of antenna&lt;/strong&gt;&lt;span style="font-family:inherit;"&gt; is required or recommended for NTN operation on the nRF9151?&lt;/span&gt;[/quote]
&lt;p&gt;&lt;span&gt;We recommend reaching out to our&amp;nbsp;&lt;/span&gt;&lt;a title="https://www.nordicsemi.com/resources/nordic-partners/solution-partners" href="https://www.nordicsemi.com/Resources/Nordic-Partners/Solution-Partners"&gt;antenna solution partners&lt;/a&gt;.&lt;span&gt;&amp;nbsp;They are equipped to provide detailed guidance on the most suitable antenna for your specific application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NTN NB-IoT&amp;nbsp;require optimal link conditions, and the choice of antenna depends on multiple&amp;nbsp;factors, including whether the application supports both LTE and NTN or NTN alone, as well as the physical constraints of the product.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For applications targeting both LTE and NTN, it is essential to select a wideband antenna that can meet the performance and form factor requirements of both technologies. The antenna must support a broad frequency range to satisfy the performance criteria of LTE networks and the relevant satellite operators.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://www.nordicsemi.com/-/media/Software-and-other-downloads/Product-Briefs/nRF9151-SMA-DK-Product-Brief-v1.0.pdf"&gt;nRF9151 SMA DK&lt;/a&gt;&amp;nbsp;includes Taoglas (LTE/NTN/NR+) and Kyocera (GNSS) antennas.&lt;/p&gt;
[quote user=""]If not, could you please advise on the &lt;strong&gt;current status and roadmap&lt;/strong&gt; for NTN support on nRF9151?[/quote]
&lt;p&gt;The alpha version of the NTN modem FW is now public and can be downloaded&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/nRF9151/Download"&gt;here&lt;/a&gt;. This firmware is only for nRF9151 LACA A1 SiP.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/557630?ContentTypeID=1</link><pubDate>Fri, 26 Dec 2025 08:34:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a78605a0-6810-4e79-af9f-e0a9ae8c475b</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I checked NCS 3.2.1 for NTN support and it&amp;#39;s now there, see &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v3.2.1/lib/lte_link_control/modules/xsystemmode.c#L112-L120"&gt;xsystemmode&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NTN Support and Application Feasibility on nRF9151</title><link>https://devzone.nordicsemi.com/thread/557560?ContentTypeID=1</link><pubDate>Tue, 23 Dec 2025 07:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45564273-ab49-4c00-a3c9-a051e1703067</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Though I&amp;#39;m an other user, that&amp;#39;s just my experience:&lt;/p&gt;
&lt;p&gt;AFAIK, there is still no NCS support, but to add that (extend some link control function with new values), was on my side a work of two afternoons. The new AT-cmds and/or parameter and/or&amp;nbsp; parameter-values are documented.&lt;/p&gt;
&lt;p&gt;You will need a SIM card, that supports some NTN provider, and considering that, you may also check and consider the (much) higher costs.&lt;/p&gt;
&lt;p&gt;I use CoAP/DTLS 1.2 CID over NTN (own device DTLS stack (Eclipse/tinydtls) to relax the timing (timeout to 30s), Eclipse/Californium (also with relaxed timing). Depending on antenna, boards and what ever, it works, but sometimes the modem requires a couple of retransmissions (not sure, if the messages are lost before they billed or after ;-) ). The overhead of IP/UDP/DTLS 1.2 CID/CoAP is about 100 extra bytes. If you want to use an ACK or CoAP response, you will need a second 100 bytes for that message. Using tinydtls allows you also to offload the dtls session from the socket, so that works pretty well to have an &amp;quot;handshake on TN&amp;quot; and the switch to &amp;quot;NTN&amp;quot;. If that&amp;#39;s a good idea depends on your usage. Statically located without TN requires to do some handshakes over NTN, with DTLS 1.2 CID, they are rare.&lt;/p&gt;
&lt;p&gt;I run that now since September. with an send interval of 9h.&lt;/p&gt;
&lt;p&gt;Alternatively you may use a VPN from your provider to your server or maybe OSCORE, if you have a implementation for that.&lt;/p&gt;
&lt;p&gt;Hope that gives you a first impression.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>