Giter Club home page Giter Club logo

asset-tracker-cloud-firmware-aws's Introduction

nRF Asset Tracker for AWS firmware

Build and Release @commitlint/config-conventional Nordic ClangFormat Zephyr compliance

This repository maintains an out-of-tree copy of the Asset Tracker v2 application to show how to use open-source tools for automating the creation of building HEX files, and continuously integrating the firmware against the cloud implementation of the nRF Asset Tracker for AWS.

The copy is regularly updated from source and kept in sync with the NCS release branches.

Memfault integration

Symbol files can be automatically uploaded to Memfault, so core dumps can be parsed.

In order for the GitHub action to upload the .elf file on every build, additional secrets need to be configured.

MEMFAULT_ORGANIZATION_TOKEN: the organization auth token can be accessed and managed by Administrators at Admin → Organization Auth Tokens in the Memfault UI.

MEMFAULT_ORGANIZATION_SLUG, MEMFAULT_PROJECT_SLUG, and MEMFAULT_PROJECT_KEY: You can retrieve the project settings from the settings page of the Memfault dashboard of your organization.

You can set the secrets through the GitHub UI.

Alternatively you can use the GitHub CLI:

gh secret set -a actions MEMFAULT_ORGANIZATION_TOKEN --body <your memfault project key>
gh secret set -a actions MEMFAULT_ORGANIZATION_SLUG --body <your organization slug>
gh secret set -a actions MEMFAULT_PROJECT_SLUG --body <your project slug>
gh secret set -a actions MEMFAULT_PROJECT_KEY --body <your project key>

ℹ️ Read the complete nRF Asset Tracker documentation.

asset-tracker-cloud-firmware-aws's People

Contributors

coderbyheart avatar gregersrygg avatar lenakh97 avatar renovate-bot avatar renovate[bot] avatar simensrostad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asset-tracker-cloud-firmware-aws's Issues

Increased latency with concurrent GPS + modem operation in nrf thingy91 due to switching multiplexing

We are seeing issue with concurrent GPS + modem operation (increased latency) in nrf thingy91 due to switching multiplexing.
It was mentioned in the following repo that future modem firmware will allow both modes to be active simultaneously.
Is the new modem firmware available with this feature?

https://github.com/ExploratoryEngineering/nrf9160-gps/tree/master
The nRF9160 shares a single radio for GPS and LTE, and the current modem firmware (0.7.0-29.alpha) only allows one to be active at a time. We therefore have to switch back and forth between these modes in order to collect GPS data and send it. This switching introduces a delay which we minimize by buffering position data and sending it in batches. A future modem firmware will allow both modes to be active simultaneously, which will enable streaming of location data.

Use new location module configuration settings

Currently the tests fail because of this error:

   ❌  "shadow.state.reported" should match this JSON
   Expected: {"dev":{"v":{"modV":"mfw_nrf9160_1.3.1","brdV":"nrf9160dk_nrf9160","appV":"dd87ff9ef5fc1a58bc8d875dabc0184ae552503b-nrf9160dk_nrf9160_ns-d50e8503-e251-4642-957c-2c101df19959-upgraded"}},"cfg":{"gnsst":30,"act":true,"actwt":120,"mvres":120,"mvt":3600,"accath":10,"accith":5,"accito":60,"nod":[]}}
   Actual:   {"cfg":{"act":true,"loct":300,"actwt":120,"mvres":120,"mvt":3600,"accath":4,"accith":4,"accito":60,"nod":[]},"dev":{"v":{"imei":"352656109480916","iccid":"8931080520035849049","modV":"mfw_nrf9160_1.3.1","brdV":"nrf9160dk_nrf9160","appV":"dd87ff9ef5fc1a58bc8d875dabc0184ae552503b-nrf9160dk_nrf9160_ns-d50e8503-e251-4642-957c-2c101df19959-upgraded"},"ts":1669247120405},"roam":{"v":{"band":20,"nw":"LTE-M","rsrp":-98,"area":30401,"mccmnc":24201,"cell":21679616,"ip":"10.160.108.21"},"ts":1669247120775},"bat":{"v":5039,"ts":1669247120807}}

Fixed via NordicSemiconductor/asset-tracker-cloud-docs#568

Run unit tests in QEMU

To run in a sim you need to build using zephyr_sdk. https://github.com/zephyrproject-rtos/sdk-ng/releases
You must also set the zephyr toolchain and installation directory. I usually use an alias to swap to the z-sdk whenever I want to build and run in a simulator.

zephyr_sdk='export ZEPHYR_TOOLCHAIN_VARIANT=zephyr && export ZEPHYR_SDK_INSTALL_DIR=~/zephyr-sdk-0.12.3/'

