GithubHelp home page GithubHelp logo

isabella232 / router-3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from helium/router

0.0 0.0 0.0 3.15 MB

router combines a LoRaWAN Network Server with an API for console, and provides a proxy to the Helium blockchain

License: Apache License 2.0

Makefile 0.14% Erlang 99.69% Dockerfile 0.05% Shell 0.11%

router-3's Introduction

Helium Router CI BUILD_AND_PUSH_IMG

Helium's LoRa Network Server (LNS) backend.

Usage

Testing / Local

# Build
make docker-build

# Run
make docker-run

# Running tests
make docker-test

Production

Image hosted on https://quay.io/repository/team-helium/router.

The docker-compose in this repo is an example and only runs Router and metrics server (via prometheus) please see https://github.com/helium/console to run full LNS stack.

# Build
docker-compose build --force-rm

# Up
docker-compose up -d

# Down
docker-compose down

# Tail logs
docker-compose logs -f --tail=20

# Get in container
docker exec -it helium_router bash

Data

Data is stored in /var/data.

WARNING: The swarm_key file in the blockchain directory is router's identity and linked to your OUI (and routing table). DO NOT DELETE THIS EVER.

Logs

Logs are contained in /var/data/log/router.log, by default logs will rotate every day and will remain for 7 days.

Config

Config is in .env. See .env-template for details.

Full config is in config/sys.config.src.

Router's deafult port for blockchain connection is 2154.

Prometheus template config file in prometheus-template.yaml.

CLI

Commands are run in the routerv3 directory using a docker container.

NOTE: sudo may be required

docker exec -it helium_router _build/default/rel/router/bin/router [CMD]

Following commands are appending to the docker command above.

Device Worker device

All Devices

device all

Info for a single device

device --id=<id>
Id Option

--id Device IDs are binaries, but should be provided plainly.

# good
device --id=1234-5678-890
# bad
device --id=<<"1234-5678-890">>

Single Device Queue

device queue --id=<id>
Options

ID Options

Clear Device's Queue

device queue clear --id=<id>
Options

ID Options

Add to Device's Queue

device queue add --id=<id> [--payload=<content> --channel-name=<name> --port=<port> --ack]
Options

--id ID Options --payload [default: "Test cli downlink message"] Set custom message for downlink to device.

--channel-name [default: "CLI custom channel"] Channel name Console will show for Integration.

--port [default: 1] Port to downlink on.

--ack [default: false] Boolean flag for requiring acknowledgement from the device.

Trace a device's logs

device trace --id=<id>
Options

ID Options

Stop trancing device's logs

device trace stop --id=<id>
Options

ID Options

Force XOR Filter push

device xor
Options

XOR will only happen if --commit is used, otherwise it will be a dry run.

DC Tracker dc_tracker

All Orgs

dc_tracker info all [--less 42] [--refetch]
Options

--less <amount> Filter to Organizations that have a balance less than <amount>.

--refetch Update Router information about organizations in list.

Info for 1 Org

dc_tracker info <org_id> [--refetch]
Options

--refetch Update Router information about this organization.

Refill Org Balance

dc_tracker refill <org_id> balance=<balance> nonce=<nonce>

Helpers

dc_tracker info no-nonce
dc_tracker info no-balance

are aliases for

dc_tracker info nonce <amount=0>
dc_tracker info balance <balance=0>

Integrations Data

Data payload example sent to integrations

{
    "id": "device_uuid",
    "name": "device_name",
    "dev_eui": "dev_eui",
    "app_eui": "app_eui",
    "metadata": {},
    "fcnt": 2,
    "reported_at": 123,
    "payload": "base64 encoded payload",
    "payload_size": 22,
     // ONLY if payload is decoded
    "decoded": {
        "status": "success | error",
        "error": "...",
        "payload": "..."
    },
    "port": 1,
    "devaddr": "devaddr",
    "hotspots": [
        {
            "id": "hotspot_id",
            "name": "hotspot name",
            "reported_at": 123,
            "status": "success | error",
            "rssi": -30,
            "snr": 0.2,
            "spreading": "SF9BW125",
            "frequency": 923.3,
            "channel": 12,
            "lat": 37.00001962582851,
            "long": -120.9000053210367
        }
    ],
    "dc" : {
        "balance": 3000,
        "nonce": 2
    }
}

Metrics

Coming soon...

router-3's People

Contributors

amirhaleem avatar andymck avatar jadeallenx avatar jaykickliter avatar lthiery avatar macpie avatar michaeldjeffrey avatar vagabond avatar vihu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.