All Projects → houluy → lora-motes-emulator

houluy / lora-motes-emulator

Licence: MIT License
This is a device (mote) emulator for LoRaWAN protocol(1.0 & 1.1). Completely realized by Python 3.6

Programming Languages

python
139335 projects - #7 most used programming language
Smarty
1635 projects

Projects that are alternatives of or similar to lora-motes-emulator

nrf52-lora
LoRa node on nRF52
Stars: ✭ 24 (+33.33%)
Mutual labels:  lora, lorawan
chirpstack-concentratord
Concentrator HAL daemon for LoRa gateways.
Stars: ✭ 53 (+194.44%)
Mutual labels:  lora, lorawan
WisBlock
Quickstart, tutorials and examples for the RAKwireless WisBlock product line.
Stars: ✭ 95 (+427.78%)
Mutual labels:  lora, lorawan
LoraGW-Setup
SX1301 Lora Concentrator Raspberry PI based gateway setup
Stars: ✭ 70 (+288.89%)
Mutual labels:  lora, lorawan
POST S76G
Power-on Self Test for TTGO T-Motion LoRaWAN GNSS tracker and T-Impulse wristband
Stars: ✭ 16 (-11.11%)
Mutual labels:  lora, lorawan
Upylorawan
ESP32 using MicroPython meets LoRa and LoRaWAN.
Stars: ✭ 121 (+572.22%)
Mutual labels:  lora, lorawan
pycayennelpp
A Cayenne Low Power Payload (CayenneLPP) decoder and encoder for Python
Stars: ✭ 17 (-5.56%)
Mutual labels:  lora, lorawan
Laf
This project intends to provide a series of tools to craft, parse, send, analyze and crack a set of LoRaWAN packets in order to audit or pentest the security of a LoraWAN infrastructure.
Stars: ✭ 119 (+561.11%)
Mutual labels:  lora, lorawan
Penguino-STM32WL-LoRa-E5
This repo contains all the necessary design and fabrication files for the Seeed Studio LoRa-E5 based Penguino Feather breakout board.
Stars: ✭ 30 (+66.67%)
Mutual labels:  lora, lorawan
lora device lib
A LoRaWAN Device Library
Stars: ✭ 30 (+66.67%)
Mutual labels:  lora, lorawan
pyrak811
RAK811 Python 3 library for Raspberry Pi
Stars: ✭ 43 (+138.89%)
Mutual labels:  lora, lorawan
CatWAN USB Stick
An Open Source USB Stick compatible with LoRa and LoRaWAN with Cortex M0+. To connect, review and analyze packages of LoRa®
Stars: ✭ 23 (+27.78%)
Mutual labels:  lora, lorawan
element-parsers
Parsers for LoRaWAN Sensors on ELEMENT-IoT
Stars: ✭ 23 (+27.78%)
Mutual labels:  lorawan, lorawan-device
LMIC-node
LMIC-node | One example to rule them all. LMIC-node is an example LoRaWAN application for a node that can be used with The Things Network. It demonstrates how to send uplink messages, how to receive downlink messages, how to implement a downlink command and it provides useful status information. With LMIC-node it is easy to get a working node qu…
Stars: ✭ 108 (+500%)
Mutual labels:  lorawan, lorawan-device
Lora Serialization
LoraWAN serialization/deserialization library for The Things Network
Stars: ✭ 120 (+566.67%)
Mutual labels:  lora, lorawan
chirpstack-gateway-os
Yocto based gateway images including ChirpStack components.
Stars: ✭ 101 (+461.11%)
Mutual labels:  lora, lorawan
Mainflux
Industrial IoT Messaging and Device Management Platform
Stars: ✭ 1,341 (+7350%)
Mutual labels:  lora, lorawan
Ttgo T Beam Car Tracker
TTGO-T-Beam Arduino Car Tracker - ESP32 + LoRa + GPS + GSM (optional)
Stars: ✭ 106 (+488.89%)
Mutual labels:  lora, lorawan
Recursos-aprendizaje-LoRa-LoRaWAN-e-IoT
Lista de recursos con los que aprender y estar al tanto sobre LoRa/LoRaWAN e Internet de las Cosas
Stars: ✭ 60 (+233.33%)
Mutual labels:  lora, lorawan
sx1278
sx1278 LoRa driver for Stm32 HAL
Stars: ✭ 27 (+50%)
Mutual labels:  lora, lorawan

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™ protocol)

Support LoRaWAN™ 1.0.2 & 1.1 protocol

Using Gateways from Semtech™

System Requirements

  • Ubuntu
  • Python(>=3.6, mandatory)

Installtion

PYPI

  • Use pip to install lora-mote-emulator:

    pip install lora-mote-emulator
    

MANUALLY

  • Use pip to install pipenv:

    pip install pipenv
    
  • Clone this repo into a directory:

    git clone https://github.com/houluy/lora-mote-emulator.git
    
  • Use pipenv to create a virtual Python environment and install all the dependencies:

    pipenv install
    
  • Build the project:

    python -m build
    

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. Otherwise, remove the Pipfile.lock and redo the above command.

  • Enter the virtual environment by pipenv shell
  • Run mote -h to see the help message

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

  • First, we need to create configuration files by command mote create [-c ./config]. Mote will generate required config template JSON files in the ./config directory (default). In the directory, several JSON config files are included.
  • config.json: Basic configurations.
  • gateway.json: Gateway EUI.
  • device.json: Device parameters for OTAA mode.
  • abp.json: Device parameters for ABP mode.

OTAA

  • Modify device infomation in device.json copied. An example:

    {
        "Device": {
            "JoinEUI": "0000000000000000",
            "DevEUI": "0000000000000000"
        },
        "RootKeys": {
            "AppKey": "00000000000000000000000000000000",
            "NwkKey": "00000000000000000000000000000000"
        }
    }
    

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

ABP

  • Modify device activation information in abp.json. An example:

    {
        "deveui": "0000000000000000",
        "joineui": "0000000000000000",
        "devaddr": "00000000",
        "appkey": "00000000000000000000000000000000",
        "nwkkey": "00000000000000000000000000000000",
        "nwksenckey": "00000000000000000000000000000000",
        "snwksintkey": "00000000000000000000000000000000",
        "fnwksintkey": "00000000000000000000000000000000",
        "appskey": "00000000000000000000000000000000",
        "fcntup": 0,
        "version": "1.1"
    }
    
  • Currently, five kinds of message is supported: pull data, join request, rejoin request, confirmed (or unconfirmed) data up (with or without FOpts) and MAC Commands in FRMPayload field:

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:

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].