aws configuration asset tracker v2

Hi All!

I am using nrf9160dk with ncs 2.4.0  and asset tracker v2 example . I was testing with NRF cloud it was working well as it is enabled by default.

Now the issue is that I am trying to enable the AWS in asset tracker V2

But I am getting some errors while compiling.

proj.conf 

#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_FPU=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=47250
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_HW_STACK_PROTECTION=y
# Increase AT monitor heap size to be able to fit both neighbor cell measurement
# and other AT notifications that may come in rapid succession.
CONFIG_AT_MONITOR_HEAP_SIZE=1024

# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y

# nRF modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y

# AT Host library - Used to send AT commands directy from an UART terminal and to allow
#		    integration with nRF Connect for Desktop LTE Link monitor application.
CONFIG_AT_HOST_LIBRARY=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y

# LTE link control
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
## Power saving timers.
### 320 hours PSM.
CONFIG_LTE_PSM_REQ=y
CONFIG_LTE_PSM_REQ_RPTAU="11000001"
### 20 seconds active time.
CONFIG_LTE_PSM_REQ_RAT="00001010"

# Settings - Used to store real-time device configuration to flash.
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# FOTA
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128

# Flash - Used in FOTA, settings and storage for P-GPS.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_SECURE_BOOT=y
CONFIG_BUILD_S1_VARIANT=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=y

# Application Event Manager
CONFIG_APP_EVENT_MANAGER=y
CONFIG_APP_EVENT_MANAGER_LOG_EVENT_TYPE=n

# cJSON - Used in cloud data encoding.
CONFIG_CJSON_LIB=y

# CAF - Common Application Framework
CONFIG_CAF=y
CONFIG_LED=y
CONFIG_CAF_LEDS=y
CONFIG_CAF_INIT_LOG_LED_READY_EVENTS=n
CONFIG_CAF_INIT_LOG_LED_EVENTS=n
CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n

# Location related configuration
CONFIG_LOCATION=y
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_GNSS=y
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_CELLULAR=y
CONFIG_LOCATION_REQUEST_DEFAULT_GNSS_TIMEOUT=90000
CONFIG_LOCATION_REQUEST_DEFAULT_CELLULAR_TIMEOUT=11000
CONFIG_LOCATION_DATA_DETAILS=y
CONFIG_LOCATION_LOG_LEVEL_WRN=y



# Default cloud transport service
#CONFIG_NRF_CLOUD_MQTT=y
CONFIG_HW_ID_LIBRARY=y
CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_BROKER_HOST_NAME="aXXXXXXX0axlqin-ats.iot.us-east-2.amazonaws.com"
CONFIG_AWS_IOT_CLIENT_ID_STATIC="3515161798XXXXX"  #"nrf9160"

#CONFIG_MQTT_HELPER=#y
#CONFIG_MQTT_HELPER_SEC_TAG=42

and overlay-aws.conf

#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=3
CONFIG_AWS_IOT_CLIENT_ID_APP=y

# Options that must be configured in order to establish a connection.
CONFIG_AWS_IOT_SEC_TAG=42
#CONFIG_AWS_IOT_BROKER_HOST_NAME=""
CONFIG_AWS_IOT_BROKER_HOST_NAME="aXXXXXXXlqin-ats.iot.us-east-2.amazonaws.com"

# MQTT Transport library
# Maximum specified MQTT keepalive timeout for AWS IoT is 1200 seconds.
CONFIG_MQTT_KEEPALIVE=1200

cmakelist.txt

#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(asset_tracker_v2_aws)
zephyr_compile_definitions(PROJECT_NAME=${PROJECT_NAME})

# NORDIC SDK APP START
target_sources(app PRIVATE src/main.c)
# NORDIC SDK APP END

# Include source directory
target_include_directories(app PRIVATE src)
target_include_directories(app PRIVATE include/${BOARD}/)
zephyr_include_directories_ifdef(CONFIG_MEMFAULT configuration/memfault)

# Application directories
add_subdirectory(src/modules)
add_subdirectory(src/events)

add_subdirectory_ifdef(CONFIG_CLOUD_MODULE src/cloud)
add_subdirectory_ifdef(CONFIG_SENSOR_MODULE src/ext_sensors)
add_subdirectory_ifdef(CONFIG_WATCHDOG_APPLICATION src/watchdog)


# Include nRF modem library header file for PC builds.
# These are used throughout the application in type definitions.
if (CONFIG_BOARD_QEMU_X86 OR CONFIG_BOARD_NATIVE_POSIX)
        target_include_directories(app PRIVATE ${NRFXLIB_DIR}/nrf_modem/include/)

        # Make folder containing certificates global so that it can be located by the configured
        # cloud library.
        zephyr_include_directories(src/cloud-certs)

        target_compile_options(app PRIVATE
	        -DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10)
endif()

Errors are

