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 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

  • Hi Priyanka! 

    Thank you so much for your help! That seemed to have fixed the issue with my device. Initially I was trying to connect with the asset_tracker_v2_nbiotlegacy application but it seems that NB-IoT coverage isn't particularly strong in my area but I was able to connect my device to nRF Cloud over LTE!

    This ticket can be closed, thanks :)

Reply Children
No Data
Related