This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AWS IoT

Hi all,

I have an issue with integration of the AWS IoT in my source code. The example works for me. I've tried to copy&paste the example code to my project (I delete my main.c and use example code), but aws_iot_connect() resets the chip without any RTT output on the reason why the chip was reset. 

I remember there was some nrfjprog command to read the reset reason, but I'm unable to find that command at the moment. Does someone know what command it is? 

Also do you have some general ideas on why would aws_iot_connect() cause this behavior?

Cheers

Aleksa

Parents
  • Hi Aleksa,

    The application codes should not work if you only paste the codes in main.c to your project. The AWS IoT example is a whole solution based on NCS, not just codes in main.c. I suggest you adapt your project into the sample instead.

    You can find all nrfjprog commands from this page, just check which one you used before.

    Best regards,

    Charlie 

  • 0
    24 pts.
    in reply to Charlie

    Hi Charlie,

    I don't understand why wouldn't it work? My project and the AWS IoT example use the same NCS. The only reason to fail would have to be related to Kconfig. I've made sure that the configuration in my project is the same as the one in the example though (parts relevant to the AWS IoT). 

    I've searched all over nrfjprog documentation, and I wasn't able to find the specific command that I've mentioned in the post. It would literally print out a string explaining the cause of last reset.

    Best Regards,

    Aleksa 

  • 0
    207 pts.
    in reply to Aleksa

    Hi Aleksa,

    Ok, good to know your project is also based on NCS, what is the purpose of your project? Can you share a minimal sample of your codes that can recreate the issue? 

    Best regards,

    Charlie

  • 0
    24 pts.
    in reply to Charlie

    Hi Charlie,
    So I am using nrf9160dk board, with ncs1.6.1. In the samples/nrf9160/aws_iot there is an example for aws_iot which works for me. I've copied over the same main file to my project, and I've adjusted the config but the aws_iot didn't work anymore. 
    I've tested a bit, and found that it works when I set CONFIG_API_CLOUD=n. But I don't understand why this happens.

    Best Regards,

    Aleksa

Reply
  • 0
    24 pts.
    in reply to Charlie

    Hi Charlie,
    So I am using nrf9160dk board, with ncs1.6.1. In the samples/nrf9160/aws_iot there is an example for aws_iot which works for me. I've copied over the same main file to my project, and I've adjusted the config but the aws_iot didn't work anymore. 
    I've tested a bit, and found that it works when I set CONFIG_API_CLOUD=n. But I don't understand why this happens.

    Best Regards,

    Aleksa

Children
  • 0
    207 pts.
    in reply to Aleksa

    Hi Aleksa,

    Is CONFIG_API_CLOUD defined by yourself? I did not find it from any official NCS document and codes.

    Best regards,

    Charlie

  • 0
    24 pts.
    in reply to Charlie

    Hi Charlie,

    My bad, the define is: CONFIG_CLOUD_API.

    Best Regards,

    Aleksa

  • 0
    207 pts.
    in reply to Aleksa

    Hi Aleksa,

    I do not know why you need to enable it before, but for AWS IoT usage, this is not necessary and should not be enabled.

    Best regards,

    Charlie 

  • 0
    24 pts.
    in reply to Charlie

    Hi Charlie,

    As I've said it works when I disable this config, but here:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/aws_iot.html
    It's clearly stated that AWS IoT can work with this config enabled.

    Best Regards,

    Aleksa

  • 0
    24 pts.
    in reply to Aleksa

    I have another question (maybe I can open a ticket for it).

    I have connected to the aws mqtt broker from the aws mqtt test client, mqtt.fx app and from my device. 

    I have subscribed with the device to all of the default shadow topics available via config. I have also subscribed to the two default custom topic(my-custom-topic/example(2)). When I publish from either of the three clients that I use, aws iot test client and mqtt.fx receive the message if they are subscribed to a specific topic. 
    I was expecting same behavior for my nrf9160dk device - I expect "AWS_IOT_EVT_DATA_RECEIVED"  event to happen whenever I publish to a topic that nrf9160dk is subscribed to.

    However this event seems to happen randomly completely. (out of sync with my publishes)

    Any idea on what could cause this?

    Best Regards,

    Aleksa

Related