NTN with lte_lc (NCS 3.2.4+)
This page describes bringing up NTN from a Zephyr application using Nordic's lte_lc and ntn libraries, as an alternative to the AT-command approach described on the NTN with Serial LTE Modem page. Use SLM for bench bring-up and protocol exploration; use lte_lc when integrating NTN into a production application.
Guidance below follows Achim Kraus's notes and the Nordic NTN AT command reference (nrf91x1_ntn_at_commands_v0.8.1.pdf).
Prerequisites
- NCS 3.2.4 or later. Earlier versions (including 3.2.0) do not expose the full NTN API through
lte_lc. - NTN modem firmware flashed — see the SLM page for the current download.
- NTN-provisioned SIM and antenna as described on the SLM page.
Kconfig
In prj.conf:
CONFIG_LTE_NETWORK_MODE_NTN_NBIOT=y
CONFIG_LTE_LOCK_BAND_MASK="255,256"
CONFIG_NTN=y
Only one CONFIG_LTE_NETWORK_MODE_* should be selected — do not also enable the LTE-M or NB-IoT network modes.
CONFIG_NTN=y is required for ntn_location_set().
Application code
#include <modem/lte_lc.h>
#include <modem/ntn.h>
#include <modem/nrf_modem_lib.h>
/* Seed the modem with your approximate position. A few km accuracy is fine. */
ntn_location_set(/* lat */, /* lon */, /* alt */, /* uncertainty */, /* age */);
/* Select NTN NB-IoT as the active system mode. */
lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_NTN_NBIOT,
LTE_LC_SYSTEM_MODE_PREFER_AUTO);
/* Connect. */
lte_lc_connect();
The lte_lc C API currently covers most but not all NTN configuration. Settings not yet exposed (e.g. certain %XBANDLOCK or %XSYSTEMMODE options) can be issued directly with nrf_modem_at_cmd():
char resp[64];
nrf_modem_at_cmd(resp, sizeof(resp), "AT%%XBANDLOCK=2,,\"255,256\"");
%XSYSTEMMODE extension
The NTN AT command reference adds a fifth parameter to %XSYSTEMMODE:
%XSYSTEMMODE=<LTE_M_support>,<NB_IoT_support>,<GNSS_support>,<LTE_preference>[,<NTN_NB_IoT_support>]
When <NTN_NB_IoT_support> is 1, all other parameters must be 0. This is what CONFIG_LTE_NETWORK_MODE_NTN_NBIOT=y / LTE_LC_SYSTEM_MODE_NTN_NBIOT sets for you.
PDP context
Set the PDP context to match your provider — see the SLM page for the Soracom+Skylo vs Deutsche Telekom+Skylo distinction. In lte_lc applications this is typically done via pdn_ctx_create() / pdn_activate() or by relying on the default context configured from Kconfig.
Troubleshooting
Attach symptoms (+CEREG states, %MDMEV: SEARCH STATUS, etc.) and recommended diagnostic commands (AT%XMONITOR, AT%CONEVAL, AT+COPS=?) are the same as on the SLM page's troubleshooting section. You can issue those AT commands from within the application using nrf_modem_at_cmd() for the same insight SLM gives you over serial.