Updating the nRF Cloud certificate

When you wish to use nRF Cloud’s REST Application Programming Interface (API), the Development Kit (DK) requires a valid security certificate. This means that you need to update the certificate stored on the DK. You need to download a new certificate and then provision it to your DK.

Downloading the nRF Cloud certificate

To download the nRF Cloud certificate for your DK, complete the following steps. Make sure you are logged in to the nRF Cloud portal.

  1. Click Devices under Device Management in the navigation pane on the left.

    nRF Cloud - Devices

    nRF Cloud - Devices

  2. Click Add Devices.

    nRF Cloud - Add Devices

    nRF Cloud - Add Devices

    The Select Device Type pop-up opens.

  3. Click LTE Device in the Select Device Type pop-up.

    nRF Cloud - Select Device Type

    nRF Cloud - Select Device Type

  4. Click Create JITP Certificates at the bottom of the page.

    The Create JITP Certificates dialog box opens.

    nRF Cloud - Create JITP Certificates dialog box

    nRF Cloud - Create JITP Certificates dialog box

  5. Enter the following information:

    • Device ID: the device ID is composed of nrf- and the 15-digit International Mobile (Station) Equipment Identity (IMEI) number that is printed on the label of your DK. For example, nrf-123456789012345.

    • Ownership code: the ownership code is the PIN or the hardware ID of your DK, and it is found on the label of your DK.

      If the label contains a PIN in addition to the IMEI number, enter this pin. If it does not contain a PIN, enter the Hardware ID (HWID) HEX code, with or without colons. For example, AA:BB:CC:DD:EE:FF or AABBCCDDEEFF.

      Note

      The ownership code serves as a password and proves that you own the specific DK. Therefore, do not share it with anyone.

  6. Click Download Certificate and save the .cert.json file to a folder of your choice.

    Note

    The certificate contains all the information that is needed to connect your DK to nRF Cloud. Therefore, do not share it with anyone.

  7. Close the Create JITP Certificates dialog box.

Provisioning the nRF Cloud certificate

After downloading the certificate, you must provision it to your DK.

Note

The application firmware on the DK must support long AT commands up to three kB to provision the certificate. If you have updated the application firmware using the instructions in either the Getting started using Quick Start documentation or the Updating the DK firmware using Programmer or Programming onto nRF91 Series devices sections, this requirement is fulfilled.

Complete the following steps to provision the certificate:

  1. Start nRF Connect for Desktop and install the Cellular Monitor app.

  2. Open the Cellular Monitor app.

  3. Connect the DK to the computer with a micro-USB cable, and turn it on.

  4. Click Select device and select the DK from the drop-down list.

    Cellular Monitor - Select device

    Cellular Monitor - Select device

    The drop-down text changes to the type of the selected device, with the SEGGER ID below the name.

  5. Click the Open Serial Terminal option of the Cellular Monitor app to open the Serial Terminal.

    Cellular Monitor - Open Serial Terminal

    Cellular Monitor - Open Serial Terminal

  6. Enter AT+CFUN=4 in the text field for AT commands and click Send. This AT command sets the modem to offline state.

  7. Enter AT+CFUN? in the text field for AT commands and click Send. This AT command returns the state of the modem.

    The command must return +CFUN: 4, which indicates that the modem is in offline state. If it returns a different value, repeat the previous step.

  8. Open the Cellular Monitor app.

  9. Click CERTIFICATE MANAGER in the navigation bar to switch to the certificate manager view.

    Cellular Monitor - Certificate Manager

    Cellular Monitor - Certificate Manager

  10. Click Load from JSON and select the *.cert.json file that you downloaded from nRF Cloud. Alternatively, you can drag and drop the file onto the GUI.

  11. Ensure that the Security tag is set to 16842753, which is the security tag for nRF Cloud credentials.

  12. Click Update certificate.

    The log message “Certificate update completed” indicates that the certificate was provisioned successfully. If you encounter any errors, switch to the terminal view and check the output of the AT commands that were sent to the nRF9160 DK modem.

    Note

    If you have connected your DK to nRF Cloud before, you must delete the device there after provisioning the certificate. Open the entry for your device from the Devices view, then click the gear icon to the right of the device’s name, and select Delete Device. Then, add the DK again as described in Connecting the nRF9160 DK to nRF Cloud.