AWS_IoT sample app for nRF9161 is not working

After more than a week of trying different options, settings and changes my AWS_IoT app for nRF9161 is not working.
All I get on Serial monitor is this:

*** Booting My Application v2.1.0-dev-4594a8693738 ***
*** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
[00:00:00.251,617] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
[00:00:00.251,647] <inf> aws_iot_sample: Bringing network interface up and connecting to the network

I've added my AWS cridentials, which are working on another Tiny GSM Modem project.
From a number of dicussions and references, I've added all these additional options in prj.conf with no success.

community.circuitdojo.com/.../4

-------(prj.conf)-------

# General
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_HW_ID_LIBRARY=y
CONFIG_ASSERT=y
CONFIG_JSON_LIBRARY=y
CONFIG_REBOOT=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
# CONFIG_NET_IPV4=y
CONFIG_NET_CONNECTION_MANAGER=y

# CONFIG_CLOUD_API=y

# AWS IoT library
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="MyIoTDevice"
CONFIG_AWS_IOT_BROKER_HOST_NAME="xxxxxxxxxxxxxx-ats.iot.eu-west-2.amazonaws.com"
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
# CONFIG_AWS_IOT_SEC_TAG="12345"

# Modem and PDN Configuration
CONFIG_LTE_LINK_CONTROL=y
CONFIG_PDN=y
CONFIG_PDN_DEFAULT_APN="internet"
# CONFIG_LTE_NETWORK_APN="internet"
# CONFIG_PDN_DEFAULT_APN="nbiot.vodacom.za"
# CONFIG_PDN_DEFAULT_APN="lpwa.vodafone.iot"

# Logging
CONFIG_LOG=y
#CONFIG_LOG_MODE_IMMEDIATE=y
#CONFIG_LOG_LEVEL_DBG=y
CONFIG_LOG_DEFAULT_LEVEL=3

# MQTT helper library
CONFIG_MQTT_HELPER=y
CONFIG_MQTT_HELPER_SEC_TAG=201
CONFIG_MQTT_HELPER_LAST_WILL=y
CONFIG_MQTT_HELPER_STACK_SIZE=4096

# LTE Link Controller
# Enable LTE Link Control
CONFIG_LTE_LINK_CONTROL=y
# CONFIG_LTE_AUTO_INIT_AND_CONNECT=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y

CONFIG_NRF_MODEM_LIB=y

# MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
CONFIG_MQTT_KEEPALIVE=1200
CONFIG_MQTT_CLEAN_SESSION=y

# community.circuitdojo.com/.../4
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_IMG_MANAGER=y

CONFIG_IMG_ERASE_PROGRESSIVELY=y

-------(main.c)-------
#define MY_CUSTOM_TOPIC_1 "esp/txn"
#define MY_CUSTOM_TOPIC_2 "esp/IoTMsg"

#define MQTT_BROKER_URL "xxxxxxxxxxxxxx-ats.iot.eu-west-2.amazonaws.com"
#define MQTT_BROKER_PORT 8883
#define MQTT_CLIENT_ID "MyIoTDevice"
#define MQTT_USERNAME NULL
#define MQTT_PASSWORD NULL


Please let me know what I'm doing wrong.. why can't I get the sample project up and running.

