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 application on Thing:91

Hello

 

I am getting started with Nordic devices.

 

I recently bought a Thingy:91 and followed a tutorial to load the Asset Tracker application on to the device – this was successful.

 

I then started on the AWS IoT example.

On Amazon’s AWS site, I registered my Thingy as a ‘thing’, and created a policy and then created a certificate.

I then attempted to write these certificates to the Thingy device using the Certificate Manager in the LTE Link Monitor v2.0.0

When I selected “Update certificates”, I got something like this, where all the x’s represent the actual certificate:

 

20:39:45.053  Updating CA certificate...

20:39:45.526  Error: AT%CMNG=0,16842753,0,"-----BEGIN CERTIFICATE----- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

-----END CERTIFICATE-----" failed: Unknown error code

20:39:45.526  Certificate update completed

 

I have a few questions:

 

ONE

When I created a certificate on AWS, it generated the following:

  • Device Certificate – xxxxx-certificate.pem.crt
  • Public Key – xxxxx-public.pem.key
  • Private Key – xxxxx-provate.pem.key
  • Two CA Certificates - AmazonRootCA1.pem and AmazonRootCA3.pem

In LTE Link Monitor v2.0.0’s Certificate Manager, the fields to enter are:

  • CA certificate
  • Client certificate
  • Private key
  • Pre-shared key
  • PSK identity

QUESITON 1:

Which of the files I downloaded from AWS match which fields in the Certificate Manager?

 

TWO

To enter a key or certificate in to one of the fields, I opened the downloaded file in notepad, and copied the contents, which look something like this:

-----BEGIN CERTIFICATE-----

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

       :

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

-----END CERTIFICATE-----

Where the x’s represent the actual certificate

QUESTION 2:

Is this the correct way to copy the certificates / keys?

 

THREE

The AWS IoT instructions that I am following are here:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/libraries/networking/aws_iot.html#set-up-conn-to-iot

One of the steps states:

Build and program the nRF9160: AT Client sample to the nRF9160-based kit as explained in Building and programming an application.

I originally tried to do this.

On the first attempt, I opened the AT Client project in VS Code and compiled it, but VS Code won’t detect my Thingy (even though it will detect an nRF52 dev board that I have).

So I then tried to use the Programmer in nRF Connect Desktop to load the AT Client hex file on to Thingy

The only two hex files to choose from in this project were

  • ..\build\zephyr\merged.hex
  • ..\build\zephyr\zephyr.hex

I tried flashing each of these in turn. In both cases, I was able to flash the hex file, but in both cases I could not sent any AT commands – I kept getting a time out error, regardless of which COM port I used

So I flashed back the Asset Tracker project, knowing that this would allow me to use AT commands anyway

QUESTION 3

Should I be able to use AT commands to update certificate on the Thingy, when I have loaded the Asset Tracker application?

 

Any help / suggestions greatly appreciated

Garrett

Parents
  • Hi,

    QUESITON 1:

    Which of the files I downloaded from AWS match which fields in the Certificate Manager?

    Private key = xxx-private.key.pem

    Client certificate = xxx-certificate.pem.crt

    CA certificate = Both should probably work, but I have used AmazonRootCA.pem

    QUESTION 2:

    Is this the correct way to copy the certificates / keys?

    Yes, that looks correct. Just make sure you include the final newline. It is also a part of the key/certificate.

    VS Code won’t detect my Thingy (even though it will detect an nRF52 dev board that I have).

    VS Code currently only detects DKs with an on-board debugger. We are working on improving this, so that Thingies and dongles also will be detected.

    So I then tried to use the Programmer in nRF Connect Desktop to load the AT Client hex file on to Thingy

    The only two hex files to choose from in this project were

    How did you build the project?

    Which SDK version did you use?

    If you build for thingy91_nrf9160_ns in NCS v1.8.0, you should also get the app_signed.hex file needed for DFU.

    QUESTION 3

    Should I be able to use AT commands to update certificate on the Thingy, when I have loaded the Asset Tracker application?

    Yes. But, if you want to write the certificates, you should remove the SIM card before sending AT+CFUN=4. Otherwise, you risk the application rebooting before the certificates get written to the modem.

    Best regards,

    Didrik

Reply
  • Hi,

    QUESITON 1:

    Which of the files I downloaded from AWS match which fields in the Certificate Manager?

    Private key = xxx-private.key.pem

    Client certificate = xxx-certificate.pem.crt

    CA certificate = Both should probably work, but I have used AmazonRootCA.pem

    QUESTION 2:

    Is this the correct way to copy the certificates / keys?

    Yes, that looks correct. Just make sure you include the final newline. It is also a part of the key/certificate.

    VS Code won’t detect my Thingy (even though it will detect an nRF52 dev board that I have).

    VS Code currently only detects DKs with an on-board debugger. We are working on improving this, so that Thingies and dongles also will be detected.

    So I then tried to use the Programmer in nRF Connect Desktop to load the AT Client hex file on to Thingy

    The only two hex files to choose from in this project were

    How did you build the project?

    Which SDK version did you use?

    If you build for thingy91_nrf9160_ns in NCS v1.8.0, you should also get the app_signed.hex file needed for DFU.

    QUESTION 3

    Should I be able to use AT commands to update certificate on the Thingy, when I have loaded the Asset Tracker application?

    Yes. But, if you want to write the certificates, you should remove the SIM card before sending AT+CFUN=4. Otherwise, you risk the application rebooting before the certificates get written to the modem.

    Best regards,

    Didrik

Children
No Data
Related