LoRa Network Server

This topic applies only to the MTCDT-xx-210L model.

The network server is the center of a LoRa network, it provides communication between motes and applications. It ensures message integrity through CRC, CMAC and sequence number tracking. AES-128 encryption is enabled through the use of pre-shared keys.

LNS Diagram

Links

Intro to LoRa

Basic Configuration

Advanced Configuration

MQTT Messages

LoRa Query Utility

The LoRa Query Utility provides an easy to use interface to the command port for most operations as an alternative to directly accessing the UDP command port.

lora-query
Version: 1.0.0

Usage: lora-query [-t timeout] [-s] [-n] 
        Simple UDP client utility to pull info from LoRa Network server 
        --timeout (t)     : UDP recv timeout, default: 100 (msecs) 
        --stats (s)       : get LoRa Network server statistics 
        --stats-reset (r) : reset LoRa Network server statistics 
        --node-list (n)   : get Node List 
        --node-config (c) : get Node config 
                ex:    --node-config <NET-ADDR> 
        --node-add (a)    : add node 
                usage: --node-add <NET-ADDR> [CLASS] <APP-EUI> <DEV-EUI> ([APP-KEY] | [NET-SKEY] [APP-SKEY]) 
                ex:    --node-add 00000001 A 16ea76f6ab663d80 4c194e20d396b5f7d3e1551e4cd320de 
        --node-update (u) : update node info 
                usage: --node-update <NET-ADDR> <FIELD-NAME> <VALUE> 
                ex:    --node-update 00000001 class C 
                ex:    --node-update 00000001 appkey 4c194e20d396b5f7d3e1551e4cd320de 
        --node-delete (d) : delete a Node 
                ex:    --node-delete <NET-ADDR> 
        --json (j)        : data in json format 
        --help (?)        : returns this message 
        --version (v)     : print version

Examples

node-list

> lora-query -n
Net Addr     Dev EUI                  Class  Joined                Seq Num       Up     Down      1st      2nd  Dropped  RSSI min   max   avg  SNR min   max   avg
20:00:00:01  00-01-02-03-04-05-06-07  A      2016-03-29T16:22:53Z        0        0        0        0        0        0         0     0     0        0     0     0
20:00:00:02  01-01-01-01-01-01-01-01  A      2016-03-30T19:30:29Z       10        7        8        8        0        0      -109   -84  -102      3.2   9.5   5.7
...

node-config

> lora-query -c 20000001
Net Addr     Dev EUI                  Class  App EUI                  AppKey                            Net Session Key                   Data Session Key                            
20:00:00:01  00-01-02-03-04-05-06-07  A      16-ea-76-f6-ab-66-3d-80  4c194e20d396b5f7d3e1551e4cd320de  d73b3fa1456ced1a86d64dd5b961979d  b31fc5263c66bcdc09a43ad3cd6f33ab

node-add
Add a node for ABP or MANUAL network joining

> lora-query -a 00000001 A 16ea76f6ab663d80 0001020304050607 d73b3fa1456ced1a86d64dd5b961979d b31fc5263c66bcdc09a43ad3cd6f33ab

Add a node for OTA join with unique APPKEY

> lora-query -a 00000001 A 16ea76f6ab663d80 0001020304050607 4c194e20d396b5f7d3e1551e4cd320de

node-delete Remove a node

> lora-query –node-delete 00000001

node-update Update a node configuration setting (appkey | class | nskey | dskey)
Change node class

lora-query –node-update 00000001 class C

Change node appkey

lora-query –node-update 00000001 appkey 4c194e20d396b5f7d3e1551e4cd320de

 

Command Interface

Connect using netcat

nc -u localhost 6677

or

echo "$x" > /dev/udp/localhost/6677

Where $x is the command to execute.

LoRa Network Server Commands 1.0.32

  • database backup

LoRa Network Server Commands 1.0.26

  • node keygen <DEV-EUI> [APP-EUI] – zero touch key generation

LoRa Network Server Commands 1.0.8

    • config – display config
    • stats – display stats
    • stats reset – reset network server stats
    • print error|warning|info|debug|trace – change debug output level
    • node list – list nodes
    • node add <NET-ADDR> [CLASS] <APP-EUI> <DEV-EUI> { [APP-KEY] | [NET-SKEY] [APP-SKEY] }
      • ABPA
        node add <NET-ADDR> [CLASS] <APP-EUI> <DEV-EUI> [NET-SKEY] [APP-SKEY]
        node add 00000001 A 0011223344556677 7766554433221100 00112233445566777766554433221100 77665544332211007766554433221100
      • OTAA with unique APP-KEY
        node add <NET-ADDR> [CLASS] <APP-EUI> <DEV-EUI> [APP-KEY]
        node add 00000001 A 0011223344556677 7766554433221100 00112233445566777766554433221100
    • node delete <NET-ADDR> – delete a node
    • node config <NET-ADDR> – show node config
    • node update <NET-ADDR> (class | appkey | nskey | dskey) <VALUE> – update a config setting
      • change existing node to class C
        node update 00000001 class c
      • change existing node APP-KEY
        node update 00000001 appkey 00112233445566777766554433221100
    • node reset <NET-ADDR> – reset node counters
    • ping – print alive message
    • include <FILENAME> – Read commands from file

LoRa Network Server Commands 0.9.2

    • config – display config
    • stats – display stats
    • stats reset – reset network server stats
    • print error|warning|info|debug|trace – change debug output level
    • node list – list nodes
    • node add <NET-ADDR> <APP-EUI> <DEV-EUI> [NET-SKEY] [APP-SKEY]
    • node delete <NET-ADDR> – delete a node
    • node reset <NET-ADDR> – reset node stats
    • ping – print alive message
    • include <FILENAME> – Read commands from file