thin-edge.io icon indicating copy to clipboard operation
thin-edge.io copied to clipboard

Set the name of the 'main' Device

Open k-butz opened this issue 1 year ago • 1 comments

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

k-butz avatar Aug 07 '24 10:08 k-butz

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. https://github.com/thin-edge/thin-edge.io/blob/193ac915eecec1734f8770b113d11a5e38df46cf/crates/core/tedge/src/cli/connect/c8y_direct_connection.rs#L146

So, the implementation should be straight-forward.

rina23q avatar Aug 07 '24 13:08 rina23q

Great news this will be supported in 1.5.0 (but available already from the main release channel)...Checkout this detailed comments which shows how to use it

reubenmiller avatar Mar 06 '25 09:03 reubenmiller