Provisioning a nRF9160 on nRF Cloud in production scenery

Hi everyone,

Edit: Consider that I'm on ncs 2.6.1


What are the current methods for provisioning an nRF9160 on the nRF Cloud? I have an ongoing project with the nRF9160 and I need it to have FOTA. I have been following the FOTA tutorials on Dev Academy but it assumes that the device is already provisioned on the nRF Cloud. I can provision the nRF9160 on a DK board by IMEI and PIN, but considering a fast production pace of many product units, and considering that I would only receive the SiP on a tape and reel, without the PIN label, how would I do this? I've already searched for this on the forum and found this topic:

devzone.nordicsemi.com/.../how-to-fetch-hwid-from-nrf91-series-non-dk

In it, Hakon cites the link below:

docs.nordicsemi.com/.../GettingStarted.html

This link describes the process of "Claiming and auto-onboarding the device" but from what I read, this does not apply to the 9160. I also tried adding the 9160 by HWID, as the topic owner (zachary_z) said he did successfully in his case. For this, I created a function like this:

static void get_hwid(void)
{
char buf[HW_ID_LEN] = "unsupported";
int err = hw_id_get(buf, ARRAY_SIZE(buf));
if (err)
{
printk("hw_id_get failed (err %d)\n", err);
return 0;
}

printk("hw_id: %s\n", buf);
}

And I got the following output:

hw_id: 36B41A844CDE1605<CR><LF>

(consider that this hwid is from a test DK, so I have no concern in posting this information here, especially because it doesn't make sense without the IMEI)

Using this HWID I was unable to add the device.

I also tried using the "Claim Device" method in nRF Cloud. I obtained the token through the following function:

static void get_attesttoken(void)
{
char command[] = "AT%%ATTESTTOKEN";
int err = nrf_modem_at_cmd(response, sizeof(response), command);
printk("Device attestation token: %s.\r\n", response);
}

And I received the following response:

%ATTESTTOKEN: "2dn3hQFQUE5XNzI1SdCAYiUNfHisSANQ56HFSrB8RRKcPo7Lv-JkHVDpBEnYidpJIRiLx7DSV644.0oRDoQEmoQRBIfZYQPDn3_XWq1AainQE8yal4gUvW6BeQn-yGAAoZVkVxevuQxVWWx7NopQTsV5xzoxDeG1MOZV574GvRxxxxxxxxxxx"

(Please note that this is not the real data)

When I try to enter it in nRF Cloud I receive the message that the device is not supported.

That's all I have so far regarding this issue. (Remembering that my main goal is to understand how to provision devices in the nRF Cloud in a production scenario).

Parents
  • Hi,

    What are the current methods for provisioning an nRF9160 on the nRF Cloud?

    Using provisioning service and claiming the device is intended for nrf91x1 series of devices. For nrf9160 there are 2 methods for onboarding - preconnect onboarding and Just-In-Time provisioning. You can read more about device onboarding to the nRF Cloud and onboarding methods in the documentation. You can also look at nRF9160 Getting Started Guide.

    Best regards,
    Dejan

  • Hi,

    Thanks for the help, but this doesn't answer most of my questions. I've read all the documentation before, and I've read it again now. Usually when I post on the forum it's because I didn't understand the documentation or couldn't find the information anywhere before. Reading the documentation from the related links, I saw that one of the possible methods is by sending keys in a CSV file, but I don't know where to upload it, the article doesn't explain this and in the nRF Cloud portal there doesn't seem to be a field for this. I also still don't understand why the simplest method, which is nRFCloud>DEVICE MANAGEMENT>Devices>Add devices doesn't work when I try to enter the HWID obtained through the function I described above. What I'm wondering now is if I really have to spend hours and hours just to write software that interacts with the nRFCloud API just to add a device. Is there really no simpler and more direct method for this?

  • Hi,

    Felipe Dantas said:
    Reading the documentation from the related links, I saw that one of the possible methods is by sending keys in a CSV file, but I don't know where to upload it, the article doesn't explain this and in the nRF Cloud portal there doesn't seem to be a field for this.

    Here are possible steps:
    1. Log in to nRF Cloud
    2. Click on Devices -> Add Devices -> Bulk Onboard
    3. Drag and Drop your CSV file

    From your initial post, when you tried to add device from "Add LTE Device", which exact value did you enter into PIN/HWID field?

    Best regards,
    Dejan

  • Hi Dejans,

    I'll try by bulk onbord now. About add by "Add LTE Device" i get HWID by this funtion:

    static void get_hwid(void)
    {
    char buf[HW_ID_LEN] = "unsupported";
    int err = hw_id_get(buf, ARRAY_SIZE(buf));
    if (err)
    {
    printk("hw_id_get failed (err %d)\n", err);
    return 0;
    }

    printk("hw_id: %s\n", buf);
    }

    And I got the following output:

    hw_id: 36B41A844CDE1605<CR><LF>

    So, the exatcly value that i've putted on PIN/hwid field was 36B41A844CDE1605

    I also try make the same thing by API request in Postman by the AssociateDevice PUT methode and the nRF Cloud API returns the same error, see:

    {
        "message": "The ownership code is invalid for this device.",
        "code": 40102,
        "helpUrl": "">api.nrfcloud.com/.../
    }

    I continue without understand cause this method don´t work, but i'm tryng by ohter ways.

    Best regards,

Reply
  • Hi Dejans,

    I'll try by bulk onbord now. About add by "Add LTE Device" i get HWID by this funtion:

    static void get_hwid(void)
    {
    char buf[HW_ID_LEN] = "unsupported";
    int err = hw_id_get(buf, ARRAY_SIZE(buf));
    if (err)
    {
    printk("hw_id_get failed (err %d)\n", err);
    return 0;
    }

    printk("hw_id: %s\n", buf);
    }

    And I got the following output:

    hw_id: 36B41A844CDE1605<CR><LF>

    So, the exatcly value that i've putted on PIN/hwid field was 36B41A844CDE1605

    I also try make the same thing by API request in Postman by the AssociateDevice PUT methode and the nRF Cloud API returns the same error, see:

    {
        "message": "The ownership code is invalid for this device.",
        "code": 40102,
        "helpUrl": "">api.nrfcloud.com/.../
    }

    I continue without understand cause this method don´t work, but i'm tryng by ohter ways.

    Best regards,

Children
No Data
Related