> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.cthings.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Decoding data from the Eastron SDM530-LoRa

## Identifying your meter

The Eastron SDM530-LoRa is a three-phase DIN rail mounted electricity meter that communicates over LoRaWAN. As illustrated by the image (left) below it will say **SDM530-LR**  directly to the right of the Eastron logo. The Serial Number (SN) is located on top, above the display as displayed in the image (right).

![Eastron SDM530-LoRa](https://storage.crisp.chat/users/helpdesk/website/66a70a6ed8fbb400/eastron-sdm530-lora-medium_fpqcbh.png)

## Connecting your meter to a LoRaWAN Network Server

The SDM530-LoRa can be connected to any LoRaWAN Network Server (LNS) including TTN, TTI, Chirpstack and Loriot amongst others. cThings Cloud provide an end-to-end in-built LNS with pre-configured decoders to facilitate connecting the SDM530-LoRa to your existing system. [Contact us](mailto:sales@cthings.io) to find out more.

|| The SDM530-LoRa must be setup as a Class-C device

## Decoding the default data received from the SDM530-LoRa

All SDM530-LoRa meters come with a default configuration pre-installed. If a custom configuration has been requested, see the section below on custom configurations. 

By default, data will be sent from the SDM530-LoRa every 30 minutes. Below is an example hex encoded payload that could be sent from a default configured meter (it has been conveniently separated into chunks to match the decode in the table below).

| 001435FC 01 14 443A424E 42480000 432F0000 00000000 42C5DA1D C591

The meter will send the data in a single payload with the 5 default parameters. The below table shows how to decode the payload and parameters.

| Byte Range | Description | Data Type | Example Hex | Decoded |
| --- | --- | --- | --- | --- |
| 0-3 | Serial Number | UINT32 | 001435FC | 01324540 |
| 4 | Message Fragment Number (always 1 for default configuration) | UINT8 | 01 | 1 |
| 5 | Number of Parameter Bytes in this Payload (always 20 for default configuration) | UINT8 | 14 | 20 |
| 6-9 | Total kWh | FLOAT | 443A424E | 745.036 |
| 10-13 | DI-1 Count | FLOAT | 42480000 | 50 |
| 14-17 | DI-2 Count | FLOAT | 432F0000 | 175 |
| 18-21 | Relay State | - | 00000000 | All Relays Open |
| 22-25 | Total Power Factor | FLOAT | 42C5DA1D | 98.926 |
| 26-27 | Modbus Checksum | - | C591 | - |

## Custom Configurations

Your SDM530-LoRa may have been configured to send different parameters in a different order. If this is the case, you should have received more information about your custom configuration when you ordered your meter.

## Advanced Decoding
### Decoding the Relay State

The first three bytes of the Relay State represent the state of each Relay (Phase 1, Phase 2 and Phase 3 respectively). 0x00 indicates the relay is Open and 0xFF indicates the relay is Closed. The below table provides examples of different relay states.

| Example Hex | Relay Phase 1 | Relay Phase 2 | Relay Phase 3 |
| --- | --- | --- | --- |
| 00000000 | Open | Open | Open |
| FFFFFF00 | Closed | Closed | Closed |
| FF000000 | Closed | Open | Open |
| 00FF0000 | Open | Closed | Open |
| 0000FF00 | Open | Open | Closed |

### Fragmentation

By default, the SDM530-LoRa will send 5 parameters in a single payload (one message fragment). For non-standard configurations more parameters may be sent in which case the payload may be fragmented across multiple LoRaWAN payloads. Each parameter will always be 4 bytes in length, starting from byte 6 (0-based) and the final 2 bytes of the message will always be a 2 byte _Modbus Checksum_.

| 001435FC 01 18 443A424E 42480000 432F0000 185B
| 001435FC 02 18 00000000 42C5DA1D 00000000 D821