houluy / lora-mote-emulator

This is a device (mote) emulator for LoRaWAN protocol(1.0 & 1.1). Completely realized by Python 3.6
MIT License
22 stars 12 forks source link
lora lorawan lorawan-device

LoRa Mote Emulator

|version| |python| |license|

This is a useful tool to test LoRa server.

To emulate end devices (a.k.a. Motes in |LoRaWAN(TM)| protocol)

Support |LoRaWAN(TM)| 1.0.2 & 1.1 protocol

Using Gateways from |Semtech(TM)|

.. |LoRaWAN(TM)| unicode:: LoRaWAN U+2122 .. |Semtech(TM)| unicode:: Semtech U+2122

System Requirements

Installtion

PYPI


MANUALLY


Here, if there is not Python 3.6 in your system, a warning will occur, and no package will be installed. It is perfect to install Python 3.6 from source <https://www.python.org/downloads/release/python-362/>_. Otherwise, remove the Pipfile.lock and redo the above command.

Usage

::

usage: mote [-h] [-v version] [-c CONFIG] [--model MODEL]
            {join,app,pull,mac,rejoin,info,abp,create} ...

Tool to emulate LoRa mote (a.k.a end-device) and Gateway, supported command
list: ['join', 'app', 'pull', 'mac', 'rejoin', 'info', 'abp', 'create']

optional arguments:
  -h, --help            show this help message and exit
  -v version, --version version
                        Choose LoRaWAN version, 1.0.2 or 1.1(default)
  -c CONFIG, --config CONFIG
                        Specify the directory of config files, default
                        './config'
  --model MODEL         Specify the directory to save the model file, default
                        './models'

Supported commands:
  {join,app,pull,mac,rejoin,info,abp,create}
    join                Send join request.
    app                 Send application data.
    pull                Send PULL_DATA.
    mac                 Send MACCommand.
    rejoin              Send rejoin request.
    info                Show information of current mote.
    abp                 Initialize mote in ABP mode.
    create              Handle configurations.

Tutorial

OTAA


NOTE: If you want to emulate LoRaWAN 1.0 device, first set JoinEUI equal to AppEUI and set NwkKey equal to AppKey.

ABP


NOTE: Always remember to mote pull to keep the gateway alive in server.

::

mote info
mote pull
mote abp
mote join [-n]
mote rejoin 'rejointyp' (0, 1, 2)
mote app 'message' (uplink message, will be encoded by UTF-8) [-auf]
mote mac 'command' (MAC Commands in FRMPayload field)

Here is the example step of interaction with ChirpStack <https://www.chirpstack.io>_:

::

mote pull
mote join -n
mote app helloworld -f 0302
mote main.py mac 0302

Contribution

This repo is hosted on https://github.com/houluy/lora-motes-emulator and under MIT license, any contribution or suggestion is welcome. Just open an issue or send a pull request.

.. |version| image:: https://img.shields.io/badge/LoRaWAN-1.1-orange.svg?style=plastic .. |python| image:: https://img.shields.io/badge/Python-3.6%2C3.7-blue.svg?style=plastic&logo=python .. |license| image:: https://img.shields.io/badge/License-MIT-red.svg?style=plastic