Skip to content

Onboard Semtech modem on ThingPark Wireless

Notifications You must be signed in to change notification settings

actility/Semtech-Modem-Getting-Started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Evaluating Semtech modem using ThingPark Wireless

RaphaelApfeldorfer-Actility edited this page on Oct 21th, 2019

Introduction

This guide will direct you through the process of getting started with developing a secure LoRaWAN end device product using Semtech modem along with ThingPark Wireless Network Server DEV1 for partners

This guide describes the following:

  1. Get a ThingPark Partner account
  2. Collect the Device identifiers
  3. Claim device in Semtech JS
  4. Provision/Activate device in ThingPark Wireless

Get a partner account for ThingPark Wireless

To request an account on ThingPark Wireless that can operate with Semtech modem, post the following email

To: semtech-modem@actility.com
Subject: ThingPark Activation evaluation
Mail: Please provide me a free test account for ThingPark Activation.
Account Name: Paul Smith
Company:      Acme
Login email:  paul.smith@acme.com
Project:      Gas meter in Europe
Timeline:     Mass production end of 2020
URL:          https://www.acme.com/products/gasmeter.html

Please anticipate your request as it may requires a few days to be processed.

Collect the Device identifiers

In order to commission a Semtech modem in ThingPark Wireless, the following idenfiers are required:

  • DevEUI: LoRaWAN device 64-bit unique identifier assigned by the Device manufacturer (or using Secure Element default value)
  • JoinEUI: LoRaWAN JS 64-bit unique identifier of the Join Server on which AppKey of the device is stored
  • PIN code: Device secret code allowing to claim device in Semtech JS

Connect to the Semtech modem evaluation kit with serial port at baud rate=115200 bps, and trigger the Evaluation mode using the following sequence:

  1. Press and hold down the User button (blue) on the Nucleo board.
  2. While holding down the User button, press and release the Reset button (black)
  3. Continue to hold down User button for at least 5 seconds and release the User button

Then input the following commands

>------- Evaluation Mode ---------<

 Type 'h' to view available commands

> GetDevEui
> GetJoinEui
> GetPin

Please refer to Semtech Modem User Guide for more details.

Provision device in Semtech Join Server

Claim device in Semtech Join Server

Go on your Semtech Developer Portal JS account

Click on Network Servers

Select Network Server=Actility ThingPark Wireless DEV1 and press Add, and Save networks Servers

Add Actility NS

Click on Devices

Semtech device

Select Claim Individual device and input DevEUI and PIN previously retrieved

Claim device

Set Wrapping keys for AppSKey

AppSKey might be delivered by the Join Server to Network Server (and then Application Server) in clear text or encrypted with a Key Encryption Key. In order to setup how AppSKey is delivered, go to Keys and Credentials

Setup KEK

By default, AppSKey is delivered in clear text (no wrapping key). You can use this default but ThingPark Wireless supports any type.

Provision/Activate device in ThingPark Wireless

Create Application Server and routing profile

To create a new Application Server routing profile, first create a local Application Server.

Click on Application Servers, Add Application servers -> Create and select Type=HTTP Application Server (LoRaWAN)

Create AS

Select Content Type according to your Application Server requirement, but note that the Application Server must support end-to-end encryption (see Activate device). Then add the destination route by clicking Route -> Add.

Create AS route

Once the Application Server is created, create an Application Server routing profile. Click on AS routing profiles -> Create and select Type=Local application server and your Destination.

Create AS routing profile

Provision device in Network Server

Login your ThingPark DEV1 partner account and open Device Manager The device is provisioned as usual, except no AppKey needs to be provided to the Network Server

Click on Add Device -> Create

Create Device

Select Manufacturer = Generic and your LoRaWAN device profile, activation type and fill in the DevEUI/AppEUI retrieved previously (note that AppEUI is the JoinEUI previously retrieved, which was the initial name in specifications earlier than LoRaWAN1.0.3).

It is mandatory to select a Connectivity Plan and an Application Server routing Profile for your device to be fully provisioned and ready to be activated.

Device creation fields

Activate device

The device is now ready to be activated. Power the board and set it in evaluation mode as done previously in Collect the Device identifiers. Then input the following commands for EU868 and send "HELLO" message:

>------- Evaluation Mode ---------<

 Type 'h' to view available commands

> setregion 1
> join
> requesttx 102 0 72 69 76 76 79

LoRaWAN data can be monitored using Wireless Logger. Note that data is shown encrypted in Wireless Logger and the payload is delivered to the Application Server encrypted with the AppSKey.

If your Application Server does not support end-to-end security, you can decode payload manually.

First, send data to an HTTP capture service such as hookbin. Copy the (Hookbin) endpoint address to ThingPark Wireless as the destination of the Application Server created in Create Application Server, then trigger an uplink on the board and refresh the Hookbin page:

Retrieve link from Hookbin

In <DevEUI_uplink> document, the applicative payload is present in <payload_hex> and the AppSKey in <AppSKey>. AppSKey is either in clear or encrypted depending on the setting selected in Semtech JS in Set Wrapping keys for AppSKey.

Using pyThingPark package (available on Python 3 only, install with pip3 install pyThingPark), you can easily decode the "DevEUI_uplink" frame using the following code:

    >>> hookbinUL = '{"DevEUI_uplink": {"Time": "2019-10-22T17:55:21.281+02:00","DevEUI": "0016C001FF0000A7","FPort": 102,"FCntUp": 3,"ADRbit": 1,"MType": 2,"FCntDn": 0,"payload_hex": "6b349c7db3","mic_hex": "88319eb6","Lrcid": "00000127","LrrRSSI": -59.000000,"LrrSNR": 9.500000,"SpFact": 7,"SubBand": "G0","Channel": "LC3","DevLrrCnt": 1,"Lrrid": "C0001565","Late": 0,"LrrLAT": 0.000000,"LrrLON": 0.000000,"Lrrs": {"Lrr": [{"Lrrid": "C0001565","Chain": 0,"LrrRSSI": -59.000000,"LrrSNR": 9.500000,"LrrESP": -59.461838}]},"CustomerID": "100118249","CustomerData": {"alr":{"pro":"LORA/Generic","ver":"1"}},"ModelCfg": "0","AppSKey": "6196ceaf3eb5f44921e47717f68f8d66","InstantPER": 0.000000,"MeanPER": 0.000000,"DevAddr": "042910AB","AckRequested": 0,"rawMacCommands": "","TxPower": 16.000000,"NbTrans": 1}}'
    >>> from pyThingPark import uplinkTunnel 
    >>> uplink = uplinkTunnel.DevEUI_uplink(hookbinUL)
    >>> clearPayload = uplink.decryptPayload(ASTK=None)
    >>> bytearray.fromhex(clearPayload).decode()
    'HELLO'

Support

Should you need support or if you have any feedback, please contact Actility support by entering a support case request at partner@actility.com.

About

Onboard Semtech modem on ThingPark Wireless

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published