Configuration Options Description

Basically, you can think of the package as a black box with one input (sensor data) and many outputs. For now only SDS011 sensor is supported, but if you are familiar with Python it'd be easy to add other sensors as well.

Have a look at configuration file:

# Please DO NOT edit this file
# Make a copy instead, make changes and pass the absolute path to the copy in arguments
general:
  publish_interval: 30  # time between two published messages
comstation:
  enable: true
  port: "/dev/ttyUSB0"  # COM port of the device
  work_period: 300      # time between two measurements in seconds
  geo: ""               # Geo coordinates as latitude,longitude
  public_key: ""        # If not provided, COMStation creates itself
tcpstation:
  enable: true
  address: "0.0.0.0:31313"  # IP and PORT to listen to, 0.0.0.0:31313 means available for everyone
  acl:                  # list of known addresses. If not specified accepts from everyone
  # -
  # -
luftdaten:
  enable: true          # whether or not publish to https://luftdaten.info/
robonomics:
  enable: true          # enable use of Robonomics Network
  ipfs_provider: "/ip4/127.0.0.1/tcp/5001/http" # ipfs endpoint
  ipfs_topic: "airalab.lighthouse.5.robonomics.eth"
datalog:
  enable: false         # enable use of Datalog Robonomics subcommand
  path: ""              # path to Robonomics execution file
  suri: ""              # private key of publisher account
  remote: "wss://substrate.ipci.io"
  dump_interval: 3600   # time between two transactions in seconds
  temporal_username: "" # Temporal.Cloud credentials
  temporal_password: ""
dev:
  sentry: ""

At the moment it's possible to publish data to Luftdaten, Robonomics Network and Datalog. The last one is experimental!

DO NOT edit config/default.yaml file. Instead make a copy

Play around with the configuration!

Explanation of options:

FieldDescription
general/publish_intervalinteger number from 1 and above. Tells how often send measurements. Keep in mind that if measurements from sensors come less often than this number connectivity sends last data
comstation/enabletrue/false. Enabling/disabling the station
comstation/portvalid path to com port, for example /dev/ttyUSB0. It is where a sensor is connected to
comstation/work_periodinteger from 0 to 1800. For SDS011 sensor 0 means continuous work. Recommended period is 300 seconds
comstation/geolat,lon a string with two floats separated by a comma. It represents latitude and longitude of a sensor
comstation/public_keyEd25519 verifying key in hex format. If not provided connectivity generates a new one
tcpstation/enabletrue/false. Enabling/disabling the station
tcpstation/addresswhat address and port listen to. If you are willing to make it open for external connections put 0.0.0.0 as an address. 31313 is a port chosen by the developers. You can pick any port you want, but don't forget to change the port in an ESP firmware.
tcpstation/acla list of known public keys in hex format
luftdaten/enabletrue/false. Whether or not publish data to Luftdaten. Don't forget to register the sensor's mac address on the site
robonomics/enabletrue/false. Whether or not publish data to IPFS topic according to Robonomics communication protocol
robonomics/ipfs_provederan endpoint for IPFS daemon. By default it's /ip4/127.0.0.1/tcp/5001/http that means local daemon. The endpoint must by in multiaddr format. For example for Infura.io it would be /dns/ipfs.infura.io/tcp/5001/https
robonomics/ipfs_topicIPFS topic's name. If you want to use DApp provided by Robonomics team leave it untouched
datalog/enabletrue/false. Enable/Disable saving log to Robonomics on Substrate chain
datalog/pathfull path to robonomics executable file. You can find the latest release on this page
datalog/suria private key from substrate chain account
datalog/remotean endpoint to substrate instance
datalog/dump_intervalspecify a period of time for collecting log in seconds
datalog/temporal_usernameset username to upload files to Temporal.Cloud
detalog/temporal_passwordset passward to upload files to Temporal.Cloud
dev/sentryfor development purpose. If you have a Sentry.io account you can put sentry's credentials in here

Scenario #1: Connect SDS011 to serial port

The easiest and the most straightforward way to connect your sensor to the network is using the serial port

Connect you SDS011 sensor to a USB port, let's assume it got /dev/ttyUSB0 address

general:
  publish_interval: 30 
comstation:
  enable: true
  port: "/dev/ttyUSB0"
  work_period: 300      
  geo: "59.944954,30.294534"
  public_key: "" 
tcpstation:
  enable: false
  address: "0.0.0.0:31313" 
  acl:                  
luftdaten:
  enable: true 
robonomics:
  enable: true
ipfs_provider: "/ip4/127.0.0.1/tcp/5001/http"
  ipfs_topic: "airalab.lighthouse.5.robonomics.eth"
datalog:
  enable: false         
  path: ""              
  suri: ""              
  remote: "wss://substrate.ipci.io"
  dump_interval: 3600   
  temporal_username: "" 
  temporal_password: ""
dev:
  sentry: ""

Scenario #2: Connect SDS011 via TCP

ESP Board Preparation

First you need to generate a signing/verifying keys pair and upload the firmware. Go to Firmware Upload

Connectivity Configuration

general:
  publish_interval: 30 
comstation:
  enable: false 
  port: "/dev/ttyUSB0"
  work_period: 300      
  geo: "59.944954,30.294534"
  public_key: "" 
tcpstation:
  enable: true
  address: "0.0.0.0:31313" 
  acl:                  
luftdaten:
  enable: false 
robonomics:
  enable: true
ipfs_provider: "/ip4/127.0.0.1/tcp/5001/http"
  ipfs_topic: "airalab.lighthouse.5.robonomics.eth"
datalog:
  enable: false         
  path: ""              
  suri: ""              
  remote: "wss://substrate.ipci.io"
  dump_interval: 3600   
  temporal_username: "" 
  temporal_password: ""
dev:
  sentry: ""

Do not forget to open the port in system firewall

On NixOS you can do:

networking.firewall.allowedTCPPorts = [ 31313 ];

Scenario #3: Connect Multiple Sensors and Publish to Datalog

In order to upload a firmware to ESP board read ESP Board Preparation section.

Install Robonomics

From root user do:

echo "https://github.com/airalab/airapkgs/archive/nixos-unstable.tar.gz nixos" > /root/.nix-channels
nix-channel --update

Then edit /etc/nixos/configuration.nix and add:

...
  environment.systemPackages = with pkgs; [
        substrate-node-robonomics-bin
  ];
...

Run rebuild and find out where robonomics is:

nixos-rebuild switch
whereis robonomics

Let's assume you got the following path: /nix/store/2gz2ik17w5xad8w819bsb05a23pbjbya-system-path/bin/robonomics

Configuration

general:
  publish_interval: 30 
comstation:
  enable: false 
  port: "/dev/ttyUSB0"
  work_period: 300      
  geo: "59.944954,30.294534"
  public_key: "" 
tcpstation:
  enable: true
  address: "0.0.0.0:31313" 
  acl:                  
luftdaten:
  enable: false 
robonomics:
  enable: true
ipfs_provider: "/ip4/127.0.0.1/tcp/5001/http"
  ipfs_topic: "airalab.lighthouse.5.robonomics.eth"
datalog:
  enable: true
  path: "/nix/store/2gz2ik17w5xad8w819bsb05a23pbjbya-system-path/bin/robonomics"              
  suri: "0x..."              
  remote: "wss://substrate.ipci.io"
  dump_interval: 3600   
  temporal_username: "temporaluser"  # optional 
  temporal_password: "temporalpass"  # optional
dev:
  sentry: ""