2

What's the purpose of Metadata for device config? I see when I create a device and add metadata, it comes to PubSub as a message attribute. It's very useful, for instance for Dataflow processing, I can make some aggregation and build additional logic without data enrichment operations. But, when my device sent data through a Gateway - no attributes in PubSub message. I can add metadata to Gateway but the same result - no attributes in PubSub message. Why?

W. Churchill
  • 346
  • 1
  • 7
  • 28
Ilya K.
  • 241
  • 2
  • 9

1 Answers1

1

The device metadata's main use is for storing serial number, manufacturer as a key-value pair and hence used for defining and classification of devices. It helps in identification.

The device metadata is never sent to or from a device as metadata is used mainly as an identifier or label for devices. It is by design that the cloud IoT Core shall not interpret or index device metadata and the metadata can only be used for identification purposes.

Device metadata stays in cloud and hence it cannot be used for storing information that needs to be sent from or to a device. Accordingly, in theory it is considered that the device metadata is more secure because device metadata is never sent to or from a device. Such information should be in a device configuration if it has to be sent to a device, or in device state data if it has to be reported to Cloud IoT Core.

Karthik Balaguru
  • 7,424
  • 7
  • 48
  • 65
  • 1
    Okay, this is fine. I'm not talking about sending metadata to the device. Let's assume we have [latitude, longitude] of the device. It's metadata, right? I can fetch this info (metadata) from PubSub message attributes when the device sending some events directly (not through a gateway). But when the device has metadata in a cloud, bound to the gateway and sending data through getaway (by spec), metadata is not coming to PubSub. Is it a bug or a feature? Why it doesn't work? :) How should I get metadata of devices in this case? Only the same way as a storing - fetching from IoT Core API? – Ilya K. Jun 27 '20 at 14:26