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:

{
   "general":{
      "publish_interval":30
   },
   "comstation":{
      "enable":false,
      "port":"/dev/ttyUSB0",
      "work_period":300,
      "geo":"",
      "public_key":""
   },
   "httpstation":{
      "enable":true,
      "port":8001
   },
   "mqttstation": {
      "enable": true,
      "host": "connectivity.robonomics.network",
      "port": 1883
   },
   "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":""
   }
}

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.json 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
httpstation/enabletrue/false. Enabling/disabling the station
httpstation/portwhat port listen to
mqttstation/enabletrue/false. Enabling/disabling the station
mqttstation/hostthe hostname or IP address of the remote broker
mqttstation/portthe network port of the server host to connect to
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 (Optional)
detalog/temporal_passwordset password to upload files to Temporal.Cloud (Optional)
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":""
   },
   "httpstation":{
      "enable":false,
      "port":8001
   },
   "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 HTTP

Connectivity Configuration

{
   "general":{
      "publish_interval":30            
   },
   "comstation":{
      "enable":false,
      "port":"/dev/ttyUSB0",
      "work_period":300,
      "geo":"59.944954,30.294534",
      "public_key":""
   },
   "httpstation":{
      "enable":true,
      "port":8001
   },
   "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":""
   }
}

Do not forget to open the port in system firewall

On NixOS you can do:

networking.firewall.allowedTCPPorts = [ 31313 ];

Scenario #3: Connect SDS011 via MQTT

Connectivity Configuration

{
   "general":{
      "publish_interval":30
   },
   "comstation":{
      "enable":false,
      "port":"/dev/ttyUSB0",
      "work_period":300,
      "geo":"",
      "public_key":""
   },
   "httpstation":{
      "enable":true,
      "port":8001
   },
   "mqttstation": {
      "enable": true,
      "host": "connectivity.robonomics.network",
      "port": 1883
   },
   "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 #4: Connect Multiple Sensors and Publish to Datalog

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":""
   },
   "httpstation":{
      "enable":true,
      "port":8001
   },
   "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":true,
      "path":"/nix/store/2gz2ik17w5xad8w819bsb05a23pbjbya-system-path/bin/robonomics",
      "suri":"0x...",
      "remote":"wss://substrate.ipci.io",
      "dump_interval":3600,
      "temporal_username":"temporaluser",
      "temporal_password":"temporalpass"
   },
   "dev":{
      "sentry":""
   }
}
← Sensors-Connectivity Terminal Readme Connect an Amazon FreeRTOS device to Robonomics by MQTT →