Parents Reply Children
  • Hi Don,

    Can you provide information how you added the credential to your nrf9161-dk board? Which guide did you follow?

    Best regards,
    Dejan


  • I followed the basic examples: I can successfully build and update a Blink app.
    Also programmed "Serial LTE Modem" app using Quick Start using nRF Connect for Desktop.

    I looked at some online info on nRF Connect SDK:
    docs.nordicsemi.com/.../index.html
    Lessons 1 - 5: academy.nordicsemi.com/.../
    www.youtube.com/watch


    The very first problem is that I can't even compile aws-iot sample app out the box.
    I create a new application - Copy sample - Filter nRF9161 DK Non Secure - AWS IoT Sample -> c:\nordic\myApps\aws_iot
    Add Build Configuration - Board Target: nrf9161dk../ns
    Add Configuration File - prj.conf
    Build Configuration

    It compiles with error:
    pp.a(main.c.obj): in function `on_aws_iot_evt_connected':
    C:/nordic/myApps/aws_iot/src/main.c:200: undefined reference to `boot_write_img_confirmed'

    A Solution that helped: community.circuitdojo.com/.../4
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_MANAGER=y


    I've added certificates to directory: C:\nordic\myApps\aws_iot\certs
    and updated prj.conf and main.c as per my previous email.


    I've tried to use Certificate Manager, but I'm not sure if that's the right route.

    I've also searched and found this info:
    devzone.nordicsemi.com/.../connecting-an-nrf9160-to-aws
    jimmywongiot.com/.../

  • Hi,

    Setup section of the AWS IoT sample provides information on how to set up AWS and configure permissions. This is required if you want to use AWS IoT Core. You would also need to set up AWS account. Have you performed all mentioned steps?

    DonP said:

    The very first problem is that I can't even compile aws-iot sample app out the box.
    I create a new application - Copy sample - Filter nRF9161 DK Non Secure - AWS IoT Sample -> c:\nordic\myApps\aws_iot
    Add Build Configuration - Board Target: nrf9161dk../ns
    Add Configuration File - prj.conf
    Build Configuration

    It compiles with error:
    pp.a(main.c.obj): in function `on_aws_iot_evt_connected':
    C:/nordic/myApps/aws_iot/src/main.c:200: undefined reference to `boot_write_img_confirmed'

    A Solution that helped: community.circuitdojo.com/.../4
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_MANAGER=y

    Are you able to successfully build your project by adding 4 mentioned Kconfig options to your project configurataion?

    Best regards,
    Dejan

  • Hi Dejans,

    Thank you for the pointers, I've follwed these steps (generated new certificates, created a new thing), but still no aws connection..

    "4. Select a security tag that is not yet in use.... "
    Q: How can I tell whether a tag is in use or not?

    PS C:\nordic\myApps\at_client> nrfcredstore COM46 list
    Secure tag     Key type                              SHA
    24                   ROOT_CA_CERT               AE106824...........
    42                   ROOT_CA_CERT               960D85D6...........
    16842753       ROOT_CA_CERT               67AA1646...........
    16842753       CLIENT_CERT                    D3EC5AB1...........
    16842753       CLIENT_KEY                       EB05280A...........
    4294967292   NORDIC_PUB_KEY            672E2F05...........
    4294967293   NORDIC_ID_ROOT_CA      2C43952E...........
    4294967294   DEV_ID_PUB_KEY             908D98D2...........


    Yes, I do have an AWS account and many other projects working with it.
    Yes, I've added these 4 CONFIG_* lines in proj.conf and it is now compiling.

    I think the first problem is that it is not connecting to the cellphone network.
    How can I check this (Cellular monitor is not working, because Trace is not enabled).
    Where do I setup my APN. Are there other service provider cridentials I need to confirm?

  • Hi,

    DonP said:
    "4. Select a security tag that is not yet in use.... "
    Q: How can I tell whether a tag is in use or not?

    This might mean that you need to select sec_tag which is not in your current list. You can also use %CMNG command for credentials storage management if you want to write, read, delete and check for existence of keys and certificates. Information about security tags can be found on the TLS/DTLS webpage.

    DonP said:
    I think the first problem is that it is not connecting to the cellphone network.

    AT+CEREG command can be useful if you suspect network registration issues. You can find example here. You can also use AT+CSCON for signaling connection status notification.

    DonP said:
    Where do I setup my APN. Are there other service provider cridentials I need to confirm?

    For setting APN manually, you can use CONFIG_PDN_DEFAULT_APN option. The example is given in optional library configuration of the asset_tracker_v2 sample. You can set the status and enable/disable APN using AT command %XAPNSTATUS.

    Best regards,
    Dejan

Related