Hi,

I’ve been playing around with the 9160 feather and have had the AT commands program running. then I managed to get the AWS-iot sample connected to my aws iot core and sending the battery level. but I now want to get GPS data sent to the AWS core.
I have tried installing the Asset Tracker V2 program but it doesn’t seem to run at all. if I connect the serial monitor and reset the device, I get nothing on the screen.

I get no build errors or errors uploading. Any suggestions where to look?

Cheers,

Chris.

Hi @cwb

You’re referring to the tracker sample in NCS?

To get it to work some overlays would likely have to be mapped to the functionality on the device. I believe that sample also relies on the sensors that come with the Thingy91. I haven’t looked recently but it was a painful effort when I looked last.

I did make a basic tracker a while back. You may want to check it out. It does need some updating though:

https://github.com/circuitdojo/nrf9160-feather-examples-and-drivers/tree/v2.3.x/samples/tracker

Hi Jared,

Thanks for the quick reply.

Yes, I was playing with the Asset Tracker sample in ncs > nrf > Applications. Given it captured GPS data and then sent it to AWS already I had thought this was easier than trying to mash the GPS sample with the mqtt or aws iot samples I had seen people trying. Turns out it is not easier 🙂

I’ll have a look at that tracker sample you linked. my ultimate goal is to have the GPS data on our Thingsboard dashboard. Looks like the path of least resistance might be to send to Golioth and forward to thingsboard from there.

I’ll do a bit of research into Golioth now. thanks.

Golioth is a great option. Let me know how it goes!

Does Golioth need the default certificates that came on the board? Those were accidentally overwritten 😐

No those are for nRF Cloud. You’ll need to generate a PSK/PSK ID pair and then insert it into your .conf file. You can also store it in the onboard key store on the nRF91 but the setup is a bit more involved 😇 I should probably do a video on that!

I’ve followed the guide you have there but i’m guessing the build errors I get are due to the code needing updating like you mentioned?

