# RAK WisGateOS2

## **Connection between RAK** WisGateOS2 **and MClimate Enterprise** <a href="#connection-between-the-things-industries-and-mclimates-lorawan-broker-using-webhooks" id="connection-between-the-things-industries-and-mclimates-lorawan-broker-using-webhooks"></a>

In order to properly create a **RAK** WisGateOS2 integration with MClimate Enterprise you need to configure your Application to connect Enterprise platform.

## Configuring the MClimate Enteprise integration

Head over to the link <https://enterprise.mclimate.eu/> and log into your account. Go to the Integrations section and create a new M-token.&#x20;

<figure><img src="https://3940008670-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McDr-jr9h3qA888r1Yp%2Fuploads%2FOJzPOG9JgCrqAx42TkPT%2Fimage.png?alt=media&#x26;token=c6efb63d-b939-453d-bedb-2dbeb90122c3" alt=""><figcaption><p>MClimate Enterprise Integration section</p></figcaption></figure>

Make sure to copy it as you will need it together with the Keys to create the integration (image above). You can click on the box to open up a window where you need to enter the following:

M-token - the value of the M-token you just created

User - the local username for your gateway

Password - the local password for your gateway

<figure><img src="https://3940008670-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McDr-jr9h3qA888r1Yp%2Fuploads%2FkQqKT2bl3jA9necFfvWc%2Fimage.png?alt=media&#x26;token=70a40287-0e4e-4252-b206-87cb8ca7a1dd" alt=""><figcaption><p>RAK WisGateOS2 Integration</p></figcaption></figure>

## Configuring the application

Log into the gateway and head to the Lora -> Application section, where you can choose to edit the Application configuration, so it can connect to Enteprise.

<figure><img src="https://3940008670-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McDr-jr9h3qA888r1Yp%2Fuploads%2FAD4c7xxiKPEWakcMZPrx%2Fimage.png?alt=media&#x26;token=a801dcdc-d7d4-4d3f-bf81-3a1cb60a015b" alt=""><figcaption><p>Editing the Application</p></figcaption></figure>

In the Configuration window scroll down to the Integration Parameters section.

Make sure the Decode type is set to "HEX string".

Activate the "Enable HTTP/HTTPS Integration Parameters" toggle (it should be disabled by default). This will display a number of parameter field that need to be filled out.

<figure><img src="https://3940008670-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McDr-jr9h3qA888r1Yp%2Fuploads%2Fed2cMr43BuxHOij6O71H%2Fimage.png?alt=media&#x26;token=b1ea04f7-7212-4e99-9069-66b2c928a568" alt=""><figcaption><p>Enabling the integration</p></figcaption></figure>

You need to create two headers:

**Header 1**

Header name - **m-token**

Header value - **the value of your M-token**

**Header 2**

Header name - **url**

Header value - **http\://{Public IP of the Gateway, e.g. 195.74.85.64}**

{% hint style="warning" %}
Make sure that the IP is exposed and accessible from outside of your LAN. We need it for sending downlinks, if you are behind a NAT check your router for the public IP (the local one would not work).
{% endhint %}

You also need to fill in the 4 URLs with the values below

* Uplink data URL - **<https://lorawan-broker.mclimate.eu/rak>**
* Join notification URL - **<https://lorawan-broker.mclimate.eu/rak-join>**
* *Ack notification URL* - **<https://lorawan-broker.mclimate.eu/rak-ack>**
* Device-status notification URL - **<https://lorawan-broker.mclimate.eu/rak-notification>**

Refer to the image below if in doubt.

<figure><img src="https://3940008670-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McDr-jr9h3qA888r1Yp%2Fuploads%2FvBYrg5mTJP19ZcX4Je0R%2Fimage.png?alt=media&#x26;token=e4baee76-bec7-462c-ab76-8e31709ce0f6" alt=""><figcaption><p>Integration parameters</p></figcaption></figure>

Your integration is now created. This will allow for the proper authentication between the РАК GateWayOS2 and MClimate Enterprise platforms.

If you configured everything properly your Integration is now complete and you should be able to see data in MClimate Enterprise (provided you have registered the devices there already).
