Documentation (Beta)
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

LoRa Cloud™/Traxmate Flow Guide

Introduction

The main goal of this guide is to describe the complete flow of Semtech’s LoRa Cloud/Traxmate account setup with further launch of the HTTP server and integration between it and the TEKTELIC Network Server.

Requirements

1.The TEKTELIC LoRaWAN® gateway that is onboarded on the TEKTELIC Network Server and is online.
2.The TEKTELIC LoRaWAN® device, STORK or CHICKADEE, that is onboarded on the TEKTELIC Network Server and is online.
3.The user’s HTTP server is available via a public network.
4.The Docker application is installed on the user’s HTTP server.
5.“key.pem” file with the public key of the user’s HTTP server is available.

Please use this this link to manually download the service`s docker image: https://hub.docker.com/r/tektelicdocker/decrypting-application-server

Integration Flow

diagram

LoRa Cloud™

Semtech LoRa Cloud will be deprecated in the nearest time. Traxmate solution is used instead.

Traxmate

This service is intended to be deployed on the Customer’s side when using the “End-to-End Payload Encryption” feature (External Application Server).

It will decrypt the FRMPayload and pass it to configured the HTTP server (for decoding sensor data and futher processing).

Decryption is performed using the AppSKeyEncrypted field + the known KEK (Key Encryption Key).

To obtain Traxmate key, please contact TEKTELIC support

Environment setup

In the directory, where docker image was pulled, create an example.env file.

Put following content inside the example.env file:

AS_KEK_LABEL=as-kek

AS_KEK=AAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCC

UPSTREAM_HOST=http://localhost:8082

NS_HOST=https://lorawan-ns-na.tektelic.com

NS_BASE_PATH=/api/v2/integration/http/069ba6b3c2514e299ec23a8c0c23468c42f67af6aaa84c5e82f1d766027c34f3

WHERE: AS_KEK_LABEL=as-kek - remain unedited

AS_KEK=AAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCC - Traxmate key. Please contact TEKTELIC support to obtain it.

UPSTREAM_HOST: Server address, where decoded data will be delivered.

NS_HOST: TEKTELIC Network Server url.

NS_BASE_PATH: Integration path with the Network Server. (can be found in the Integrations on the Network Server)

Save file.

Launch of the solution

1.Log in to the user’s HTTP server using the terminal.
2.Execute the following command to run the server:

docker run -p 8080:8080 –env-file ./test.env tektelicdocker/decrypting-application-server

To validate that the server has been successfully booted, execute the following command: docker ps

ls_1
3.To check the logs from the server, execute the following command:

docker logs XX

where “XX” is the first two ID numbers of the created Docker container ls_2

TEKTELIC Network Server Integration

1.Open the TEKTELIC Network Server instance.
ns_1
2.Log in using the TEKTELIC Network Server credentials.
ns_2
3.Choose the “Data Converters” section.
ns_3
4.Click on the “+” button to add a new data converter.
ns_4
5.Click on the “Type” drop-down list and choose “Custom”. Replace values in the decoder/encoder fields with the values from the “Data converter” guide section .
ns_5
6.Choose the name for this data decoder and further click on the “Add” button.
ns_6
7.Choose the “Applications” section.
ns_7
8.Click on the application where your STORK or CHICKADEE device is located to open the pop-up menu. Choose “Manage Integrations."
ns_8
9.Click on the “+” button to add a new integration.
ns_9
10.Set up the name for the integration; “Type”: “HTTP”; “Data Converter”: choose the data converter created beforehand; “Application Address”: use the address of the HTTP server with the Docker container; “Port”: 443; “Base Path”: /; “Enable HTTPS”: checked.
ns_10
11.Click on the “Add” button to create an integration.

Data Converter

Decoder:

function decodeUplink(input) {
    return {
        "data": {
            "bytes": input.bytes
        },
        "errors": [],
        "warnings": [],
        "tektelicMetadata": input.tektelicMetadata
    };
}

Encoder:

function encodeDownlink(input) {
    return {
        "fPort": input.data.fPort,
        "bytes": input.data.bytes,
        "errors": [],
        "warnings": []
    };
}