Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The forwarded message data field contains a message’s copy published by the device, and the following message attributes are added to each message in the Cloud Pub/Sub topic:

Attribute

Description

deviceId

The device’s user-defined string identifier, for example, thing1. The device ID must be unique within the registry.

deviceNumId

The server-generated device numeric ID. When you create a device, ClearBlade IoT Core automatically generates the device’s numeric ID; it's globally unique and not editable.

deviceRegistryLocation

The Google Cloud Platform device registry region, for example, us-central1.

deviceRegistryId

The device registry’s user-defined string identifier, for example, registry1.

projectId

The cloud project’s string ID that owns the registry and device.

subFolder

The subfolder can be used as an event category or classification. For MQTT clients, the subfolder is the subtopic after DEVICE_ID/events, which is copied directly. For example, if the client publishes to the MQTT topic /devices/DEVICE_ID/events/alerts, the subfolder is the string alerts.

If you try to publish a device telemetry event without specifying a Cloud Pub/Sub topic for the device's registry, the MQTT connection closes automatically. To verify why the connection closed, get the device details and check the lastErrorStatus field in the response. This applies only to telemetry events, not state data.

...

ClearBlade IoT Core does not supply its default keep-alive value; if you specify a keep-alive interval, you must set it in the client.

For best results, set Set the client's keep-alive interval to a minimum of 60 seconds60-second minimum for best results. Many open-source client libraries, including the Paho MQTT libraries for C, Python, Node.js, and Java, use 60 seconds by default.

...

Separate from the keep-alive interval, ClearBlade IoT Core’s idle time limit is 20 minutes. Based on this, a client connection will automatically be terminated if the client doesn't send any messages for 20 minutes, even if the keep-alive interval is longer. If a keep-alive value isn't supplied, the default 20-minute idle timeout of 20 minutes still takes effect.

Error Codes

The ClearBlade MQTT broker honors these MQTT 3.1.1 error codes:

Value

Return Code Response

Description

0

0x00 Connection Accepted

Connection accepted

1

0x01 Connection Refused, unacceptable protocol version

The server does not support the MQTT protocol level requested by the client

2

0x02 Connection Refused, identifier rejected

The client identifier is correct (UTF-8) but unallowed by the server. A duplicate clientid can cause this

3

0x03 Connection Refused, Server unavailable

The network connection has been made, but the MQTT service is unavailable

4

0x04 Connection Refused, bad user name or password

The data in the user name or password is malformed

5

0x05

Unused by IoT Core

13

0x13

All other events for connect, disconnect, publish, and subscribe