The host connects to nRF Cloud with its own certificate and private key. You create a certificate authority (CA) once, use it to install credentials on the device, and register the device in your nRF Cloud account.
Run the following commands from a normal terminal, not the toolchain shell. Keep the host console port free, because the credential installer uses it. Close the serial terminal on that port first.
-
Install the nRF Cloud command-line tools (once per computer):
pip3 install nrfcloud-utils -
Create a self-signed CA certificate (once, reuse it for all your devices). Replace
USwith your two-letter country code:create_ca_cert -c US -f self_This creates
self_<serial>_ca.pem,self_<serial>_prv.pem, andself_<serial>_pub.pem. Keep the CA private key safe. -
Install the device credentials on the host. Replace
<device_id>with the Device ID from step 4.4, and<console_port>with the host console port:device_credentials_installer \ --ca self_<serial>_ca.pem \ --ca-key self_<serial>_prv.pem \ --id-str <device_id> \ -s -d --verify --coap --local-cert --cmd-type tls_cred_shell \ --port <console_port>On success, it saves an onboarding file:
Saving nRF Cloud device onboarding CSV file onboard.csv... Onboarding CSV file saved, row count: 1The command also saves the device certificate and private key as PEM files in the current directory. Delete the device private key file afterwards.
-
Register the device in your nRF Cloud account. Get an API key from your nRF Cloud user account:
nrf_cloud_onboard --api-key <your_api_key> --csv onboard.csv -
Open the serial terminal on the host console again.
Checkpoint: The cloud module retries every 10 seconds, so within a few seconds the log shows the following:
<inf> main: Cloud connected