...
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 |
---|---|
| The device’s user-defined string identifier, for example, |
| 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. |
| The Google Cloud Platform device registry region, for example, |
| The device registry’s user-defined string identifier, for example, |
| The cloud project’s string ID that owns the registry and device. |
| The subfolder can be used as an event category or classification. For MQTT clients, the subfolder is the subtopic after |
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 |
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 |