nRF Util on Ubuntu 20: unable to capture modem trace

Hello all,

I'm experiencing an issue while trying to capture modem traces from nRF9160DK with modem firmware 1.3.5 using nRF Util on Ubuntu 20.

I'm using Ubuntu Desktop 20.04.6 LTS with all packages up to date as of right now. I've installed this operating system both within VMWare Workstation 17 Player and on bare metal with the same result.

I have installed the following software:

  • Segger J-Link V7.90a (installation through GUI installer)
  • nRF-Udev V1.0.1 (installation through GUI installer)
  • libusb-1.0 (was already installed)
  • nRF Util (made executable and then moved into the Path folder /usr/bin) with the device and trace tool
  • Wireshark (from apt)
  • nRF Connect Desktop V4.1.2 with Cellular Monitor, Power Profiler, Programmer, Serial Monitor and Toolchain Manager

No matter which output option I choose I always get the same error sometime after I start a modem trace:

Error: Tracing failed

Caused by:
    unable to locate db directory  plugin path: /home/florian/.nrfutil/lib/nrfutil-trace/plugins/nrfml-insight-source.nrfml (error code 100)

But the file in question is present and readable for everyone (output truncated):

florian@ubuntu:~$ ls -la /home/florian/.nrfutil/lib/nrfutil-trace/plugins/
total 20760
drwxrwxr-x 2 florian florian    4096 Aug 10 14:51 .
drwxrwxr-x 3 florian florian    4096 Aug 10 14:51 ..
-rw-r--r-- 1 florian florian 8259488 Aug 10 14:51 nrfml-insight-source.nrfml

For all output methods nothing is captured (either in a file or in Wireshark) even though I've issued AT commands with the nRF Connect Serial Terminal during these attempts.

With the same AT commands I'm able to create a modem trace using nRF Connect Cellular Monitor on the same computer.

The nRF Connect Cellular Monitor was not open during my attempts to capture modem traces with nRF Util.

I have double checked the COM Port with nRF Connect Cellular Monitor.

These are some of the commands I've issued to create a modem trace with nRF Util:

  • With output to Wireshark:

nrfutil trace lte --input-serialport /dev/ttyACM2 --output-wireshark /usr/bin/wireshark

In this case I get an additional error right after executing this command:

sh: 1: disown: not found

But disown is present on the system:

florian@ubuntu:~$ disown --help
disown: disown [-h] [-ar] [jobspec ... | pid ...]
    Remove jobs from current shell.
    
    Removes each JOBSPEC argument from the table of active jobs.  Without
    any JOBSPECs, the shell uses its notion of the current job.
    
    Options:
      -a	remove all jobs if JOBSPEC is not supplied
      -h	mark each JOBSPEC so that SIGHUP is not sent to the job if the
    		shell receives a SIGHUP
      -r	remove only running jobs
    
    Exit Status:
    Returns success unless an invalid option or JOBSPEC is given.

Wireshark opens but nothing gets captured.

  • With output to a pcapng file:

nrfutil trace lte --input-serialport /dev/ttyACM2 --output-pcapng trace.pcapng

After nRF Util crashes only a 96 Byte file is left behind. This file does not include any packets.

Here are the AT commands I'm sending to the nRF9160 DK:

AT%XMODEMTRACE=1,2
AT%XSYSTEMMODE=1,0,1,0
AT+CPSMS=1
AT+CGDCONT=0,"IP","m2m.public.at"
AT+CFUN=1
AT#XNRFCLOUD=1
AT#XAGPS=1,10,10

The APN I'm using is for a Magenta Austria IoT Sim.

I would appreciate it if someone could assist me with this issue.

Thanks in advance!

regards,

Florian

In a previous version of this ticket I included the error message where I installed and executed nRF Util trace with sudo.

