Skip to main content

Devices and configuration

Device registration

In order for a device to connect, it must first be registered in the device manager. The device manager lets you create and configure device registries and the devices within them. The device manager can be used through the Cloud Platform Console, or the REST-style API.

Device registries

A device registry is a container of devices.

  • Each device registry is created in a Omnicore Subscription, and belongs to that subscription.
  • A registry is identified in the Omnicore service by its full name as: subscription/{subscription-id}/registries/{registry-id}.
  • The device registry is configured with one or more Cloud Pub/Sub or AWS Kinesis topics to which telemetry events are published for all devices in that registry. A single topic can be used to collect data across all regions.
  • Monitoring is automatically enabled for each registry.
  • For information on device registry ID naming and size requirements, see Permitted characters and size requirements.

Devices

When you create a device within a registry, you define the device as a OmniCore resource. You can then view device details and control some properties.

  • A device can be blocked from communicating with OmniCore. This can be useful when a sensor fails or a device is misconfigured.
  • Device timestamps show the most recent heartbeat and telemetry event received.
  • Each device can be identified by its full resource name: subscription/{subscription-id}/registries/{registry-id}/devices/{device-id}

Device metadata

You can define metadata for a device, such as hardware thumbprint, serial number, manufacturer information, or any other attribute. OmniCore does not interpret or index device metadata. In theory, device metadata is more secure than device state or device configuration because device metadata is never sent to or from a device. This means that, if a device is compromised, the device metadata cannot be read.

Device metadata shouldn't change often; for best results, update it no more often than once per day.

You can define up to 500 key-value pairs when you add or edit a device. Each key must be unique.

For information on device metadata key-value naming and size requirements, see Permitted characters and size requirements.

Device configuration

With OmniCore, you can control a device by sending it a device configuration. A device configuration is an arbitrary user-defined blob of data sent from OmniCore to a device. The data can be structured or unstructured. It can also be of any format, such as arbitrary binary data, text, JSON, or serialized protocol buffers.

Device configuration is persisted in storage by OmniCore. The maximum size for configuration data is 64 KB. For additional limits, see Quotas and Limits.

For best results, a device configuration should focus on desired values or results, rather than on a sequence of commands.

Changing device behavior or state using configuration data

As noted in the table above, the primary use cases of configuration data are as follows:

  • Sending a device's expected state as a configuration

Sending the desired state as configuration data

Device configuration data stored in Cloud IoT Core can be used to change the state of a device. For example, suppose the configuration of a device is represented as follows:

DeviceConfig
    {
firmwareVersionRequest: 1.11
}

Your TCP or UDP client could interpret this configuration data as instructions for changing the device's state — in this case, check that the device is on firmware version 1.11. The device can then send its state to Cloud IoT Core to show which firmware version it has:

DeviceState
    {
firmwareVersion: 1.11
}