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
  • Martin

    I can not seem to be able to get the mqtt_simple to use the certificates.h file. I have set up AWS as suggested and I have changed the MQTT parameters but I can not get it to use the certificates.h file. I get a mqtt connect failure when I run the program.  I do not want to program the certificates into the modem itself since I only have a single board and that is running a modified asset_tracker that is working perfectly. I do not want to mess up the development program.

    What are the exact steps to set up the program to use the certificates.h file? is there something else I am missing or could try?

Reply
  • Martin

    I can not seem to be able to get the mqtt_simple to use the certificates.h file. I have set up AWS as suggested and I have changed the MQTT parameters but I can not get it to use the certificates.h file. I get a mqtt connect failure when I run the program.  I do not want to program the certificates into the modem itself since I only have a single board and that is running a modified asset_tracker that is working perfectly. I do not want to mess up the development program.

    What are the exact steps to set up the program to use the certificates.h file? is there something else I am missing or could try?

Children
  • Hi Timothy,

    The mqtt_simple is a very simple template just to connect to a general MQTT broker, to make it connect to AWS you need some modifications (I made a sample for you as reference, see the bottom of the post)

    The AWS_FOTA sample shows how to connect to a AWS MQTT broker with FOTA support as described in the doc. (you also see the certificates.h file and how it's provisioned).


    However, I have made a sample for you that should get you connected to your AWS account. 

    Change the lines in the prj.conf file to suit your settings, and add your certificates in the certificates.h file before building the sample.


    Best regards,

    Martin L.

Related