Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the name of the 'main' Device #3055

Open
ButKor opened this issue Aug 7, 2024 · 1 comment
Open

Set the name of the 'main' Device #3055

ButKor opened this issue Aug 7, 2024 · 1 comment
Labels
improvement User value theme:c8y Theme: Cumulocity related topics theme:registration Theme: Device registration and device certificate related topics

Comments

@ButKor
Copy link

ButKor commented Aug 7, 2024

Is your feature improvement request related to a problem? Please describe.
I would like to use a serial-number as my technical device-id, but use a different/more meaningful name for the Device in Cumulocity.
For child-devices and services this works perfectly fine with specifying different @id and name fields in the registration messages. But I can't find a way to do the same for the main-device - here it always uses the CN of the certificate.
Once registered, thin-edge.io disallows to set the name via the tedge mqtt pub "te/device/main///twin/name" or the /etc/tedge/device/inventory.json (as documented here)

Describe the solution you'd like
I would like to be able to set a different name than ID for a main device, e.g. via a new tedge config field device.name in same manner as done with device.type.

Describe alternatives you've considered
Tried setting the name via:

  • tedge mqtt pub "te/device/main///twin/name" '"my-name"'
  • adding name to /etc/tedge/device/inventory.json
  • sending a registration message stating different id and name field (though I don't think that is possible for a main device).
@ButKor ButKor added the improvement User value label Aug 7, 2024
@rina23q rina23q added theme:c8y Theme: Cumulocity related topics theme:registration Theme: Device registration and device certificate related topics labels Aug 7, 2024
@rina23q
Copy link
Member

rina23q commented Aug 7, 2024

I would add additional implementation context.

The 100 message is sent during tedge connect c8y. The second field is using device_id (= the same name as the device certificate's CN), although device_type is already configurable as device.type in tedge config.

format!("100,{},{}", device_id, device_type).as_bytes(),

So, the implementation should be straight-forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement User value theme:c8y Theme: Cumulocity related topics theme:registration Theme: Device registration and device certificate related topics
Projects
None yet
Development

No branches or pull requests

2 participants