> For the complete documentation index, see [llms.txt](https://docs.net2grid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.net2grid.com/integration-guide/cloud-data-streaming/device-metadata-and-connection-updates.md).

# Device Metadata & Connection Updates

## Device Metadata

Various devices metadata are provided through an SQS queue. The messages contain the following fields:

<table><thead><tr><th width="151.9296875">Attribute</th><th width="107.7109375">Required</th><th width="102.96484375">Type</th><th>Description</th></tr></thead><tbody><tr><td>meter_id</td><td>Yes</td><td>string</td><td>The hexadecimal representation of the gateway EUI64</td></tr><tr><td>installation_id</td><td>No</td><td>string</td><td>The external installation identifier</td></tr><tr><td>account_id</td><td>No</td><td>string</td><td>The external account identifier</td></tr><tr><td>labelpartner</td><td>Yes</td><td>string</td><td>The label partner's short name</td></tr><tr><td>data</td><td>Yes</td><td>object</td><td>The main object containing measurement arrays per attribute</td></tr></tbody></table>

The following list contains all the reported attributes:

<table><thead><tr><th width="216.67578125">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>hw</td><td>Hardware Version</td></tr><tr><td>dev</td><td>Device ID</td></tr><tr><td>batch</td><td>Batch ID</td></tr><tr><td>fw</td><td>Firmware Version</td></tr><tr><td>resc</td><td>Reset Counter</td></tr><tr><td>recc</td><td>Reconnect Counter</td></tr><tr><td>ress</td><td>Reset Source</td></tr><tr><td>rpt</td><td>Report Mode</td></tr><tr><td>elec_serial</td><td>Electricity Meter Serial Number</td></tr><tr><td>gas_serial</td><td>Gas Meter Serial Number</td></tr></tbody></table>

For each attribute, the basic measurement object schema contains the following fields:

<table><thead><tr><th width="112.515625">Attribute</th><th width="131.5546875">Required</th><th width="152.19140625">Type</th><th>Description</th></tr></thead><tbody><tr><td>t</td><td>Yes</td><td>integer</td><td>The Unix timestamp of the measurement, in seconds</td></tr><tr><td>v</td><td>Yes</td><td>integer</td><td>The value of the measurement</td></tr></tbody></table>

Specifically, for Reser Source, the available values are the following:

| Description   | Value          |
| ------------- | -------------- |
| None          | none           |
| Low Power     | low\_power     |
| Watchdog      | watchdog       |
| Power On      | power\_on      |
| External Pin  | external\_pin  |
| Brownout      | brownout       |
| Software      | software       |
| Panic         | panic          |
| Deep Sleep    | deep\_sleep    |
| SDIO          | sdio           |
| Reserved      | reserved       |
| Factory Reset | factory\_reset |
| LAN API       | lan\_api       |
| OTA           | ota            |
| Remote Shell  | rsh            |
| User Button   | user\_btn      |
| WLAN Leave    | wlan\_leave    |

An example of such a message can be found below :

```json
{
	"meter_id": "84DF0C0000010203",
	"installation_id": "InstABC",
	"account_id": "Acc123",
	"labelpartner": "lpx",
	"data": {
    	"hw": [
        	{ "t": 1727942470, "v": "2" }
    	],
      "fw": [
        	{ "t": 1727942470, "v": "2.29.1" }
    	],
    	"resc": [
        	{ "t": 1727942470, "v": "31" }
    	]
	}
}
```

The name of the SQS queue is: `streamer-device-metadata-queue-<stage>.fifo`

## Connection Updates

Another SQS queue is available for messages regarding the connection status updates, containing the following fields:

<table><thead><tr><th width="182.0625">Attribute</th><th width="106.21875">Required</th><th width="113.76171875">Type</th><th>Description</th></tr></thead><tbody><tr><td>meter_id</td><td>Yes</td><td>string</td><td>The hexadecimal representation of the gateway EUI64</td></tr><tr><td>installation_id</td><td>No</td><td>string</td><td>The external installation identifier</td></tr><tr><td>account_id</td><td>No</td><td>string</td><td>The external account identifier</td></tr><tr><td>labelpartner</td><td>Yes</td><td>string</td><td>The label partner's short name</td></tr><tr><td>timestamp</td><td>Yes</td><td>integer</td><td>The timestamp of the connection update, in milliseconds.</td></tr><tr><td>connection_status</td><td>Yes</td><td>string</td><td>The status of the device (See: Connection Statuses)</td></tr></tbody></table>

Regarding `connection_status`, the following table includes the values that will be reported:

<table><thead><tr><th width="289.1953125">Connection Status</th><th>Description</th></tr></thead><tbody><tr><td>SUCCESS</td><td>The device successfully connected to the platform</td></tr><tr><td>AUTH_ERROR</td><td>The device is disconnected from the platform due to an authentication or authorization error.</td></tr><tr><td>CLIENT_INITIATED_DISCONNECT</td><td>The device is disconnected from the platform due to a client-initiated disconnect.</td></tr><tr><td>CLIENT_ERROR</td><td>The device is disconnected from the platform due to a client error.</td></tr><tr><td>CONNECTION_LOST</td><td>The device was disconnected from the platform because it lost the client-server connection. This can happen during high network latency or when internet connection is lost.</td></tr><tr><td>DUPLICATE_CLIENTID</td><td>The device is disconnected from the platform because another device with the same client ID is already connected.</td></tr><tr><td>FORBIDDEN_ACCESS</td><td>The device is not allowed to be connected.</td></tr><tr><td>MQTT_KEEP_ALIVE_TIMEOUT</td><td>The device is disconnected if there is no client-server communication for 1.5x of the client's keep-alive time.</td></tr><tr><td>SERVER_ERROR</td><td>The device is disconnected from the platform due to an unexpected server issue.</td></tr><tr><td>SERVER_INITIATED_DISCONNECT</td><td>The server has intentionally disconnected the device for operational reasons.</td></tr><tr><td>THROTTLED</td><td>The device is disconnected from the platform for exceeding a throttling limit.</td></tr><tr><td>WEBSOCKET_TTL_EXPIRATION</td><td>The device is disconnected from the platform because a WebSocket has been connected longer than its time-to-live value.</td></tr><tr><td>CUSTOMAUTH_TTL_EXPIRATION</td><td>The device is disconnected from the platform because it has been connected longer than the time-to-live value of its custom authorizer.</td></tr></tbody></table>

An example of such a message can be found below:

```json
{
	"meter_id": "84DF0C0000010203",
	"installation_id": "InstABC",
	"account_id": "Acc123",
	"labelpartner": "default",
	"timestamp": 1727942470529,
	"connection_status": "SUCCESS"
}
```

The name of the SQS queue is: `streamer-connection-status-updates-<stage>.fifo`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.net2grid.com/integration-guide/cloud-data-streaming/device-metadata-and-connection-updates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
