# LoPy5

This is an old development board which is no longer available for purchase and should not be used for new designs.

The LoPy4 is a quadruple bearer MicroPython enabled development board (LoRa, Sigfox, WiFi, Bluetooth) perfect enterprise grade IoT platform for your connected Things. With the latest Espressif chipset the LoPy4 offers a perfect combination of power, friendliness and flexibility.

<figure><img src="https://1453626848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl6RrePMSAjRvOgcHjMBZ%2Fuploads%2FljCzD8ITwIotoWFYEyjg%2Fimage.png?alt=media&#x26;token=31dbafc6-0458-43a4-819c-080b4461f8de" alt=""><figcaption></figcaption></figure>

## 1. Setup your LoPy4 device

Use the [getting started](https://docs.pycom.io/gettingstarted/) from the Pycom documentation to get started with your LoPy4. Make sure you setup both the [hardware ](https://docs.pycom.io/gettingstarted/connection/lopy4/)and [software](https://docs.pycom.io/gettingstarted/installation/). You should be able to [program the module](https://docs.pycom.io/gettingstarted/programming/) when continuing this getting started.

## 2. Determine device identifiers

The LoPy4 is a LoRa device, and to register a LoRa-device to a network you need three values: DevEUI, AppEUI and AppKey. These values must be registered in KPN Things and in the device. For more information on these three values you can read [Device Identification](https://docs.kpnthings.com/lora/technical-information/device-identification) in the LoRa documentation.

<table data-header-hidden><thead><tr><th width="150">Value</th><th>How to get it</th></tr></thead><tbody><tr><td><strong>Value</strong></td><td><strong>How to get it</strong></td></tr><tr><td>DevEUI</td><td>Use <a href="https://docs.pycom.io/gettingstarted/registration/lora/#generic-instructions">this code snippet </a>from the Pycom documentation to retrieve the pre-programmed EUI from your LoPy4. You can use that one as DevEUI.</td></tr><tr><td>AppEUI</td><td>You can use this general purpose AppEUI: <code>0059AC00000FFFFF</code></td></tr><tr><td>AppKey</td><td>Every device should have its own unique AppKey, since it is the root security key of your device. You can generate a unique AppKey here: <a href="https://www.loratools.nl/#/keys">https://www.loratools.nl/#/keys</a>.</td></tr></tbody></table>

## 3. Register your LoPy4 to KPN Things

### Open the KPN Things Portal

Open the [KPN Things Portal](https://portal.kpnthings.com). Go to the **All Devices** page and click on **Add new Device**.

<figure><img src="https://1453626848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl6RrePMSAjRvOgcHjMBZ%2Fuploads%2FbWiwgnSyqc3tNzKgS5mG%2Fimage.png?alt=media&#x26;token=a887d438-197c-4fad-a1e4-a7652b984c34" alt=""><figcaption></figcaption></figure>

### Fill in your device information

1. Select the **Own LoRa device (preset connectivity)** device type
2. **Enter a name** for your LoPy4
3. Click **Add Device** to continue

<figure><img src="https://1453626848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl6RrePMSAjRvOgcHjMBZ%2Fuploads%2FEAtyCVUvIc4pwnLVgaOM%2Fimage.png?alt=media&#x26;token=25a64470-dfa0-43bd-bb7f-2a883d851285" alt=""><figcaption></figcaption></figure>

### Provide Network Information

Fill in the three values you determined in the previous step [*Determine device identifiers*](#determine-device-identifiers). Then click **Add Network Info** to save the network information and then **Finish** to continue.

<figure><img src="https://1453626848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl6RrePMSAjRvOgcHjMBZ%2Fuploads%2FF1Xvr50gXugEar0LaSGw%2Fimage.png?alt=media&#x26;token=13f46fec-2686-4e1e-866b-cba82394d050" alt=""><figcaption></figcaption></figure>

### Check your newly created Device

You are now on the Device Detail Page. In the LoRa tab you will see the **network status**. This can temporarily be *Pending creation*, but if you refresh the page it should switch to *Active*. This means your device is correctly registered to the network.&#x20;

If the network status sticks to *Pending creation*, you could try to delete the Device and register the device again.

{% hint style="danger" %}
If the Network Status ended up in **Failed**, something has gone wrong. Most likely the DevEUI is already registered through another application like Thingpark or the LoRa Developer Portal. Please make sure you remove the device registration from the other application and re-add the device in the Things Portal. For more information consult our [FAQ](https://docs.kpnthings.com/kpn-things/getting-started/frequently-asked).
{% endhint %}

## 5. Program your device

Use the [LoRaWAN with OTAA](https://docs.pycom.io/tutorials/lora/lorawan-otaa/) example from Pycom to get your device connected with our LoRa network and have it send data to KPN Things.

### Check incoming data in the Portal

Now your LoPy4 has joined and is sending data, you could visit the **LoRa data** tab on your **Device Detail Page** in the Portal. You should see your Join request and Join accept appear like in the screenshot below and at this point you will see more data as well.

<figure><img src="https://1453626848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl6RrePMSAjRvOgcHjMBZ%2Fuploads%2F50lab5iQ8HdUQvEXEHcS%2Fimage.png?alt=media&#x26;token=5a40c1c4-c9dc-46fc-8ff1-46fde0fb7140" alt=""><figcaption></figcaption></figure>

Read more information about what you see on the [LoRa Data History](https://docs.kpnthings.com/kpn-things/building-blocks/connectivity/connecting-lora-devices#lora-data-history) tab.

## Setup data flow in KPN Things

You now successfully connected your LoPy5 device to KPN Things! To further setup your data flow in KPN Things, you can go to the next step:


---

# 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.kpnthings.com/kpn-things/getting-started/tutorials/connect-devices/lopy5.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.
