If you are having issues with the exercises, please create a ticket on DevZone:
Click or drag files to this area to upload. You can upload up to 2 files.

Exercise 1

Capturing a modem trace

In this exercise, we will use the Cellular Monitor to capture a modem trace.

The application used in this exercise connects to a CoAP server over DTLS, just like we did in Lesson 5 Exercise 2. The difference is it also requests both PSM (with the values <Periodic-TAU> 8 hours and <Active-Timer> 16 seconds) and eDRX.

This will prepare us to debug problems by analyzing the trace, which we will do in Exercise 2.

Exercise Steps

1. 1. In the GitHub repository for this course, go to the base code for this exercise, found in lesson7/cellfund_less7_exer1 of whichever version directory you are using (v2.2.0-v2.3.0 or v2.4.0-v2.x.x).

2. Enable outputting modem traces in the application and include the AT Host library.

Let’s tell the modem to give us a trace, by enabling CONFIG_NRF_MODEM_LIB_TRACE.

In addition, include the AT Host library so that Cellular Monitor can send AT commands to the modem.

2. Build and flash the project to your device.

3. Open nRF Connect for Desktop and the Cellular Monitor application.

4. In the upper left hand corner select your device, in this case, the nRF9160 DK.

5. Configure the Trace Options, before beginning the trace.

In the sidebar on the left, under Trace Options, make sure both “Reset device on start” and “Save trace file to disk” are enabled.


If Wireshark is already installed, you can also enable “Open in Wireshark” to see the output from the trace as the application is running. This is very useful when actually debugging a problem in real-time.

6. To start the tracing, select the Start button at the top of the sidebar.

If the trace capturing is successful, the file size of the trace should be increasing and there should be incoming commands in the Packet Even Viewer.

The Packet Event Viewer underneath the dashboard displays the incoming commands from the modem on the AT, RRC, NAS and IP levels. Make sure LIVE is enabled to see the incoming commands in real-time.


If the file size is not increasing while the application is running, the modem tracing was likely not successful. This could be for a number of reasons, for example that you haven’t enabled it in the Modem library (CONFIG_NRF_MODEM_LIB_TRACE) or that the application has crashed.

7. View the log output from the application while tracing.

When capturing a trace, it’s useful to monitor the log output from the application simultaneously. To do this, click on the Open Serial Terminal button in the sidebar, which will launch the Serial Terminal application already connected to your device and display the output.

8. When the application has run for a few minutes, or you’ve encountered the error you want to debug, press the Stop button to stop the trace capture.

To find out where the trace is stored, click on the trace name in RAW file name under Trace Options.


When sharing the trace file with Nordic Semiconductor for debugging assistance, make sure that this is the file you send (.mtrace or .bin) as it contains more information than the file type (.pcap) that we will open in Wireshark in the next exercise.

In the next exercise, we will open the file in Wireshark to see the contents of the trace and explain parts of it.

The solution for this exercise can be found in lesson7/cellfund_less7_exer1_solution of whichever version directory you are using (v2.2.0-v2.3.0 or v2.4.0-v2.x.x).

Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.