Asset Tracker V2, connecting problem to AWS Iot

Hello,

I am trying to connect asset_tracker_v2 to my aws iot cloud with MQTT,

then storing this data in aws database, when i changing parameters to AWS Iot library,

i have a fatal error, i am not understanding why ?

  • I am workin whit nRF9160, thingy:91 and nRF9160_DK
  • I use nRF Connect SDK V1.8.0 whit SEGGER embedded Studio
  • I have an alredy existing AWS account
  • I have downloaded certificate successfully to µc

That is my configuration:

And that is my log output when building and running:

2021-12-26T14:20:10.118Z INFO Application data folder: C:\Users\Portable\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
2021-12-26T14:20:10.209Z DEBUG App pc-nrfconnect-linkmonitor v2.0.0 official
2021-12-26T14:20:10.209Z DEBUG App path: C:\Users\Portable\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
2021-12-26T14:20:10.209Z DEBUG nRFConnect 3.9.1, required by the app is (^3.8.0)
2021-12-26T14:20:10.209Z DEBUG nRFConnect path: C:\Users\Portable\AppData\Local\Programs\nrfconnect\resources\app.asar
2021-12-26T14:20:10.209Z DEBUG HomeDir: C:\Users\Portable
2021-12-26T14:20:10.209Z DEBUG TmpDir: C:\Users\Portable\AppData\Local\Temp
2021-12-26T14:20:13.457Z INFO Modem port is opened
2021-12-26T14:20:13.471Z DEBUG modem >> AT+CFUN?
2021-12-26T14:20:29.013Z ERROR Opening COM8: Access denied
2021-12-26T14:20:32.530Z INFO Modem port is closed
2021-12-26T14:20:40.120Z INFO Modem port is opened
2021-12-26T14:20:40.128Z DEBUG modem >> AT+CFUN?
2021-12-26T14:20:41.311Z DEBUG modem << *** Booting Zephyr OS build v2.7.0-ncs1  ***
2021-12-26T14:20:41.340Z DEBUG modem << [00:00:00.223,297] [1;33m<wrn> at_notif: Already initialized. Nothing to do[0m
2021-12-26T14:20:41.342Z DEBUG modem << [00:00:00.230,377] [0m<inf> at_host: UART check failed: 13. Dropping buffer and retrying.[0m
2021-12-26T14:20:41.396Z DEBUG modem << [00:00:00.260,162] [0m<inf> event_manager: APP_EVT_START[0m
2021-12-26T14:20:41.398Z DEBUG modem << [00:00:00.281,066] [0m<inf> event_manager: DATA_EVT_CONFIG_INIT[0m
2021-12-26T14:20:41.400Z DEBUG modem << [00:00:00.287,597] [0m<inf> event_manager: APP_EVT_ACTIVITY_DETECTION_DISABLE[0m
2021-12-26T14:20:41.402Z DEBUG modem << [00:00:00.295,410] [0m<inf> event_manager: MODEM_EVT_INITIALIZED[0m
2021-12-26T14:20:41.541Z DEBUG modem << [00:00:00.310,821] [1;31m<err> aws_iot: Application subscription list count mismatch[0m
2021-12-26T14:20:41.544Z DEBUG modem << [00:00:00.318,634] [1;31m<err> aws_iot_integration: cloud_ep_subscriptions_add, error: -122[0m
2021-12-26T14:20:41.549Z DEBUG modem << [00:00:00.327,087] [1;31m<err> aws_iot_integration: populate_app_endpoint_topics, error: -122[0m
2021-12-26T14:20:41.554Z DEBUG modem << [00:00:00.335,754] [1;31m<err> cloud_module: cloud_wrap_init, error: -122[0m
2021-12-26T14:20:41.559Z DEBUG modem << ASSERTION FAIL [err == 0] @ ../src/modules/cloud_module.c:698
2021-12-26T14:20:41.564Z DEBUG modem << setp() failed
2021-12-26T14:20:41.569Z DEBUG modem << [00:00:00.349,487] [1;31m<err> os: r0/a1:  0x00000004  r1/a2:  0x000002ba  r2/a3:  0x00000001[0m
2021-12-26T14:20:41.574Z DEBUG modem << [00:00:00.358,123] [1;31m<err> os: r3/a4:  0x00026c11 r12/ip:  0x0000a000 r14/lr:  0x0001ca7d[0m
2021-12-26T14:20:41.579Z DEBUG modem << [00:00:00.366,760] [1;31m<err> os:  xpsr:  0x41000000[0m
2021-12-26T14:20:41.592Z DEBUG modem << [00:00:00.371,978] [1;31m<err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000[0m
2021-12-26T14:20:41.597Z DEBUG modem << [00:00:00.382,354] [1;31m<err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000[0m
2021-12-26T14:20:41.602Z DEBUG modem << [00:00:00.392,730] [1;31m<err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000002[0m
2021-12-26T14:20:41.605Z DEBUG modem << [00:00:00.403,106] [1;31m<err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000[0m
2021-12-26T14:20:41.607Z DEBUG modem << [00:00:00.413,452] [1;31m<err> os: fpscr:  0x3e2887a6[0m
2021-12-26T14:20:41.609Z DEBUG modem << [00:00:00.418,640] [1;31m<err> os: Faulting instruction address (r15/pc): 0x0003b4d8[0m
2021-12-26T14:20:41.611Z DEBUG modem << [00:00:00.426,513] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0[0m
2021-12-26T14:20:41.613Z DEBUG modem << [00:00:00.434,204] [1;31m<err> os: Current thread: 0x200151c8 (unknown)[0m

That is also my project:

asset_tracker_v2.rar

Thank you for your help

Minyaev

Parents
  • Hi,

    The assertion fail happens because you have told the application in the configuration options that you will not subscribe to any topics, while in the application you try to subscribe to some.

    The reason for this mismatch is probably that you didn't include the AWS Kconfig overlay file. See this part of the Asset tracker V2 documentation: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/asset_tracker_v2/doc/asset_tracker_v2_description.html#building-with-overlays 

    The overlay file you want to add is called 'overlay-aws.conf'.

    Best regards,

    Didrik

  • Hi,

    Yes it was done, but nothing has changed,

    That is my overlay file:

    #
    # 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
    CONFIG_AWS_FOTA=y
    
    # Options that must be configured in order to establish a connection.
    CONFIG_AWS_IOT_SEC_TAG=42
    CONFIG_AWS_IOT_BROKER_HOST_NAME="a1t6ipfx1jqfnp-ats.iot.us-west-2.amazonaws.com"
    
    # MQTT Transport library
    # Maximum specified MQTT keepalive timeout for AWS IoT is 1200 seconds.
    CONFIG_MQTT_KEEPALIVE=1200

    And that is my include configuration:

    Thank

    Minyaev

  • My appologies, it should be DOVERLAY_CONFIG, without the _ between D and OVERLAY.

    I'll edit my previous reply as well.

    Note that you will also need to set you AWS hostname in CONFIG_AWS_IOT_BROKER_HOST_NAME on line 18 in overlay-aws.conf.

  • hi, thank you that is better this time, i see the traces of AWS, but we have an other error:

    "aws_iot: mqtt_connect, error: -111"

    2021-12-27T16:44:02.528Z DEBUG modem << *** Booting Zephyr OS build v2.7.0-ncs1  ***
    2021-12-27T16:44:02.548Z DEBUG modem << I: Starting bootloader
    2021-12-27T16:44:02.550Z DEBUG modem << I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    2021-12-27T16:44:02.558Z DEBUG modem << I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    2021-12-27T16:44:02.561Z DEBUG modem << I: Boot source: none
    2021-12-27T16:44:02.563Z DEBUG modem << I: Swap type: none
    2021-12-27T16:44:02.637Z DEBUG modem << I: Bootloader chainload address offset: 0x10000
    2021-12-27T16:44:02.640Z DEBUG modem << I: Jumping to the first image slot
    2021-12-27T16:44:03.121Z DEBUG modem << *** Booting Zephyr OS build v2.7.0-ncs1  ***
    2021-12-27T16:44:03.138Z DEBUG modem << [00:00:00.205,993] [1;33m<wrn> at_notif: Already initialized. Nothing to do[0m
    2021-12-27T16:44:03.143Z DEBUG modem << [00:00:00.213,867] [0m<inf> event_manager: APP_EVT_START[0m
    2021-12-27T16:44:03.241Z DEBUG modem << [00:00:00.220,672] [0m<inf> event_manager: DATA_EVT_CONFIG_INIT[0m
    2021-12-27T16:44:03.244Z DEBUG modem << [00:00:00.227,416] [0m<inf> event_manager: APP_EVT_ACTIVITY_DETECTION_DISABLE[0m
    2021-12-27T16:44:03.247Z DEBUG modem << [00:00:00.235,443] [0m<inf> event_manager: MODEM_EVT_INITIALIZED[0m
    2021-12-27T16:44:03.250Z DEBUG modem << [00:00:00.318,267] [0m<inf> event_manager: MODEM_EVT_LTE_CONNECTING[0m
    2021-12-27T16:44:04.650Z DEBUG modem << %C[00:00:01.727,172] [0m<inf> event_manager: MODEM_EVT_LTE_DISCONNECTED[0m
    2021-12-27T16:44:04.673Z DEBUG modem << [00:00:01.734,466] [0m<inf> event_manager: MODEM_EVT_LTE_CELL_UPDATE[0m
    2021-12-27T16:44:04.676Z DEBUG modem << ESQ: 44,2,17,2
    2021-12-27T16:44:05.700Z DEBUG modem << [00:00:02.778,686] [0m<inf> event_manager: MODEM_EVT_LTE_CONNECTED[0m
    2021-12-27T16:44:05.722Z DEBUG modem << [00:00:02.785,736] [0m<inf> event_manager: MODEM_EVT_LTE_PSM_UPDATE[0m
    2021-12-27T16:44:05.726Z DEBUG modem << [00:00:02.793,273] [1;33m<wrn> cloud_module: Cloud connection establishment in progress[0m
    2021-12-27T16:44:05.731Z DEBUG modem << [00:00:02.801,513] [1;33m<wrn> cloud_module: New connection attempt in 32 seconds if not successful[0m
    2021-12-27T16:44:05.743Z DEBUG modem << [00:00:02.811,187] [0m<inf> event_manager: CLOUD_EVT_CONNECTING[0m
    2021-12-27T16:44:06.977Z DEBUG modem << [00:00:04.055,328] [1;31m<err> aws_iot: mqtt_connect, error: -111[0m
    2021-12-27T16:44:06.995Z DEBUG modem << [00:00:04.061,828] [0m<inf> event_manager: CLOUD_EVT_CONNECTING[0m

  • -111 ECONNREFUSED indicates that there is something wrong with the device's provisioning.

    Does it have the correct certificates, and are they in the correct sec_tag (the default in overlay-aws.conf is 42)?

  • Yes, you are right, the certificates were loaded incorrectly, i reloaded it, and i don't have the error, but an other probleme, no data in my aws, 

    i checked the log file, and i see: "cloud_module: Device configuration empty!"

    But my configuration is:

    i don't know what is missing,

    2021-12-29T08:24:20.790Z DEBUG modem << *** Booting Zephyr OS build v2.7.0-ncs1  ***
    2021-12-29T08:24:20.792Z DEBUG modem << I: Starting bootloader
    2021-12-29T08:24:20.793Z DEBUG modem << I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    2021-12-29T08:24:20.809Z DEBUG modem << I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    2021-12-29T08:24:20.813Z DEBUG modem << I: Boot source: none
    2021-12-29T08:24:20.816Z DEBUG modem << I: Swap type: none
    2021-12-29T08:24:20.888Z DEBUG modem << I: Bootloader chainload address offset: 0x10000
    2021-12-29T08:24:20.891Z DEBUG modem << I: Jumping to the first image slot
    2021-12-29T08:24:21.372Z DEBUG modem << *** Booting Zephyr OS build v2.7.0-ncs1  ***
    2021-12-29T08:24:21.407Z DEBUG modem << [00:00:00.205,993] [1;33m<wrn> at_notif: Already initialized. Nothing to do[0m
    2021-12-29T08:24:21.414Z DEBUG modem << [00:00:00.213,867] [0m<inf> event_manager: APP_EVT_START[0m
    2021-12-29T08:24:21.416Z DEBUG modem << [00:00:00.220,672] [0m<inf> event_manager: DATA_EVT_CONFIG_INIT[0m
    2021-12-29T08:24:21.419Z DEBUG modem << [00:00:00.227,416] [0m<inf> event_manager: APP_EVT_ACTIVITY_DETECTION_DISABLE[0m
    2021-12-29T08:24:21.444Z DEBUG modem << [00:00:00.235,443] [0m<inf> event_manager: MODEM_EVT_INITIALIZED[0m
    2021-12-29T08:24:21.497Z DEBUG modem << [00:00:00.324,127] [0m<inf> event_manager: MODEM_EVT_LTE_CONNECTING[0m
    2021-12-29T08:24:22.780Z DEBUG modem << %C[00:00:01.605,651] [0m<inf> event_manager: MODEM_EVT_LTE_DISCONNECTED[0m
    2021-12-29T08:24:22.787Z DEBUG modem << [00:00:01.612,945] [0m<inf> event_manager: MODEM_EVT_LTE_CELL_UPDATE[0m
    2021-12-29T08:24:22.825Z DEBUG modem << ESQ: 43,2,18,2
    2021-12-29T08:24:23.409Z DEBUG modem << %CESQ: 45,2,23,3
    2021-12-29T08:24:23.837Z DEBUG modem << [00:00:02.664,337] [0m<inf> event_manager: MODEM_EVT_LTE_CONNECTED[0m
    2021-12-29T08:24:23.849Z DEBUG modem << [00:00:02.671,478] [0m<inf> event_manager: MODEM_EVT_LTE_PSM_UPDATE[0m
    2021-12-29T08:24:23.853Z DEBUG modem << [00:00:02.678,955] [1;33m<wrn> cloud_module: Cloud connection establishment in progress[0m
    2021-12-29T08:24:23.866Z DEBUG modem << [00:00:02.687,225] [1;33m<wrn> cloud_module: New connection attempt in 32 seconds if not successful[0m
    2021-12-29T08:24:23.870Z DEBUG modem << [00:00:02.696,868] [0m<inf> event_manager: CLOUD_EVT_CONNECTING[0m
    2021-12-29T08:24:28.488Z DEBUG modem << [00:00:07.316,406] [0m<inf> event_manager: CLOUD_EVT_CONNECTED[0m
    2021-12-29T08:24:28.524Z DEBUG modem << [00:00:07.323,242] [0m<inf> event_manager: DATA_EVT_DATE_TIME_OBTAINED[0m
    2021-12-29T08:24:28.528Z DEBUG modem << [00:00:07.330,627] [0m<inf> event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, NEIGHBOR_CELLS, GNSS, MOD_STAT)[0m
    2021-12-29T08:24:28.532Z DEBUG modem << [00:00:07.349,945] [0m<inf> event_manager: GPS_EVT_ACTIVE[0m
    2021-12-29T08:24:28.537Z DEBUG modem << [00:00:07.356,628] [0m<inf> event_manager: GPS_EVT_AGPS_NEEDED[0m
    2021-12-29T08:24:28.578Z DEBUG modem << [00:00:07.363,769] [0m<inf> event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED[0m
    2021-12-29T08:24:28.642Z DEBUG modem << [00:00:07.468,933] [0m<inf> event_manager: DATA_EVT_AGPS_REQUEST_DATA_SEND[0m
    2021-12-29T08:24:28.652Z DEBUG modem << [00:00:07.477,844] [0m<inf> event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY[0m
    2021-12-29T08:24:28.663Z DEBUG modem << [00:00:07.486,267] [0m<inf> event_manager: CLOUD_EVT_DATA_ACK[0m
    2021-12-29T08:24:28.702Z DEBUG modem << [00:00:07.529,144] [0m<inf> event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY[0m
    2021-12-29T08:24:28.748Z DEBUG modem << [00:00:07.575,714] [0m<inf> event_manager: MODEM_EVT_BATTERY_DATA_READY[0m
    2021-12-29T08:24:28.760Z DEBUG modem << [00:00:07.585,296] [0m<inf> event_manager: MODEM_EVT_NEIGHBOR_CELLS_DATA_READY[0m
    2021-12-29T08:24:29.176Z DEBUG modem << [00:00:08.002,624] [1;33m<wrn> cloud_module: Device configuration empty![0m
    2021-12-29T08:24:29.197Z DEBUG modem << [00:00:08.009,735] [0m<inf> event_manager: CLOUD_EVT_CONFIG_EMPTY[0m
    2021-12-29T08:24:29.199Z DEBUG modem << [00:00:08.018,768] [0m<inf> event_manager: DATA_EVT_CONFIG_SEND[0m
    2021-12-29T08:24:29.202Z DEBUG modem << [00:00:08.027,252] [0m<inf> event_manager: CLOUD_EVT_DATA_ACK[0m
    2021-12-29T08:24:46.344Z DEBUG modem << %CESQ: 41,2,14,2
    2021-12-29T08:24:46.780Z DEBUG modem << %CESQ: 44,2,24,3
    2021-12-29T08:24:54.447Z DEBUG modem << %CESQ: 255,0,255,0
    2021-12-29T08:25:35.064Z DEBUG modem << [00:01:13.893,585] [0m<inf> event_manager: GPS_EVT_TIMEOUT[0m
    2021-12-29T08:25:35.076Z DEBUG modem << [00:01:13.899,810] [0m<inf> event_manager: GPS_EVT_INACTIVE[0m
    2021-12-29T08:25:35.086Z DEBUG modem << [00:01:13.906,738] [0m<inf> event_manager: DATA_EVT_DATA_READY[0m
    2021-12-29T08:25:35.091Z DEBUG modem << [00:01:13.916,870] [0m<inf> event_manager: DATA_EVT_NEIGHBOR_CELLS_DATA_SEND[0m
    2021-12-29T08:25:35.101Z DEBUG modem << [00:01:13.931,488] [0m<inf> event_manager: DATA_EVT_DATA_SEND[0m
    2021-12-29T08:25:35.142Z DEBUG modem << [00:01:13.973,144] [0m<inf> event_manager: CLOUD_EVT_DATA_ACK[0m
    2021-12-29T08:25:35.150Z DEBUG modem << [00:01:13.981,414] [0m<inf> event_manager: CLOUD_EVT_DATA_ACK[0m
    2021-12-29T08:25:35.184Z DEBUG modem << %CESQ: 41,2,16,2

  • Where do you look for the data?

    From the log, it looks like everything is okay.

Reply Children
Related