Skip to content
fpallas edited this page Mar 6, 2017 · 16 revisions

Welcome to the opensense.network data-donation wiki. We're just gettig started, so here is a rudimentary "Getting started"

Getting started

We assume an existing Linux installation (eg, on a RaspberryPi or similar) that should be used for donating data of whatever kind (more on that later). The easiest way to do so is using our install script. For this, type the following commands, one after the other:

  • wget https://raw.githubusercontent.com/opensense-network/data-donation/master/tools/install/install-opensensenet-donation.sh
  • chmod 775 install-opensensenet-donation.sh
  • ./install-opensensenet-donation.sh

Basic Configuration

  • If you don't already have a user on the opensense.network platform, create one.
  • Edit the general config-file, e.g., sudo nano /opt/opensensenet/config/opensensenet.config.json
  • Set the parameters "username" and "password" according to your account
  • Save and exit (in nano: Ctrl-O, return, Ctrl-X)

Activate Donation Agents

Now, we have to activate the donation agents we want to use. To do so:

  • Edit the config file for agent activation, e.g., sudo nano /opt/opensensenet/config/opensensenet-donation.config.json
  • For each agent you want to use, substitute "false" by "true"
  • Save file and exit

Most agents require some additional configuration. See agent-specific information from the List of Donation Agents

Scan for Available Sensors

Once the different agents are configured, let all agents scan for available data points:

  • sudo service opensensenet-donation discover (this may take a while)

Choosing and Configuring Sensors for Donation

Once the discovery process is finished, you can choose and configure sensors for donation. This is done separately in the agent-specific config file. For instance, to donate sensor data from an OpenHAB Agent, do the following steps:

  • Edit agent-specific config file, e.g., sudo nano /opt/opensensenet/config/openhabagent.config.json (or another config-file according to the agent you want to configure)
  • Look for a section of the config-file named "sensor_mappings". Here, you will find several entries (typically one per discovered sensor), each specifying some parameters for this sensor. We are particularly interested in the following:
    • local_id: should be pre-filled with the local sensor id as found during discovery. This lets you know which sensor this configuration part refers to.
    • remote_id: this is the remote ID to be used on the opensense.network platform. We will configure this in the next step (see below).
    • measurand: specifies what the sensor actually measures (temperature, humidity, ...). Depending on the donation agent and the sensor type, this field might be empty or pre-filled
    • unit: specifies the unit of measurements (celsius, percent, ...). Depending on the donation agent and the sensor type, this field might be empty or pre-filled
  • Identify the sensors that you actually want to donate from. For each of these, make the following changes:
    • If not properly filled automatically, set the "measurand"- and the "unit"-parameter to what the respective sensor actually measures. For possible options see the list of available measurands and units
    • Set "remote_id" to "create" to automatically create a sensor on the opensense.network platform according to the above two settings on next startup
  • Save and exit

Restarting

Almost done! Now we just have to restart the whole thing to get data donation up and running:

  • sudo service opensensenet-donation restart
  • If you want to see what's happening, take a look at the log: tail -f /opt/opensensenet/log/opensensenet-donation.log

Clone this wiki locally