Conduit mLinux: LoRa Use With Third-Party Devices

The mLinux version of Conduit (MTCDT-xx-210L) supports OTA (over-the-air) joining by third-party LoRa devices as of LoRa Network Server version 0.0.7 (If you need to upgrade, refer to Upgrade LoRa Server & Packet Forwarder).

mLinux >= 3.3.22, lora-network-server >= 2.0.16

Network Server Whitelist

Add unique device records into the whitelist devices list in lora-network-server.conf. The appeui will be attached to received packets. The class setting will be used to configure the end-device when it joins.

`{“deveui”:”008000000000e19c”, “appeui”:”008000000000e19c”, “appkey”:”008000000000e19c008000000000e19c”, “class”:”C”}`

LoRa Query Commands

admin@mtcdt:~# lora-query -x help
MTS Lora Server Command Help

Commands:
stats - list current stats
  reset - reset stats for network, gateways and end-devices
gateway - gateway commands
  list - list connected gateways
      format: gateway list [json]
  delete - remove a gateway from the list
      format: device gateway <GW-EUI>
device - end-device commands
  add - add a new end-device record
      format: device add <DEV-JSON>
      example: device add '{"deveui":"00-80-00-00-00-00-e1-9c","class":"C"}'
  stats - show end-device statistics
  update - update end-device configuration or session info
      format: device update <DEV-EUI> <FIELD> <VALUE>
      example: device update 00-80-00-00-00-00-e1-9c class C
      fields: class, nskey, dskey, ulc, dlc
      format: device update <DEV-JSON>
      example: device update '{"deveui":"00-80-00-00-00-00-e1-9c","class":"C"}'
      fields: class, name, serial_number, product_id, 
              hardware_version, firmware_version, lorawan_version
  delete - delete an end-device configuration, session and packet records
      format: device delete <DEV-EUI>
  config - show configuration for a specific device
  reset - reset end-device session counters
      format: device reset <DEV-EUI>
  list - list end-devices configured in the network server
      format: device list [json | json file <path>]
      example: device list json
      example: device list json file /tmp/devices.json
  keygen - generate a unique end-device key using zero-touch settings
      format: device keygen <DEV-EUI> [APP-EUI]
session - session commands
  add - add a session for a device
      format: session add <DEV-JSON>
      example: session add '{"deveui":"00-80-00-00-00-00-e1-9c",
        dev_addr":"00112233", "appeui":"00-88-88-88-00-00-e1-9c",
        "joineui":"00-99-99-99-00-00-e1-9c","net_id":"000017", 
        "app_senc_key":"531bd9c5ec5d8ba5ef3b262cebfb3e66", 
        "fnwk_sint_key":"531bd9c5ec5d8ba5ef3b262cebfb3e66"}'
      fields: deveui, appeui, joineui, dev_addr, net_id, 
              app_senc_key, fnwk_sint_key
  delete - remove a device session
      format: session delete <DEV-EUI>
  reset - reset session counters
      format: session reset <DEV-EUI>
  list - show current device sessions
      format: session list [json | json file <path> ]
      example: session list jsonvi /
      example: session list json file /tmp/sessions.json
packet - packet commands
  join - list all validated join packets
      format: packet join [json]
  up - list all validated uplink packets
      format: packet up [json]
  down - list all downlink packets
      format: packet down [json]
  list - list all packets: join, up and down
      format: packet list [json]
  queue - list downlink queue packets to be sent to end-device
      format: packet queue [json]
    add - add a packet to the downlink queue
      format: packet queue add <PACKET-JSON>
      fields: deveui, data, ack, ack_retries, rx_wnd
    delete - delete all downlinks for a specific device
      format: packet queue delete <DEV-EUI>
    delete - delete one downlink for a specific device
      format: packet queue delete <DEV-EUI> 
database - database commands
  backup - backup database to flash memory
config - show network server configuration
debug - change debug level
ping - ping the network server command port
help - display this help
quit - command network server process to stop

- add 'json' modifier to request output in json

mLinux < 3.3.22, lora-network-server <= 1.0.43

 

OTA Join Setup

Configure the following settings in /var/config/lora/lora-network-server.conf:

  • Set network[“public”] to true
    • This changes the join response time from 1 to 5 seconds and the sync word from 0x12 to 0x34
    • NOTE: Public mode must also be enabled on mDots in order for them to remain compatible
  • Set network[“eui”] to an 8 hex byte value.
  • Set network[“key”] to a 16 hex byte value.
  • Save the file
  • Restart the Lora network server: /etc/init.d/lora-network-server restart

Third-party LoRa devices should now be able to join the Conduit’s LoRa network using OTA join. For more information on these settings, refer to Conduit mLinux: Advanced LoRa Configuration.

 

Manual Join/Activation by Personalization

  • SSH into the Conduit (default IP: 192.168.2.1, default credentials: root/root)
    # ssh root@192.168.2.1
  • Then run this command to start a LoRa server configuration console
    # nc -u localhost 6677
  • Add a node like this
    # node add [DevAddr] [APPEUI] [DEVEUI] [NwkSKey] [AppSKey]

 

Example:

# nc -u localhost 6677
node add 00000005 0011223344556677 8811223344556677 2b7e151628aed2a6abf7158809cf4f3c 2b7e151628aed2a6abf7158809cf4f3c
NOTE (US915): While this should get your sensors working using personalization, you’ll only receive, on average, 1 out of 8 sensor transmissions because your third-party device will be randomly transmitting on 1 of 64 channels, but the Conduit can only listen on 8 channels. The lora[“frequencySubBand”] setting on the LoRa config file determines which 8 channels it’ll listen on (1-8, 9-16, …).

 

Troubleshooting

Use the following troubleshooting steps to either track down issues on your own or include a capture of the responses/results below in a forum topic or support case.

  • SSH into the Conduit (default IP: 192.168.2.1, default credentials: root/root)
    # ssh root@192.168.2.1
  • Go to the /var/config/lora/ folder and modify the lora-network-server.conf file with the log level set to 100. Save it and issue the following command:
    /etc/init.d/lora-network-server restart
  • Run your test again, then provide the log: /var/log/lora-network-server.log
  • Issue the following command and capture the output:
    /opt/lora/lora-network-server --version
    cat /etc/issue
  • What brand is the mote?
  • What are the mote’s settings and log output?