To build the sample for any of the supported platforms:

west build -b qemu_x86
west build -b qemu_cortex_m3
west build -b native_posix

And to run the code run this command:

west build -t run

Depends on nrfconnect/sdk-nrf#4173

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/build-and-release.yaml
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/download-artifact v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/download-artifact v4
  • actions/setup-node v4
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-check_compliance.yaml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/checkout v4
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-clang-format.yaml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/sync-issue-labels.yaml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/update-from-ncs.yaml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • peter-evans/repository-dispatch v3
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/update-repo-info.yaml
  • actions/checkout v4
  • ubuntu 22.04
npm
package.json
  • @bifravst/prettier-config 1.0.0
  • @commitlint/config-conventional 19.1.0
  • husky 9.0.11
  • js-yaml 4.1.0
  • node >=20
  • npm >=9

  • Check this box to trigger a request for Renovate to run again on this repository

Boot loop with latest version

Steps to reproduce

Build

cd /tmp
git clone https://github.com/NordicSemiconductor/asset-tracker-cloud-firmware-aws
cd asset-tracker-cloud-firmware-aws
echo 'CONFIG_ASSET_TRACKER_V2_APP_VERSION="b8cd361071f3fc41a046e8c2cdf9e933fd3d4a7f-nrf9160dk_nrf9160_ns-a927d4af-51ee-461f-8a7e-a817adb021a2-original"' > firmware.conf
echo 'CONFIG_AWS_IOT_BROKER_HOST_NAME="a3nkol2gd45hn0-ats.iot.eu-west-1.amazonaws.com"' >> firmware.conf
echo 'CONFIG_CLOUD_CLIENT_ID_USE_CUSTOM=y' >> firmware.conf
echo 'CONFIG_AWS_IOT_CLIENT_ID_MAX_LEN=40' >> firmware.conf
echo 'CONFIG_CLOUD_CLIENT_ID="a927d4af-51ee-461f-8a7e-a817adb021a2"' >> firmware.conf
docker pull nordicplayground/nrfconnect-sdk:main
docker run --rm -v ${PWD}:/workdir/project/firmware nordicplayground/nrfconnect-sdk:main /bin/bash -c 'cd /workdir/project/firmware && west init -l && west update --narrow -o=--depth=1 && west build -p always -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG="overlay-aws.conf;overlay-pgps.conf;overlay-debug.conf;asset-tracker-cloud-firmware-aws.conf;firmware.conf" -DEXTRA_CFLAGS="-Werror=format-truncation"'

Flash to 9160 DK

nrfjprog --program build/zephyr/merged.hex firmware.hex --chiperase --verify --log -f nrf91  -r

Observe

minicom --8bit -b 115200 -D /dev/ttyACM0

Result

*** Booting Zephyr OS build d4b8ac4db1ed  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build d4b8ac4db1ed  ***
*** Booting Zephyr OS build d4b8ac4db1ed  ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x48...38
Firmware signature verified.
Firmware version 1
*** Booting Zephyr OS build d4b8ac4db1ed  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build d4b8ac4db1ed  ***
*** Booting Zephyr OS build d4b8ac4db1ed  ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x48...38
Firmware signature verified.
Firmware version 1

Upstream changes change default cloud to nRF Cloud

v1.2.15 introduced a new backend for nRF Connect for Cloud and made it the default backend.

The current release no longer work with AWS:

[00:00:00.732,513] <dbg> nrf_cloud_integration.cloud_wrap_init: ********************************************
[00:00:00.742,614] <dbg> nrf_cloud_integration.cloud_wrap_init:  The Asset Tracker v2 has started
[00:00:00.751,770] <dbg> nrf_cloud_integration.cloud_wrap_init:  Version:     1.2.16-thingy91_nrf9160ns-ltem-debug
[00:00:00.762,420] <dbg> nrf_cloud_integration.cloud_wrap_init:  Cloud:       nRF Cloud
[00:00:00.770,721] <dbg> nrf_cloud_integration.cloud_wrap_init:  Endpoint:    xxx-ats.iot.us-east-1.amazm
[00:00:00.782,226] <dbg> nrf_cloud_integration.cloud_wrap_init: ********************************************

Use a custom MCUBoot key when building firmware images

CMake Warning at /workdir/ncs/nrf/cmake/mcuboot.cmake:115 (message):
  

        ---------------------------------------------------------
        --- WARNING: Using default MCUBoot key, it should not ---
        --- be used for production.                           ---
        ---------------------------------------------------------

See https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/mcuboot/encrypted_images.html
and https://devzone.nordicsemi.com/f/nordic-q-a/88416/mcuboot-sign-the-firmware

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.