This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mqtt_simple connect to AWS

I have an AWS account and I am comfortable with the AWS IOT operation in general. I have used it in the past. I am trying to get the sample mqtt_simple to connect to AWS IOT and be able to send packets and receive packets to the nRF9160dk board.

 I am not sure how to set up mqtt_simple parameters? I have created a thing and certificates. I have named the thing "nrf-IMEI" as recommended so it has the board ID in it. All I want to do is to be able to publish a packet to a topic on my AWS account and receive a packet from a topic in my AWS account. I have done this several times in the past with other systems so I am comfortable with AWS IOT operations and formats. I just do not understand how to get mqtt_simple to publish from my board to AWS and subscribe to messages from AWS.

Is this the correct program to use. It seems like all the pieces are there I just do not know how to use them.

I appreciate any help you can give, This is an essential requirement of our production system. right now we are using the pre-production system with a modified version of asset_tracker to send sensor data to the nRF Connect site. We need to be able to send sensor data to our AWS site.

Parents
  • First thank you for all of your help so far. You have been great in getting mqtt_simple_aws working and talking to my AWS account. I did try the cloud_client example. The AWS is already set up with a thing and the certificates are loaded into the board that work for the mqtt_simple_aws example.

    I added the following plus the  other AWS CONFIGS as needed in the documentation.

    config CLOUD_BACKEND
    string "String that selects the cloud backend to be used"
    default "AWS_IOT"

    The program fails immediately with the following messages. It says it cannot find the AWS_IOT backend. What else am I missing. It must be something simple since it can not get past the first step. any suggestions as to what I am missing.

    *** Booting Zephyr OS build v2.1.99-ncs1 ***
    Cloud client has started
    ASSERTION FAIL [cloud_backend != ((void *)0)] @ ../src/main.c:140
    AWS_IOT backend not found
    E: r0/a1: 0x00000004 r1/a2: 0x0000008c r2/a3: 0x00000001
    E: r3/a4: 0x00024f04 r12/ip: 0x20020d2c r14/lr: 0x0000dec3
    E: xpsr: 0x41000000
    E: s[ 0]: 0x00000000 s[ 1]: 0x00000000 s[ 2]: 0x00000000 s[ 3]: 0x00000000
    E: s[ 4]: 0x00000000 s[ 5]: 0x00000000 s[ 6]: 0x00000000 s[ 7]: 0x00000000
    E: s[ 8]: 0x00000000 s[ 9]: 0x00000000 s[10]: 0x00000000 s[11]: 0x00000000
    E: s[12]: 0x00000000 s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00000000
    E: fpscr: 0x00000000
    E: Faulting instruction address (r15/pc): 0x000213e2
    E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
    E: Current thread: 0x200214b4 (unknown)
    E: Halting system

Reply
  • First thank you for all of your help so far. You have been great in getting mqtt_simple_aws working and talking to my AWS account. I did try the cloud_client example. The AWS is already set up with a thing and the certificates are loaded into the board that work for the mqtt_simple_aws example.

    I added the following plus the  other AWS CONFIGS as needed in the documentation.

    config CLOUD_BACKEND
    string "String that selects the cloud backend to be used"
    default "AWS_IOT"

    The program fails immediately with the following messages. It says it cannot find the AWS_IOT backend. What else am I missing. It must be something simple since it can not get past the first step. any suggestions as to what I am missing.

    *** Booting Zephyr OS build v2.1.99-ncs1 ***
    Cloud client has started
    ASSERTION FAIL [cloud_backend != ((void *)0)] @ ../src/main.c:140
    AWS_IOT backend not found
    E: r0/a1: 0x00000004 r1/a2: 0x0000008c r2/a3: 0x00000001
    E: r3/a4: 0x00024f04 r12/ip: 0x20020d2c r14/lr: 0x0000dec3
    E: xpsr: 0x41000000
    E: s[ 0]: 0x00000000 s[ 1]: 0x00000000 s[ 2]: 0x00000000 s[ 3]: 0x00000000
    E: s[ 4]: 0x00000000 s[ 5]: 0x00000000 s[ 6]: 0x00000000 s[ 7]: 0x00000000
    E: s[ 8]: 0x00000000 s[ 9]: 0x00000000 s[10]: 0x00000000 s[11]: 0x00000000
    E: s[12]: 0x00000000 s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00000000
    E: fpscr: 0x00000000
    E: Faulting instruction address (r15/pc): 0x000213e2
    E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
    E: Current thread: 0x200214b4 (unknown)
    E: Halting system

Children
No Data
Related