[0/309] Performing build step for 'mcuboot_subimage'
ninja: no work to do.
[1/299] Performing build step for 'b0_subimage'
ninja: no work to do.
[2/296] Performing build step for 's1_image_subimage'
ninja: no work to do.
[3/294] Performing build step for 'tfm'
ninja: no work to do.
[5/291] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj 
C:\ncs\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DAPP_VERSION=v2.4.0 -DEXT_API_MAGIC=0x281ee6de,0xb845acea,23298 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,23298 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPROJECT_NAME=asset_tracker_v2_aws -DUSE_PARTITION_MANAGER=1 -DVALIDATION_INFO_MAGIC=0x281ee6de,0x86518483,88834 -DVALIDATION_POINTER_MAGIC=0x281ee6de,0x6919b47e,88834 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.4.0/zephyr/kernel/include -IC:/ncs/v2.4.0/zephyr/arch/arm/include -Itfm/install/interface/include -IC:/ncs/v2.4.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/nrf91 -IC:/ncs/v2.4.0/zephyr/lib/libc/newlib/include -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.4.0/zephyr/subsys/net/lib/sockets/. -IC:/ncs/v2.4.0/zephyr/subsys/settings/include -IC:/ncs/v2.4.0/nrf/include -IC:/ncs/v2.4.0/nrf/lib/at_cmd_parser/include -IC:/ncs/v2.4.0/nrf/subsys/net/lib/nrf_cloud/./include -IC:/ncs/v2.4.0/nrf/subsys/net/lib/fota_download/./include -IC:/ncs/v2.4.0/zephyr/../nrf/subsys/dfu/include -IC:/ncs/v2.4.0/nrf/subsys/net/lib/aws_fota/./include -IC:/ncs/v2.4.0/nrf/subsys/app_event_manager/. -IC:/ncs/v2.4.0/nrf/subsys/app_event_manager_profiler_tracer/. -IC:/ncs/v2.4.0/nrf/include/tfm -IC:/ncs/v2.4.0/nrf/tests/include -Itfm/generated/interface/include -IC:/ncs/v2.4.0/modules/lib/cjson -IC:/ncs/v2.4.0/nrf/modules/cjson/include -IC:/ncs/v2.4.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.4.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.4.0/nrfxlib/nrf_modem/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -IC:/ncs/v2.4.0/nrfxlib/nrf_security/include -IC:/ncs/v2.4.0/nrfxlib/nrf_security/../crypto/nrf_oberon/core/include -IC:/ncs/v2.4.0/nrfxlib/nrf_security/../crypto/nrf_oberon/core/library -IC:/ncs/v2.4.0/modules/crypto/mbedtls/include -IC:/ncs/v2.4.0/modules/crypto/mbedtls/library -IC:/ncs/v2.4.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.4.0/nrfxlib/crypto/nrf_oberon/include -IC:/ncs/v2.4.0/bootloader/mcuboot/boot/bootutil/zephyr/.. -IC:/ncs/v2.4.0/bootloader/mcuboot/boot/bootutil/zephyr/../include -IC:/ncs/v2.4.0/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -fno-strict-aliasing -Os -imacros C:/Nordic_apps/myapps/asset_tracker_v2_aws/build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard --sysroot=C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.4.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Nordic_apps/myapps/asset_tracker_v2_aws=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.4.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.4.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -D_POSIX_THREADS -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -MF zephyr\CMakeFiles\zephyr.dir\misc\generated\configs.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -c zephyr/misc/generated/configs.c
C:\Users\Muhammad\AppData\Local\Temp\ccjrvjel.s: Assembler messages:
C:\Users\Muhammad\AppData\Local\Temp\ccjrvjel.s:1491: Error: missing expression
[14/291] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\31f4403e35\opt\bin\cmake.EXE' --build 'c:\Nordic_apps\myapps\asset_tracker_v2_aws\build'

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Can you please help me in this regard where is the issue?

I followed the following 

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/asset_tracker_v2/doc/asset_tracker_v2_description.html#cloud-setup

Thanks & Regards,

Muhammad Usman

Parents
  • Hi,

    Which toolchain do you have as the active toolchain (I assume you are using VS Code to build?)?

    Could you make sure you are using the v2.4.0 toolchain?

    Best regards,

    Didrik

  • Hi

    Thanks ! yes! 

    I am using ncs 2.4.0

    issue resolved by adding the following lines in prj. conf files

    CONFIG_AWS_IOT=y
    #CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=3
    CONFIG_AWS_IOT_CLIENT_ID_APP=y
    
    # Options that must be configured in order to establish a connection.
    CONFIG_AWS_IOT_SEC_TAG=42
    #CONFIG_AWS_IOT_BROKER_HOST_NAME=""
    CONFIG_AWS_IOT_BROKER_HOST_NAME="a30695n0axlqin-ats.iot.us-east-2.amazonaws.com"
    
    # MQTT Transport library
    # Maximum specified MQTT keepalive timeout for AWS IoT is 1200 seconds.
    CONFIG_MQTT_KEEPALIVE=1200
    Now it compiles fine!
    Is that ok?
    Now question is how to update the aws certificates using LTE link monitor can you please share me the link regarding that?
    Thanks & Regards,
    Muhammad Usman
Reply
  • Hi

    Thanks ! yes! 

    I am using ncs 2.4.0

    issue resolved by adding the following lines in prj. conf files

    CONFIG_AWS_IOT=y
    #CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=3
    CONFIG_AWS_IOT_CLIENT_ID_APP=y
    
    # Options that must be configured in order to establish a connection.
    CONFIG_AWS_IOT_SEC_TAG=42
    #CONFIG_AWS_IOT_BROKER_HOST_NAME=""
    CONFIG_AWS_IOT_BROKER_HOST_NAME="a30695n0axlqin-ats.iot.us-east-2.amazonaws.com"
    
    # MQTT Transport library
    # Maximum specified MQTT keepalive timeout for AWS IoT is 1200 seconds.
    CONFIG_MQTT_KEEPALIVE=1200
    Now it compiles fine!
    Is that ok?
    Now question is how to update the aws certificates using LTE link monitor can you please share me the link regarding that?
    Thanks & Regards,
    Muhammad Usman
Children
Related