warning: MBEDTLS_HEAP_SIZE (defined at C:/Users/Admin/tracker-
proj/nrf\subsys/net/openthread/Kconfig.defconfig:141, C:/Users/Admin/tracker-
proj/nrf\subsys\dfu\fmfu_fdev/Kconfig:21, C:/Users/Admin/tracker-
proj/zephyr/modules/mbedtls/Kconfig:194, C:/Users/Admin/tracker-
proj/nrfxlib\nrf_security/Kconfig:85, modules\mbedtls\Kconfig:194) was assigned the value '49152'
but got the value ''. Check these unsatisfied dependencies: (NET_L2_OPENTHREAD || FMFU_FDEV ||   
(MBEDTLS_ENABLE_HEAP && MBEDTLS) || (MBEDTLS_ENABLE_HEAP && NRF_SECURITY) || (MBEDTLS_ENABLE_HEAP && MBEDTLS && 0)) (=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MBEDTLS_HEAP_SIZE and/or look up MBEDTLS_HEAP_SIZE in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too. warning: Deprecated symbol SETTINGS_FS is enabled. warning: Experimental symbol NET_SOCKETS_SOCKOPT_TLS is enabled. warning: Experimental symbol NET_SOCKETS_ENABLE_DTLS is enabled. warning: the value 'v2.3.x-10-gd7e710e' is invalid for APP_VERSION_MAJOR (defined at C:/Users/Admin/tracker-proj/nfed/samples/tracker\src/version/Kconfig:3), which has type int -- assignment ignored warning: the value 'v2.3.x-10-gd7e710e' is invalid for APP_VERSION_MINOR (defined at C:/Users/Admin/tracker-proj/nfed/samples/tracker\src/version/Kconfig:7), which has type int -- assignment ignored warning: the value 'v2.3.x-10-gd7e710e' is invalid for APP_VERSION_PATCH (defined at C:/Users/Admin/tracker-proj/nfed/samples/tracker\src/version/Kconfig:11), which has type int -- assignment ignored warning: the value 'v2.3.x-10-gd7e710e' is invalid for APP_VERSION_COMMIT (defined at C:/Users/Admin/tracker-proj/nfed/samples/tracker\src/version/Kconfig:15), which has type int -- assignment ignored error: Aborting due to Kconfig warnings CMake Error at C:/Users/Admin/tracker-proj/zephyr/cmake/modules/kconfig.cmake:328 (message): command failed with return code: 1 Call Stack (most recent call first): C:/Users/Admin/tracker-proj/nrf/cmake/modules/kconfig.cmake:29 (include) C:/Users/Admin/tracker-proj/zephyr/cmake/modules/zephyr_default.cmake:108 (include) C:/Users/Admin/tracker-proj/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/Users/Admin/tracker-proj/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate) CMakeLists.txt:74 (find_package) -- Configuring incomplete, errors occurred! ←[91mFATAL ERROR: command exited with status 1: 'C:\Users\Admin\.zephyrtools\cmake\cmake-3.22.0-windows-x86_64\bin\cmake.EXE' '-DWEST_PYTHON=C:\Users\Admin\.zephyrtools\env\Scripts\python.exe' '-BC:\Users\Admin\tracker-proj\nfed\samples\tracker\build' -GNinja -DBOARD=sparkfun_thing_plus_nrf9160_ns '-SC:\Users\Admin\tracker-proj\nfed\samples\tracker' ←[0m * The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command west build -b sparkfun_thing_plus_nrf9160_ns -p" terminated with exit code: 1. * Terminal will be reused by tasks, press any key to close it.

I gave it a quick once over. You should be able to build it now. (make sure you do a git pull in the nfed directory first)

Thanks Jared,
I missed the stop of downloading the SUPL library from Nordic. Just waiting for Nordic to approve my account so I can download it.
I’ll let you know how the code goes once I have that.

Cheers,

Sounds good! They’re usually pretty quick about. Standing by. 😎

looking better now. Builds fine now and code uploads. it doesn’t seem to initialise the modem though? after a reset it goes straight to this output…

"
Connecting..
Connected to COM9!
[00:00:09.038,482] <inf> golioth_system: Starting connect
[00:00:09.048,950] <err> golioth_system: Failed to connect: -2
[00:00:09.058,410] <wrn> golioth_system: Failed to connect: -2
[00:00:14.068,023] <inf> golioth_system: Starting connect
[00:00:14.105,224] <err> golioth_system: Failed to connect: -2
[00:00:14.114,685] <wrn> golioth_system: Failed to connect: -2
[00:00:19.124,267] <inf> golioth_system: Starting connect
[00:00:19.161,468] <err> golioth_system: Failed to connect: -2
[00:00:19.170,928] <wrn> golioth_system: Failed to connect: -2
"

going to have a look through the code tomorrow but if you have any ideas.

thanks for the assistance Jared.

@cwb I created a new branch for NCS 2.4.x. I’d rather update the tracker sample to the latest than work on something that is now outdated.

As you can see I’m uploading the boot message to Golioth:

GPS does start but it’s using non-SUPL by default. If you have a direct view of the sky it should get a fix < 60 sec.

Here’s the updated branch:

https://github.com/circuitdojo/nrf9160-feather-examples-and-drivers/tree/v2.4.x

You’ll need to run git checkout v2.4.x in nfed and then run a west update or Zephyr Tools: Update Dependencies

switched to the v2.4.x branch and ran the build. but it is erroring out now. seems to relate to the command add_library(tfm_qcbor_s STATIC EXCLUDE_FROM_ALL)

CMake Error at lib/ext/qcbor/CMakeLists.txt:31 (add_library):
  Cannot find source file:

    C:/Users/Admin/new-tracker/modules/tee/tf-m/qcbor/src/ieee754.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


CMake Error at lib/ext/qcbor/CMakeLists.txt:31 (add_library):
  No SOURCES given to target: tfm_qcbor_s


CMake Generate step failed.  Build files cannot be regenerated correctly.
ninja: build stopped: subcommand failed.

Yea for some reason I can compile locally here but it’s failing on CI. Looks like there’s a conflicting version of QCBOR. Trying to replicate locally.

Aye! we’re building now!

I’m running a sparkfun version of the board though which does not build. If I set the board to circuitdojo_feather_nrf9160_ns it builds fine but the modem wont start (assuming slightly different architecture?) When i change board

error is

FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/Users/Admin/new-tracker/nfed/samples/tracker/build/zephyr/zephyr_pre0.map     
cmd.exe /C "cd . && C:\Users\Admin\.zephyrtools\toolchain\zephyr-sdk-0.15.1\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\Users\Admin\new-tracker\nfed\samples\tracker\build\zephyr && C:\Users\Admin\.zephyrtools\cmake\cmake-3.22.0-windows-x86_64\bin\cmake.exe -E echo "" c:/users/admin/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(app_event_manager.c.obj): in function `event_manager_thread': C:/Users/Admin/new-tracker/nfed/samples/tracker/src/event_manager/app_event_manager.c:118: undefined reference to `app_battery_measure_enable' c:/users/admin/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/Users/Admin/new-tracker/nfed/samples/tracker/src/event_manager/app_event_manager.c:119: undefined reference to `app_battery_sample' c:/users/admin/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/Users/Admin/new-tracker/nfed/samples/tracker/src/event_manager/app_event_manager.c:120: undefined reference to `app_battery_measure_enable' c:/users/admin/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(app_motion.c.obj): in function `sensor_trigger_set': C:/Users/Admin/new-tracker/zephyr/include/zephyr/drivers/sensor.h:499: undefined reference to `__device_dts_ord_98' c:/users/admin/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(app_motion.c.obj): in function `app_motion_sample_fetch': C:/Users/Admin/new-tracker/nfed/samples/tracker/src/motion/app_motion.c:68: undefined reference to `__device_dts_ord_98' collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. FATAL ERROR: command exited with status 1: 'C:\Users\Admin\.zephyrtools\cmake\cmake-3.22.0-windows-x86_64\bin\cmake.EXE' --build 'C:\Users\Admin\new-tracker\nfed\samples\tracker\build' "

I just pushed the board overlays for the Sparkfun board. Looks like CONFIG_ADC wasn’t getting turned on. Should be fixed now.

6 days later

Hopefully it is okay to jump on this thread, I am trying to accomplish a similar task and thought that it might be best to stick it here instead of making a new discussions. I am working with the nRF9160 sparkfun thing plus and I have followed the guide to use the golioth cloud with the tracker but am having trouble when connecting. “golioth_system: failed to connect: -111” is what pops up in the LTE serial monitor.

Don’t know how to post an image of my monitor but here is the log ->
AT%CMNG=1
%CMNG: 0,6,“0606060606060606060606060606060606060606060606060606060606060606”
%CMNG: 1,3,“AA5C5F17C02F39239EFA917C017BFB5B5955617C8E82ACEA43C76CB279F09C80”
%CMNG: 1,4,“733A813C0250D06776CAD37EFF3EA2887AEAB67ED641E017F456E046031A270C”
%CMNG: 16842753,0,“2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1”
%CMNG: 16842753,1,“9A48076FEE19A25A14273FA076C2389888C11E1BB14154BD9E4CA7FCA9DE3EEA”
%CMNG: 16842753,2,“6A77AFEE5BBCBC17AA0CD5BC2650ADCCD74699FDCB6B28BD1299026FC174B68D”
%CMNG: 4294967293,10,“2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1”
%CMNG: 4294967294,6,“8EAF797C65D747AA0E021938E1CD38724ADF72CB8F9596B967A845CBA35A220D”
%CMNG: 4294967292,11,“2027C4699EAA90A414D33FA81B975C0FDEDEFB04A19CEA1ED43A8876CAD31E89”
OK

I initially was trying to setup with the nRF cloud but have been having trouble getting a device added so I swapped to trying with Golioth. I am unsure what I need to do for the next step because I thought I added the PSK and ID using the at_client sample but from what I am gathering here in this post is I might need to go add them to a file as well?

It is saying I have an ivalid PSK-ID and PSK, should I try to set them again? (I admit I have already tried once now). I made sure the PSK was hexadecimal and without a delimiter. I don’t have the SUPL prj.config set (still commented out).
I have tried adding CONFIG_GOLIOTH_SYSTEM_CLIENT_PSK= and CONFIG_GOLIOTH_SYSTEM_CLIENT_PSK_ID but no luck. It still says invalid PSK and PSK_ID
Here is what the tracker sample output is:

<inf> lis2dh: lis2dh@18: int1 on gpio@842500.29 <inf> lis2dh: lis2dh@18: int2 on gpio@842500.30
<inf> lis2dh: fs=2, odr=0×4 lp_en=0×8 scale=9576[0m
Booting Zephyr OS build v3.3.99-ncs1-1
<inf> battery: Setup AIN7 got 0 <inf> battery: Battery setup: 0 1
<inf> lis2dh: int2_ths=0×5f range_g=2 ums2=14709974
<inf> littlefs: LittleFS version 2.5, disk version 2.0[0m
<inf> littlefs: FS at w25q32jv@0:0×0 is 1024 0×1000-byte blocks with 512 cycle
<inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32[0m
<inf> nor_storage: bsize = 16 ; frsize = 4096 ; blocks = 1024 ; bfree = 1018
<inf> golioth_system: Initializing
<inf> app: Starting tracker on circuitdojo_feather_nrf9160!
<inf> modem: Sleep exit <inf> modem: Disconnected
<inf> modem: LTE cell changed: Cell ID: 82209551, Tracking area: 17923
<inf> app_event_manager: Evt: APP_EVENT_CELLULAR_DISCONNECT
<inf> modem: RRC mode: Connected
<inf> modem: Network registration status: Connected - roaming
<inf> app_event_manager: Evt: APP_EVENT_CELLULAR_CONNECTED
golioth_system: Configured PSK-ID is invalid
golioth_system: Configured PSK is invalid

<inf> golioth_system: Starting connect
<inf> modem: PSM parameter update: TAU: 600, Active time: 180[0m
<inf> modem: eDRX parameter update: eDRX: , PTW:
<inf> app: IMEI: 3513……………
golioth_system: Configured PSK-ID is invalid
golioth_system: Configured PSK is invalid
golioth_system: Failed to connect: -111
golioth_system: Failed to connect: -111

Hi there Jared, Sorry for the silence, Just got back from a last minute trip.

The sparkfun board builds now thank you.

apart from the fact it looks like i didn’t do the psk correctly, it seems to be failing to initialise the modem.

[00:00:00.255,218] <inf> lis2dh: lis2dh@18: int1 on gpio@842500.30
[00:00:00.255,310] <inf> lis2dh: lis2dh@18: int2 on gpio@842500.29
[00:00:00.257,629] <inf> lis2dh: fs=2, odr=0×4 lp_en=0×8 scale=9576
*** Booting Zephyr OS build v3.3.99-ncs1-1 ***
[00:00:00.258,300] <inf> battery: Setup AIN7 got 0
[00:00:00.258,331] <inf> battery: Battery setup: 0 1
[00:00:00.258,941] <inf> lis2dh: int2_ths=0×5f range_g=2 ums2=14709974
[00:00:00.260,437] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:00.261,413] <inf> littlefs: FS at w25q32jv@0:0×0 is 1024 0×1000-byte blocks with 512 cycle
[00:00:00.261,444] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.269,165] <inf> nor_storage: bsize = 16 ; frsize = 4096 ; blocks = 1024 ; bfree = 1018
[00:00:00.271,545] <inf> golioth_system: Initializing
[00:00:00.274,627] <inf> app: Starting tracker on sparkfun_thing_plus_nrf9160!
[00:00:00.465,087] <err> lte_lc: Could not send AT command, error: 65536
[00:00:00.465,148] <err> lte_lc: Could not set system mode, error: -14
LTE init failed. (err: -14)
[00:00:00.466,613] <err> lte_lc: The LTE link controller is not initialized
LTE connect failed. (err: -1)
[00:00:00.467,224] <inf> app: IMEI: <redacted>
[00:00:00.467,254] <wrn> golioth_system: Configured PSK-ID is invalid
[00:00:00.467,254] <wrn> golioth_system: Configured PSK is invalid
[00:00:00.467,407] <inf> golioth_system: Starting connect
[00:00:00.467,590] <err> app_gps: Failed to set GNSS use case
Unable to setup GPS. Err: -13
[00:00:00.468,627] <err> golioth: Fail to get address (coap.golioth.io 5684) -11
[00:00:00.468,688] <err> golioth_system: Failed to connect: -11
[00:00:00.468,688] <wrn> golioth_system: Failed to connect: -11
[00:00:05.468,841] <inf> golioth_system: Starting connect
[00:00:05.477,569] <err> golioth: Fail to get address (coap.golioth.io 5684) -11
[00:00:05.477,600] <err> golioth_system: Failed to connect: -11
[00:00:05.477,600] <wrn> golioth_system: Failed to connect: -11
[00:00:10.477,752] <inf> golioth_system: Starting connect

edit: scratch this. restarting LTE link monitor solved the AT Client issue

i’ll do some more playing around today but interesting the AT Client sample no longer works either.

it built and loaded fine but AT commands time out.

12:03:37.904 Error: ‘AT+CFUN=1 ’ timed out
12:03:39.075 Error: ‘AT ’ timed out
12:03:47.595 Error: ‘AT+CFUN? ’ timed out
12:03:52.303 Error: ‘AT+CFUN=1 ’ timed out
12:03:54.984 Error: ‘AT ’ timed out
12:04:02.576 Error: ‘AT+CFUN=1 ’ timed out
12:04:05.728 Error: ‘AT+CFUN? ’ timed out

Terms and Conditions | Privacy Policy