Skip to content

Conversation

reubenmiller
Copy link
Owner

@reubenmiller reubenmiller commented Jun 15, 2025

Command to enroll a new device using the Cumulocity CA.

Examples

$ c8y devices enroll --id "ASDF098SD1J10912UD92JDLCNCU8"
Enroll a new device with a randomized one-time password

$ c8y devices enroll --id "ASDF098SD1J10912UD92JDLCNCU8" --one-time-password "RqzwJeTusABlk4)KmtIc"
Enroll a new device and provide the one-time-password to be used for enrollment

$ c8y devices enroll --id "ASDF098SD1J10912UD92JDLCNCU8" --host iot.latest.stage.c8y.io
Enroll a new device and specify a host name so a session does not need to be set

$ c8y devices enroll --id "ASDF098SD1J10912UD92JDLCNCU8" --key myname.key --cert myname.crt
Enroll a new device and specify the names of the private key and public certificate to use

$ c8y util repeat 3 | c8y devices enroll --template "{id: 'device' + input.index, key: 'device.' + input.index + '.key', cert: 'device.' + input.index + '.crt'}"
Enroll 2 devices and create unique private key and certificate per device

$ DEVICE_ID=example
$ c8y devices enroll --id "$DEVICE_ID"
$ mosquitto_sub --key "${DEVICE_ID}.key" --cert "${DEVICE_ID}.crt" -t 's/ds' -i "$DEVICE_ID" -h $C8Y_DOMAIN -p 8883 --cafile "$(brew --prefix)/etc/ca-certificates/cert.pem" --debug
$ mosquitto_sub --key "${DEVICE_ID}.key" --cert "${DEVICE_ID}.crt" --cafile "$(brew --prefix)/etc/ca-certificates/cert.pem" -i "$DEVICE_ID" -h $C8Y_DOMAIN -p 9883 -t 'custom/topic' --debug
Enroll a device and use the certificate to connect to Cumulocity via MQTT (with mosquitto_sub)

@reubenmiller reubenmiller force-pushed the feat-device-enrollment branch 2 times, most recently from a8fae6b to ede8a0b Compare June 17, 2025 08:22
@reubenmiller reubenmiller force-pushed the feat-device-enrollment branch from e5d2ba4 to 8a808ce Compare October 7, 2025 04:56
@reubenmiller reubenmiller force-pushed the feat-device-enrollment branch from 8a808ce to 2fad23e Compare October 7, 2025 10:36
@reubenmiller reubenmiller force-pushed the feat-device-enrollment branch from 2fad23e to 0ec4880 Compare October 7, 2025 10:41
@reubenmiller reubenmiller marked this pull request as ready for review October 7, 2025 10:45
@reubenmiller reubenmiller merged commit f367706 into v2 Oct 7, 2025
4 checks passed
@reubenmiller reubenmiller deleted the feat-device-enrollment branch October 7, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant