Cumulocity-IoT / cumulocity-devicemanagement-agent

Cumulocity Reference Agent written in Python to demonstrate most of the Device Management Capabilities of Cumulocity IoT
Apache License 2.0
26 stars 20 forks source link

External Id configuration missing #45

Closed mstoffel-sag closed 2 years ago

mstoffel-sag commented 2 years ago

In the docs:

"The script will build a docker image and starting one instance afterwards. Per default Bootstrapping is used and no other information is necessary. In this case the docker container Id is the device Id which should be entered when registering a device in cumulocity."

But how can the device id (external_id) be configured when running outside of docker?

mbay-ODW commented 2 years ago

From my understanding you could basically add the device id to the agent.ini in the config directory.

https://github.com/SoftwareAG/cumulocity-devicemanagement-agent/blob/9a8a06f802ad5b0b31c57fe05cbda9d930768278/c8ydm/main.py#L130

If the line exists it will use that one.

switschel commented 2 years ago

Normally the serial will be fetched from the system: https://github.com/SoftwareAG/cumulocity-devicemanagement-agent/blob/9b101e107d719dba0623a534d1f6c864952bf257/c8ydm/main.py#L111-L131

https://github.com/SoftwareAG/cumulocity-devicemanagement-agent/blob/9b101e107d719dba0623a534d1f6c864952bf257/c8ydm/utils/systemutils.py#L22-L23

If you provide device.id in the ini it this will be overwritten.