Parents
  • Are you running nrfutil as root? If nrfutil is running as root it is trying to find the plugin in $HOME(root)/.nrfutil/(...).

    Could you please specify where nrfutil is installed, with the NRFUTIL_HOME environment variable? If it is home/fabian/.nrfutil, then it would be export NRFUTIL_HOME=/home/fabian/.nrfutil

  • Update:

    For Modem Firmware 1.3.5 this has been resolved with the update to version 2.1.0 of nRF Util Trace. Thank you to the Nordic team for releasing this update.

    If anyone is facing this issue in the future with a newer version of the Modem Firmware, I documented the fix I applied before the update below the horizontal line.

    Here is the long version for context:

    I did some further testing with nRF Util on Ubuntu 20 and Windows 11.

    In essence I get a very similar error on both platforms.

    Here is the error message I get on Windows 11:

    Error: Tracing failed
    
    Caused by:
        unable to locate db directory  plugin path: C:\Users\flori\.nrfutil\lib\nrfutil-trace/plugins\nrfml-insight-source.nrfml (error code 100)

    But when I copy this path into file explorer, I'm able to open the file.

    On both operating systems the error applies to both live capture from the COM Port directly and converting a binary file which was captured with a few lines of python code. I used the same COM Port for direct capture with nRF Util and for capture with the python code 

    These binary files can be read and converted into pcapng files with nRF Connect Cellular Monitor.

    Furthermore, I tried to include the AT command AT+CGMR at the start of my routine. My thought behind that was that it might be good to include the modem firmware version in the trace since nRF Connect Cellular Monitor also uses this information. But this didn't help to resolve the issue.

    I noticed that a new version of nRF Util trace is now available (update from 1.0.1 to 2.0.0).

    But even with this new version I got the same error as before on both platforms.

    Uninstalling and re-installing nRF Util trace didn't help either

    I then looked into nRF Util trace a bit further and found the --keep-configuration option. I exported a configuration file and found the trace_db_locations entry. I opened the file and found that the trace db for modem firmware 1.3.5 is missing in release 2.0.0 of nRF Util trace (and probably was missing in the last release as well).


    What is the problem:

    I'm using modem firmware 1.3.5 and the trace db for modem firmware 1.3.5 is missing from the current release of nRF Util trace.

    This was the solution to my problem:

    I downloaded the following three files from GitHub:

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/config_v2.json

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/mfw_nrf9160_1.3.5-FOTA-TEST_trace-db.json

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/mfw_nrf9160_1.3.5_trace-db.json

    These should also be present on the system if nRF Connect Cellular Monitor is installed. I got them from GitHub because I looked through this repo before and I knew where to look for these files.

    I moved these files into this folder:

    Windows: C:\Users\<your_user>\.nrfutil\share\nrfutil-trace\auto-detect-trace-db-config

    Ubuntu: /home/<your_user>/.nrfutil/share/nrfutil-trace/auto-detect-trace-db-config

    In the folder mentioned above the file config.json already exists.

    Because of this I performed the following two actions:

    • I renamed config.json to config_old.json.
    • I renamed config_v2.json to config.json. 

    Now nRF Util trace works as intended with modem firmware 1.3.5.

    I hope that this solution can help someone who is in a similar situation and that the trace db for modem firmware 1.3.5 can be included in a future release of nRF Util trace.

Reply
  • Update:

    For Modem Firmware 1.3.5 this has been resolved with the update to version 2.1.0 of nRF Util Trace. Thank you to the Nordic team for releasing this update.

    If anyone is facing this issue in the future with a newer version of the Modem Firmware, I documented the fix I applied before the update below the horizontal line.

    Here is the long version for context:

    I did some further testing with nRF Util on Ubuntu 20 and Windows 11.

    In essence I get a very similar error on both platforms.

    Here is the error message I get on Windows 11:

    Error: Tracing failed
    
    Caused by:
        unable to locate db directory  plugin path: C:\Users\flori\.nrfutil\lib\nrfutil-trace/plugins\nrfml-insight-source.nrfml (error code 100)

    But when I copy this path into file explorer, I'm able to open the file.

    On both operating systems the error applies to both live capture from the COM Port directly and converting a binary file which was captured with a few lines of python code. I used the same COM Port for direct capture with nRF Util and for capture with the python code 

    These binary files can be read and converted into pcapng files with nRF Connect Cellular Monitor.

    Furthermore, I tried to include the AT command AT+CGMR at the start of my routine. My thought behind that was that it might be good to include the modem firmware version in the trace since nRF Connect Cellular Monitor also uses this information. But this didn't help to resolve the issue.

    I noticed that a new version of nRF Util trace is now available (update from 1.0.1 to 2.0.0).

    But even with this new version I got the same error as before on both platforms.

    Uninstalling and re-installing nRF Util trace didn't help either

    I then looked into nRF Util trace a bit further and found the --keep-configuration option. I exported a configuration file and found the trace_db_locations entry. I opened the file and found that the trace db for modem firmware 1.3.5 is missing in release 2.0.0 of nRF Util trace (and probably was missing in the last release as well).


    What is the problem:

    I'm using modem firmware 1.3.5 and the trace db for modem firmware 1.3.5 is missing from the current release of nRF Util trace.

    This was the solution to my problem:

    I downloaded the following three files from GitHub:

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/config_v2.json

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/mfw_nrf9160_1.3.5-FOTA-TEST_trace-db.json

    https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor/blob/main/resources/traceDB/mfw_nrf9160_1.3.5_trace-db.json

    These should also be present on the system if nRF Connect Cellular Monitor is installed. I got them from GitHub because I looked through this repo before and I knew where to look for these files.

    I moved these files into this folder:

    Windows: C:\Users\<your_user>\.nrfutil\share\nrfutil-trace\auto-detect-trace-db-config

    Ubuntu: /home/<your_user>/.nrfutil/share/nrfutil-trace/auto-detect-trace-db-config

    In the folder mentioned above the file config.json already exists.

    Because of this I performed the following two actions:

    • I renamed config.json to config_old.json.
    • I renamed config_v2.json to config.json. 

    Now nRF Util trace works as intended with modem firmware 1.3.5.

    I hope that this solution can help someone who is in a similar situation and that the trace db for modem firmware 1.3.5 can be included in a future release of nRF Util trace.

Children
No Data
Related