Sensors Connectivity & Decentralized Sensors Network

After assembling a sensor and setting up Sensors Connectivity module it is time to deploy personal decentralized sensor map.

Requirements & Installation

  1. Since the sensor map is powered by JavaScript, first you need to install the node and the yarn manager:

    sudo curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
    sudo apt-get install -y nodejs
    sudo npm install --global yarn
    Bash
  2. Download and build the map:

    git clone https://github.com/airalab/sensors.robonomics.network.git
    cd sensors.robonomics.network/
    yarn install
    Bash
  3. Run the map in development mode for testing

    yarn serve
    Bash
  4. Go to URL from terminal, you should see the sensor map. After that, stop it with Ctrl+C.

Configuration

  1. Find your IPFS ID with:

    $ ipfs id
    {
    	"ID": "QmUZxw8jsRpSx5rWkTpJokPGKvWihTrt5rbRCFXzJ4eCAP",
    	"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/uMV3rLM/C+LOh2DGPo3chr+VM+vyYMKi...
        ...
    Bash
  2. Go to src folder and rename the files:

    cd src
    cp config.template.json config.json
    cp agents.template.json agents.json
    Bash
  3. Insert your IPFS ID in agents.json:

    [
      "QmUZxw8jsRpSx5rWkTpJokPGKvWihTrt5rbRCFXzJ4eCAP"
    ]
    JSON
  4. Open config.json file and change the next part of configuration file:

    ...
      REMOTE_PROVIDER: "",
      WIND_PROVIDER: "",
      MAP: {
        zoom: "8",
        position: {
          lat: "",
          lng: "",
        },
      },
      SHOW_MESSAGES: true,
    };
    JSON

    Here you have to insert latitude (lat) and longitude (lng) of your city. Optionally, you can set up wind direction service and provide URL to it in WIND_PROVIDER field.

Building

  1. Run the following command to build files for release:

    yarn build
    Bash

    It will create dist directory with all components of static website.

  2. To check if everything is correct, move to dist directory and open index.html file. After some time sensor's data from your Sensors Connectivity module will appear on the map.

? Ask question on GitHub