Skip to content

The daemon that handles scraping the server for lumen sensor data (node c).

Notifications You must be signed in to change notification settings

GoCreate-LoRaWAN/Loralux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loralux daemon

This daemon handles scraping a LoRaWAN server for lumen sensor data points. This repository also contains a test server that can be used to test the loralux daemon.

Table of Contents

Running

Dependencies

The only dependencies to run the services in this repository are:

  • docker
  • docker-compose

Configuration

The loralux daemon can be configured either via environment (default), or by file. If you want to configure the daemon via a file, you must pass the -envFile= flag when running the daemon, giving it the path to either a JSON or YAML file containing configuration values.

From Environment

The program looks for the following environment variables:

  • LORALUX_LOG_LEVEL: The log level for the loralux daemon to use when logging, effectively filtering some statements. See the zap documentation here for allowed levels (Default: 0 (InfoLevel)).
  • LORALUX_SERVER_ADDRESS: The server address of the LoRaWAN server to scrape (Default: http://localhost:8080).
  • LORALUX_SCRAPE_ENDPOINT: The endpoint that should be used with the server address to scrape (Default: /scrape)
  • LORALUX_SCRAPE_INTERVAL: The interval that the server and endpoint tandems will be scraped at (Default: 5s).
  • LORALUX_READ_TIMEOUT: The time of the read timeout of any outgoing read requests made by the internal HTTP server (Default: 10s).

If the environment variable has a supplied default and none are set within the context of the host machine, then the default will be used.

From File

If you opt to set the daemon's configuration via a file, the following structures will need to be used for JSON or YAML, respectively (in the following examples all fields will be set to their defaults, for granular descriptions of these fields, see their equivalents in From Environment):

JSON:

{
    "logLevel": 0,
    "serverAddress": "http://localhost:8080",
    "scrapeEndpoint": "/scrape",
    "scrapeInterval": "5s",
    "readTimeout": "10s",
}

YAML:

logLevel: 0
serverAddress: http://localhost:8080
scrapeEndpoint: /scrape
scrapeInterval: 5s
readTimeout: 10s

Make Rules

To run the services simply execute the following command:

make run

This will stop any containers defined by the compose file if already running and then rebuild the containers using the compose file.

To retrieve the logs of the services:

make logs

To stop the services:

make stop

To remove all networks and volumes that the services have created (effectively allowing you to start from a clean state upon the next run):

make down

About

The daemon that handles scraping the server for lumen sensor data (node c).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published