Regarding scripting of certification to cloud

Hi everyone!

In preparations of getting our custom nRF9160 HW, I'm making use of the fantastic scripts to generate credentials and provision our devices with nRFCloud.

I have successfully generate our CA as such:

python create_ca_cert.py -c NO -o "Copmany AS" -cn Company -e [email protected] -p absolute/path/to/output/folder -f company-

Then I installed the credentials as such:

python device_credentials_installer.py -A -d --ca absolute/path/to/...efd212_ca.pem --ca_key absolute/path/to/...efd212_prv.pem --csv provision.csv --rtt --devinfo devinfo.csv --devinfo_append --mosh_rtt_hex absolute/path/to/merged.hex

Finally I provisioned them as such:

python nrf_cloud_provision.py --apikey $APIKEY --csv provision.csv --devinfo devinfo.csv --name_prefix Company- --name_imei

All the scripts run without error.

However, after installing my own app on the device again, and attempting to connect to the cloud, I get 

<dbg> app: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECTING
<err> nrf_cloud_transport: MQTT input error: -128
<err> nrf_cloud_transport: Error disconnecting from cloud: -128
<dbg> app: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_DISCONNECTED

Q1: I guess I've missed a step somewhere? A new device shows up in the web portal. Can you please guide me? Is there something I've done wrong or missed?

Q2: The device in the web portal has a long and unreadable name. How can I chose my own name of the devices? I would like them to be more readable. I tried using devinfo with --name_prefix and --name_imei, but alas, to no avail. I guess I've misunderstood the meaning of the devinfo here? Are there any ways to chose my own name during this process?

Thank you all for all and any help!

Kind regards,

Torje

Parents
  • Update: I had not added CONFIG_MODEM_JWT=y and CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y. After doing so, I'm successfully connecting to the cloud.

    I've also learned that the provisions.csv can be manually edited to change the device names on nRFCloud.

    So now this question remains: What does the --name_prefix and --name_imei do? And maybe more importantly, what does the devinfo do?
    Can the name change be done in the same script procedures?

    Thanks!

    Torje

  • Update again:

    I figured out how to use own names, or own prefix and IMEI instead of UUID. For reference incase others are looking for the same:
    We can change the names in the provision.csv output, and must change name accordingly in prj.conf as such:
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y
    CONFIG_NRF_CLOUD_CLIENT_ID="Very-Cool-Device"

    We can chose to use prefix and IMEI in the script, and must chose this in the prj.conf as well as such:
    CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="cool-"
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y

    I have not understood what the devinfo.csv with --name_prefix and --name_imei do. The names are set before, and saved in provisions.csv. If someone would clarify, that would be welcomed. 

    Thanks!

    Torje

Reply
  • Update again:

    I figured out how to use own names, or own prefix and IMEI instead of UUID. For reference incase others are looking for the same:
    We can change the names in the provision.csv output, and must change name accordingly in prj.conf as such:
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y
    CONFIG_NRF_CLOUD_CLIENT_ID="Very-Cool-Device"

    We can chose to use prefix and IMEI in the script, and must chose this in the prj.conf as well as such:
    CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="cool-"
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y

    I have not understood what the devinfo.csv with --name_prefix and --name_imei do. The names are set before, and saved in provisions.csv. If someone would clarify, that would be welcomed. 

    Thanks!

    Torje

Children
No Data
Related