hawkbit icon indicating copy to clipboard operation
hawkbit copied to clipboard

Comparing 2 controller attribute values

Open epoch1970 opened this issue 6 years ago • 6 comments

Re: Gitter July 16, 2018 4:14 PM Using a client such as swupdate, it is possible to report attributes: A = "foo" ; B = "bar" Using Hawkbit UI, the Filter manager works for expressions such as "attributes.A==foo"

This request is to make Filter manager work for expressions such as "attributes.A==attributes.B". Member attributes.B would need to be interpolated to its value.

Rationale: with plug-and-play registration, controller ID is derived from runtime information like serial numbers. When a new controller appears in the UI, when an old controller gets overdue, it is not easy to see whether the new controller is one more unit, or if it is an existing unit that was somehow altered. Comparing attributes that represent "registered" values with attributes that represent "live" values could allow tracking the history of the controller. A filter capable of picking up such changes, "if attributes.RegSN!=attributes.LiveSN", would be useful in the UI. Thanks!

epoch1970 avatar Jul 16 '18 21:07 epoch1970

Question: The ID with which you register to hawkBit is supposed to be unique and constant. IMO it is the identity of the device. Is in your case device identity gets altered?

subhadippramanik avatar Aug 20 '18 08:08 subhadippramanik

Thanks for your interest. The identity or nature of the device can change: it is an SBC (Raspberry Pi) and can receive accessories or the block device can be moved to another unit over time. The Hawkbit ID is hence a combination of various IDs/Serial No’s. If the HB ID changes, a new program might need to be loaded, or some other action taken. Let me know if this is not clear. Thanks again.

On 20 Aug 2018, at 10:37, Subhadip Pramanik [email protected] wrote:

Question: The ID with which you register to hawkBit is supposed to be unique and constant. IMO it is the identity of the device. Is in your case device identity gets altered?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

epoch1970 avatar Aug 20 '18 09:08 epoch1970

Thanks @epoch1970 for explaining the use case. In such scenario I would prefer to have some Id (may be serial number, mac id or some generated id) constant and use that for the whole fleet management. I can compare this SBC as a mobile device..in case of mobile devices, the serial number, IMEI number are not changed in any condition..you may have multiple accessories or spares used or exchanged, but these numbers are not changed. These are the numbers used for registration as well. Is it possible in your case to have certain fixed identity?

subhadippramanik avatar Aug 20 '18 12:08 subhadippramanik

If the use case is valid, I will gladly adapt to the generic case. I don’t see how generating a device ID and storing it (in uboot env) would be a problem for me. I think I chose to tie the ID to the current (changing) hw serial numbers only to make sure the device would “pop up” on the HB GUI in case of hardware change. A custom filter would do that better I think, if comparing values becomes possible.

On 20 Aug 2018, at 14:37, Subhadip Pramanik [email protected] wrote:

Is it possible in your case to have certain fixed identity?

epoch1970 avatar Aug 20 '18 14:08 epoch1970

Well I had a similar use case where the Id is generated. I store that in an overlay file system so that during os update the id is persisted and available on both (active and inactive) partitions.

subhadippramanik avatar Aug 20 '18 15:08 subhadippramanik

So stable ID it shall be. For now in my non-working scheme I intended to store 2 attribute values (current, registered) on the node, both reported to the server. With a static ID I suppose the registered value could be in HB’s database and the node could report only the current value. Either way could work for me. Thanks again for your interest.

On 20 Aug 2018, at 17:47, Subhadip Pramanik [email protected] wrote:

Well I had a similar use case where the Id is generated. I store that in an overlay file system so that during os update the id is persisted and available on both (active and inactive) partitions.

epoch1970 avatar Aug 21 '18 11:08 epoch1970