LoRaWAN

LoRaWAN is a low-power, wide-area networking (LPWAN) protocol built upon the LoRa wireless modulation technique. It enables long-range, low-power communication for battery-operated devices.

The Things Network

Create a New Organisation

Log into the Things network: ttn.bitpool.com In the things network console, click on the organization icon. Click on the create organization blue button.

Create a New Organisation in the console

Add your new organisation. This will add you to the organisation as a collaborator. All other collaborators (users for this organisation) should be added here by selecting the blue add collaborator box.

Add New Organisation along with any Collaborators

Create a New Application under Applications

Create a new application.

When the application (Organisation) has been created, add the API key to the application.

Go to integrations in the tree and select MQTT. Select Generate New Api Key.

Select MQTT in the Integrations tree

Go to Integrations (Left Hand Tree) and select MQTT. Select Generate New Api Key.

In the MQTT pane, Generate a new API key

Generate an API key and save it so it can be re-entered into the password section below.

Example API Key: NNSXS.WFBIVY4CZAOAMGNP455MJ63JB62BNYV26USYIKQ.5HXPCJGTMPCKDEMQZUPJSOFCVJFET4UV7WQO7GDCRB6CVBNAWVDA

Image below is the username and password (API key) for the Bitpool MQTT Broker.

Connection credentials will show the Username and Password for the Bitpool MQTT Broker

In app.bitpool.com, go to Bitpool connectionsMQTTExternal BrokerAdd configuration.

Location of the Add Configuration button on app.bitpool.com

Add a new pool or select an existing pool.

Add the correct endpoint, username and password (From the connection credentials above) and select the script from the drop-down box: “The Things Network”

MQTT Configuration window

Select the Test button, this will confirm the endpoint is valid. If endpoint is Valid, click on Create.

If successful, the window will close. If you selected a new pool, check the pool has been created in the Bipool portal - data - pools.

Register a New Milesight Device

Download the Milesight Toolbox Application on your mobile device. See Quick start guide from the device or website for more information. Use the Toolbox app and enable the new device at "Device Status" via the app.

Milesight Toolbox Application on Mobile device

Go to settings in the toolbox app – go to LoRaWan Settings and note the LoRaWan version (V1.0.3) and the APP EUI number (Join EUI) and the device EUI – some of this information can also be found on or in the packaging. All this information is required as part of the register end device process.

Milesight Information to note

Registering the end of Device

Log into the Things network: ttn.bitpool.com

Make sure the user adding the device is a Collaborator for the application!

To register a device, go to Applications: Select the blue Register End Device button.

Registering the end of Device

In the register end device section, you have two options from the Input Method.

You can select to add a device from the LoRaWan Repository (recommended) – however most times you will need to add the device manually.

Register end device configurations

Complete the device registration by adding the Join EUI (also know as the APPEUI), the Device EUI and add a meaningful name into the end device ID. Click on the Register end device button.

Generate the App key: Example: 6136C0D2E11DE5FA18FE83B353682F5D - this is entered into the device via the toolbox app.

Provisioning Information

You must enter the generated APP key from above into the end device by using the write feature in the toolbox application. The Application key is entered under LoRaWan settings – settings.

LoRaWan Settings

If all data is entered correctly the device will connect within 5 minutes.

Device Connected

Click on the device above – this will take you to a page like this.

Connected Device example

Click on the Payload Formatters to go to this section.

Payload Formatter Window

Go to Github Website. https://github.com/Milesight-IoT/SensorDecoders/blob/main/EM_Series/EM300_Series/EM300-TH/EM300-TH_Chirpstack.js

Under the Milesight section, find the device you are working with: Find the correct TTN.js. file.

TTN.js file example

Copy the raw file by clicking on the top right-hand side copy icon.

Copy the raw file button on the top right-hand side

Remove all the things network java script formatter data from the code box and paste the raw file into the box. Click on Save Changes.

Example of network javascript to remove

Go to live data, you should see meaningful data uploading. Depending on the download settings in the device. There are Four data values in the below image.

Live Data window

Go to pool you created and check to see if it has streams from your devices

Bitpool Pool streams

Adding Milesight Gateway

Follow the gateway user guide and Log into the Gateway.

Connect the Gateway to a Wireless Network.

Change the WLAN Work Mode form AP to Client.

Adding the Milesight Gateway

Select the Scan Icon. Join the required network.

Scan to Join to the required Network

Enter the Network security key (password to the wireless network) under the Key section.

Select DHCP Client and press Save button.

Check under Status – WLAN, to see if the gateway connected to the internet.

Check WLAN connection Status

Register the gateway by logging into: The Things Network.

Add the Gateway EUI address found under Packet Forwarder - General.

Register the gateway into The Things Network

Update the below values in The Things network.

Set Frequency plan to AU_915_928_FSB_2 (TTN)

Update values in The Things Network

Add the ttn.bitpool.com server address into the packet forwarder section of the physical gateway or the things network address.

Add the server address into the packet forwarder section

Switch work mode from “Client” back to “AP”, Create a name for your SSID network and assign a KEY (Wi-Fi password).

Disconnect the Cat 6 cable from the Gateway so the device can connect to the things network through the wireless network. Power down the device and back up again.

Last updated