> For the complete documentation index, see [llms.txt](https://docs.yobiiq.com/user-manual-em4302t-lrw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yobiiq.com/user-manual-em4302t-lrw/lorawan/lorawan-communication/payloads/downlinks.md).

# Downlinks

## Restart Device <a href="#id-1eda7896-759c-476b-9e8e-698ec6b7d7b9" id="id-1eda7896-759c-476b-9e8e-698ec6b7d7b9"></a>

The device supports downlink commands to restart the device, the application port is 50 by default.

| Channel | Type         | Description                                                     |
| ------- | ------------ | --------------------------------------------------------------- |
| ff      | 0a (Reboot)  | <p>1 Byte, Uint8<br>01 => Reboot the device<br></p>             |
| ff      | 0b (Restart) | <p>1 Byte, Uint8</p><p>01 => Restart the LoRaWAN Interface.</p> |

#### Example

To restart the LoRaWAN interface you send the following HEX payload over fPort 50.

```
ff0b01
// ff -> channel -> ff
// 0b -> type -> Restart LoRaWAN Interface
// 01 -> action -> Restart
```

## Device Configuration

The device supports downlink commands to configure the working of the device, and control the relay outputs.

The application port for sending the device configuration is fPort **50**

| Channel | Type               | Description                                                                                                                                             |
| ------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ff      | CT1 (Primary CT)   | <p>2 Bytes, Uint 16 </p><p>Set the primary current transformer ratio (value between 0-9999).</p>                                                        |
|         | CT2 (Secondary CT) | <p>1 Byte, Uint 8 </p><p>Set the secondary current transformer ratio (value between 0-5).</p>                                                           |
|         | VT1 (Primary VT)   | <p>4 Bytes, Uint 32 </p><p>Set the primary voltage transformer ratio (value between 30-500000).</p>                                                     |
|         | VT2 (Secondary VT) | <p>2 Byte, Uint 16 </p><p>Set the secondary voltage transformer ratio (value between 30-500).</p>                                                       |
|         | CT Inverse         | <mark style="background-color:blue;">Set the Current Transformers as inverse. (if the current transformers are installed in the wrong direction)</mark> |

#### **Example**

<mark style="background-color:blue;">To set the channel 1 output to on and disable the button function override for channel 1 you send the following HEX payload over fPort 50.</mark>

```
xxxxxxxx
// xx
// xx
// xx
```

## Device Parameter Reading

The device supports downlink commands to read its readable parameters, the application port is **100** by default.

<table><thead><tr><th width="120.33333333333331">Channel</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>FF</td><td>CC (Read Parameter)</td><td>Maximum of 10 parameter types<br>(only readable parameters)</td></tr></tbody></table>

#### Example

<mark style="background-color:blue;">To read the model, serial number and battery percentage you send the following HEX payload over fPort 100.</mark>

```
xxxxxxxx
// xx
// xx
// xx
```

## Read data logger

The device supports reading the contents of the datalogger using a downlink on fPort 12.\
The downlink will result in a series of uplinks containing the datalogger entries.

#### Example <a href="#id-96a98756-a169-4865-bf24-32b5d3bd59f8" id="id-96a98756-a169-4865-bf24-32b5d3bd59f8"></a>

Restart the LoRaWAN Interface.

| ff0b01      |                       |            |   |   |   |
| ----------- | --------------------- | ---------- | - | - | - |
| **Channel** | **Type**              | **Value**  |   |   |   |
| ff          | 0C (Read data logger) | 01 => Read |   |   |   |

## Periodic Transmissions

### Device Data <a href="#a7f7674a-7d57-4fb6-9003-eb313812905a" id="a7f7674a-7d57-4fb6-9003-eb313812905a"></a>

The device allows for configuration of the registers that should be sent and in which interval by using a downlink message.

There are 5 “slots” available for this configuration which are represented by the fPorts 1-5\
Each slot can take 10 registers, this means that a total of 50 registers can be send over the LoRaWAN interface.

The lower slots have a higher priority.\
The device comes with a “Default Uplink” configured on fPort 1.\
All downlink commands should be send to the Application port, which the configuration is for

{% hint style="info" %}
If a configuration downlink is send to fPort 1, the default uplink is overwritten!
{% endhint %}

### Uplink Configuration <a href="#id-8b99be12-e222-4095-a4e4-bf8bab89bc7a" id="id-8b99be12-e222-4095-a4e4-bf8bab89bc7a"></a>

{% hint style="info" %}
YOBIIQ advises you to use the official Device Codec to configure the downlinks, it allows you to configure downlinks by using the names of the registers you want to include.
{% endhint %}

To configure the periodic uplinks by the device you can send a downlink to fPort 1 to 5.\
Each fPort can hold 10 register id’s.

{% hint style="info" %}
If confirmed mode is off, the device will send a package 1 time; if confirmed mode is on, the device will resend a package maximum of 3 times if it does not get an acknowledgement from the network.
{% endhint %}

<table><thead><tr><th width="120.33333333333331">Channel</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>ff</td><td>14 (Interval)</td><td><p>1 Byte, Uint 8</p><p>Set the interval of the uplink, in minutes.</p></td></tr><tr><td></td><td>15 (Confirmed)</td><td><p>1 Byte, Uint 8</p><p>Confirmed mode off => 0 or confirmed mode on => 1</p></td></tr><tr><td></td><td>16 (Active)</td><td><p>1 Byte, Uint 8</p><p>Set the status of the fPort : inactive => 0 or active => 1</p></td></tr><tr><td></td><td>17 (Registers)</td><td>Maximum of 10 registers to include in the uplink.</td></tr></tbody></table>

Example

To configure the device to sample the consumption every 5 minutes, transmit every 4 hours with a treshold of 10 without including internal sensors you send the following HEX payload over fPort 100.

```
xxxxxxxx
// xx
// xx
// xx
```
