# Network-related functions

## Uplink types

This command is used to set Vicki uplink message type.

{% tabs %}
{% tab title="SET" %}

| **Byte index** | **Hex value – Meaning**                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0              | 11 – The command code.                                                                                                                                                                        |
| 1              | <p>00 – Vicki sends unconfirmed uplink messages;<br><strong>Default for f.w. >=3.5</strong></p><p>01 – Vicki sends confirmed uplink messages.<br><strong>Default for f.w. <= 3.4</strong></p> |

**Example command:** `0x1101` – The server sets Vicki uplink message type to confirmed.
{% endtab %}

{% tab title="GET" %}

<table data-header-hidden><thead><tr><th width="121.48150634765625">Byte index</th><th>Sent request</th><th>Received response</th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>1B – Command code.</td><td>1B – The command code.</td></tr><tr><td>1</td><td></td><td><p>00 – Vicki uplinks are unconfirmed;</p><p>01 – Vicki uplinks are confirmed.</p></td></tr></tbody></table>

**Example command:** `0x1B`

**Example response:** `0x1B00` -> Vicki sent uplinks are unconfirmed.
{% endtab %}
{% endtabs %}

## Join-retry period

This command is used to set the period (T) of LoRaWAN join request sending from the device, in case it was unable to join the network from the first attempt.

{% tabs %}
{% tab title="SET" %}

<table data-header-hidden><thead><tr><th width="186">Byte index</th><th>Hex value – Meaning</th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Hex value – Meaning</strong></td></tr><tr><td>0</td><td>10 – The command code.</td></tr><tr><td>1</td><td><p><span class="math">T, [s] = XX * 5.</span> Value <code>0x00</code> isn’t applicable. </p><p><strong>Default value for f.w. &#x3C; 4.1: 3 minutes.</strong><br><strong>Default value for f.w. >= 4.1: 10 minutes</strong></p></td></tr></tbody></table>

**Example command:** `0x10F0` – the server sets join request send period to 20 minutes.
{% endtab %}

{% tab title="GET" %}

<table data-header-hidden><thead><tr><th width="134.33333333333331">Byte index</th><th width="148">Sent request</th><th>Received response</th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>19 – Command code.</td><td>19 – The command code.</td></tr><tr><td>1</td><td></td><td>XX – Network join retry period value. <span class="math">T, [s] = XX*5</span></td></tr></tbody></table>

**Example command:** `0x19`

**Example response:** `0x19C6` => T = `0xC6` \* 5 = 198 \* 5 = 990s = 16.5 minutes.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
This join retry period (T) must comply to LoRaWAN messages duty cycle. Otherwise the join request will be sent on the next attempt. In most of cases, min. acceptable value for T is 240s. Recommended are higher values, for less battery discharge, e.g. 480s.
{% endhint %}

{% hint style="info" %}
This join retry period (T) is for the first 15 sent messages. After, the used LoRaWAN stack automatically changes the possibility to send join request to \~20 minutes for 20 network join attempts. If the device is still not joined to the network after these 20 attempts, next join request can be sent after \~3 hours and 15 minutes.
{% endhint %}

## Communication Watch Dog&#x20;

There is a Watch Dog functionality that forces the device to reset, so it can rejoin the network in case a certain threshold has been reached where no downlinks have been received. There are 2 independent threshold values, one for confirmed mode and one for unconfirmed mode.

When working in confirmed mode if no downlink is received for the period defined by the  Watch Dog Period (*WDPconfirmed)*  parameter (see table below), the device resets itself.

When working in unconfirmed mode if no downlink is received for the period defined by the Watch Dog Period (*WDPunconfirmed)* parameter (see table below), the device resets itself.

The command is described in the table below. The keep-alive in the response is omitted for clarity.

{% tabs %}
{% tab title="SET" %}

<table data-header-hidden><thead><tr><th width="124">Byte index</th><th>Hex value – Meaning</th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Hex value – Meaning</strong></td></tr><tr><td>0</td><td>1C – The command code.</td></tr><tr><td>1</td><td><p>XX – Watch Dog Period (WDP) when <strong>confirmed uplinks</strong> are used by the device.</p><p>XX defines how many uplinks should be received without ACK so that the device restarts. On top of that XX uplinks, another 7 minutes should pass before the device restarts.</p><p><strong>Default value for XX: <code>0x02</code></strong><br><em>Note that value <code>0x00</code> disables the functionality when confirmed uplinks are used.</em></p></td></tr><tr><td>2</td><td><p>XX – Watch Dog Period (WDP) when <strong>unconfirmed uplinks</strong> are used by the device. Value is represented in hours.</p><p><strong>Default value for XX: <code>0x18</code> (24 hours)</strong></p><p><em>Note that value <code>0x00</code> disables the functionality when unconfirmed uplinks are used.</em></p></td></tr></tbody></table>

**Example command:** `0x1C0300` – Assuming that the Keep-alive period is 5 minutes, the device will wait for 3x5+7 = 22 minutes before resetting if confirmed uplinks are used. If unconfirmed uplinks are used the functionality is disabled (`0x00`).
{% endtab %}

{% tab title="GET" %}

<table data-header-hidden><thead><tr><th width="137.33333333333331">Byte index</th><th width="196">Sent request</th><th>Received response</th></tr></thead><tbody><tr><td><strong>Byte index</strong></td><td><strong>Sent request</strong></td><td><strong>Received response</strong></td></tr><tr><td>0</td><td>1D – Command code.</td><td>1D – The command code.</td></tr><tr><td>1</td><td></td><td><span class="math">WDP _{confirmed}</span> value.</td></tr><tr><td>2</td><td></td><td><span class="math">WDP _{unconfirmed}</span> value.</td></tr></tbody></table>

**Example command:** `0x1D`

**Example response:** `0x1D020C` – Assuming that the Keep-alive period is 5 minutes, the device will wait for 2x5+7 = 17 minutes before resetting if confirmed uplinks are used. If unconfirmed uplinks are used it will wait for `0x0C` = 12 hours and reset.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-vicki-lorawan/vicki-lorawan-device-communication-protocol/network-related-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
