Having trouble trying to convert cbor object to CSR while trying to provision a device

HI all, 

So after realizing that I needed to Just-In-Time provision my Thingy 91 in order to add the device to my nRF Cloud account, I began the process described in this post in the nRF documentation: Generating credentials using AT commands I had been able to successfully obtain the base64-encoded CBOR object and I'm trying to convert that into a CSR through this python script:  modem_credentials_parser.py 

I have the script downloaded and saved in the same folder that Python on my laptop is also saved in. I tried to follow the README.md associated with the script and I'm not able to make it past the required package installations. 

If I go ahead and try to use the script with my CBOR object I get

Traceback (most recent call last):
File "Z:\modem_credentials_parser.py", line 11, in <module>
from cbor2 import loads
ModuleNotFoundError: No module named 'cbor2'

I have both pip and cbor2 installed on my machine so I'm not sure what else I'm missing for these issues to keep coming up? 

Parents
  • Hi,

    I have inquired internally regarding the issue and will get back to you soon.

    Regards,

    Priyanka

  • Hi,

    The issue may arise if you are using a firewall. Maybe you could try using an unrestricted firewall and see if this helps.

    -Priyanka

  • Hi,

    Could you share the IMEI and PIN so we can investigate further from our end? 

    witch_mountain said:

    Specifically the section about "Using the LTE Link Monitor Certificate manager". I couldn't find where this LTE Link Monitor application was so I used the Cellular Monitor from nRF Connect for Desktop and used the Certificate Manager there to add my JSON file and update my certificate. This however did not work when I went back to add a new device to nRF Cloud as I received the same 40412 error. 

    Then I went back to: https://api.nrfcloud.com/v1/#tag/IP-Devices/operation/CreateDeviceCertificate just to fully read what is provided in this section and if there was anything else I could consider trying. That's where I came upon that one of the disadvantages of this endpoint was that I had to "You will have to explicitly associate a JITP device with your account". There was a hyperlink attached to "associate" that lead me to: https://api.nrfcloud.com/v1#tag/IP-Devices/operation/AssociateDevice

    Yes, it's true that the documentation still mentions LTE Link Monitor and we are aware of this. Our tech writer is working on the updates to that page. When you got the 40412 error, that was as a result of trying to associate your device. You don't need to use curl to do that, and even if you did so, it would very likely fail with the same error 40412.

    -Priyanka

  • Hi Priyanka! 

    The IMEI = nrf-352656100884728

    The PIN = 315202 

    Thank you again for the help! 

  • Thank you very much. We are working on this.

    -Priyanka

  • Hi Priyanka!

    You don't need to use curl to do that, and even if you did so, it would very likely fail with the same error 40412.

    Just to clarify but the reason the Associate Device Endpoint didn't work at least in my case would be attributed to the fact that the device technically is already "provisioned" because of it's factory settings. If I were trying to add a non-nrf device to nRF Cloud then would this method have worked? 

    Thanks!

  • Hi,

    I have heard from our team. Your device nrf-352656100884728 does not exist in nrf cloud, so that means it has never successfully connected to perform JITP. This is why you are not able to associate your device.

    So either the device has never been able to establish a network connection to successfully connect to the cloud or the credentials on the device are invalid/not formatted correctly.

    According to your device, you can onboard the device as follows:

    1. preconnect provisioning

    2. JITP
    Before continuing further, please choose any one option.

    We recommend that you first attempt to use JITP to avoid your script/computer setup issues.

    This process is summarized as follows:

    - In Serial Terminal, select your device.
    - Send AT+CFUN=4
    - Confirm setting with AT+CFUN?
    - In Cellular Monitor, select your device.
    - Navigate to Certificate Manager.
    - Click the Load from JSON button.
    - Select the JSON file downloaded from nRF Cloud.
    - Click Update Certificates.
    - Confirm in Cellular Monitor log that all three credentials were deleted and updated.
    - You can also confirm in Serial Terminal that the data was sent.

    Here are some screenshots of the process:

    After your credentials are updated, you can cycle power on the device.
    When it first attempts to connect to nRF Cloud, you will see:

    [00:01:24.234,832] <err> nrf_cloud_transport: MQTT input error: -128
    [00:01:24.234,924] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
    [00:01:24.235,015] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED

    This is a normal part of the JITP process.
    Once you see this, you can proceed to nRF Cloud and add the device to your account.
    The device should connect successfully on the next retry.

    -Priyanka

Reply
  • Hi,

    I have heard from our team. Your device nrf-352656100884728 does not exist in nrf cloud, so that means it has never successfully connected to perform JITP. This is why you are not able to associate your device.

    So either the device has never been able to establish a network connection to successfully connect to the cloud or the credentials on the device are invalid/not formatted correctly.

    According to your device, you can onboard the device as follows:

    1. preconnect provisioning

    2. JITP
    Before continuing further, please choose any one option.

    We recommend that you first attempt to use JITP to avoid your script/computer setup issues.

    This process is summarized as follows:

    - In Serial Terminal, select your device.
    - Send AT+CFUN=4
    - Confirm setting with AT+CFUN?
    - In Cellular Monitor, select your device.
    - Navigate to Certificate Manager.
    - Click the Load from JSON button.
    - Select the JSON file downloaded from nRF Cloud.
    - Click Update Certificates.
    - Confirm in Cellular Monitor log that all three credentials were deleted and updated.
    - You can also confirm in Serial Terminal that the data was sent.

    Here are some screenshots of the process:

    After your credentials are updated, you can cycle power on the device.
    When it first attempts to connect to nRF Cloud, you will see:

    [00:01:24.234,832] <err> nrf_cloud_transport: MQTT input error: -128
    [00:01:24.234,924] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
    [00:01:24.235,015] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED

    This is a normal part of the JITP process.
    Once you see this, you can proceed to nRF Cloud and add the device to your account.
    The device should connect successfully on the next retry.

    -Priyanka

Children
Related