Serial LTE Modem

Let's build and test 'Serial LTE Modem' application with nRF9160 M.2 Development Kit.

'Serial LTE Modem' Application is located at C:\ncs\v1.7.1\nrf\applications\serial_lte_modem

1. Edit 'Serial LTE Modem' Application

1.1 Create file 'soonisys_sldev_nrf9160ns.overlay'

&uart2 {
	compatible = "nordic,nrf-uarte";
	current-speed = <115200>;
	status = "okay";
	tx-pin = <17>;
	rx-pin = <18>;
};

&i2c2 {
	status = "disabled";
};

You can change any pin for uart-2 tx/rx.

1.2 Edit file 'sample.yaml'

sample:
  name: serial lte modem sample
tests:
  samples.nrf9160.serial_lte_modem:
    build_only: true
    platform_allow: soonisys_sldev_nrf9160ns
    tags: ci_build
  samples.nrf9160.serial_lte_modem.native_tls:
    build_only: true
    extra_args: OVERLAY_CONFIG=overlay-native_tls.conf
    platform_allow: soonisys_sldev_nrf9160ns
    tags: ci_build

1.3 Edit file 'prj.conf'

Edit SLM(Serial LTE Modem) part in prj.conf.

You can select either uart0(connected to usb) or uart2(pin) and change the interface pin(12) for sleep&wake.

UART-0(USB) USE CASE

prj.conf - uart0

UART-2(Tx/Rx PIN) USE CASE

prj.conf - uart1

2. Build and Run

open project

3. Test

LTE Link Monitor
  • Launch 'LTE Link Monitor'

  • Connect to USB COM Port

  • Check 'Automatic requests'

  • Uncheck 'Flow control'

3.1 Serial Commands - LTE Connection

  1. AT+CFUN=1

  2. AT+CFUN?

LTE Link Monitor will send requests after 'AT+CFUN?'

3.2 Serial commands - UDP Send&Recv(Socket)

  1. AT#XSOCKET=1,2,0 (Create UDP socket with ipv4)

  2. AT#XCONNECT="3.37.91.140",39633 (Connect to soonisys's echo server)

  3. AT#XSEND="Hello soonisys" (Send packet to connected server)

  4. AT#XRECV=1 (Recv packet, timeout=1sec)

  5. AT#XSOCKET=0 (Close socket)

simple udp send&recv

3.3 Serial commands - LTE Disconnection

  1. AT+CFUN=0

4. Reference

InstallationHello World - Sample

Last updated