Skip to content
kirai edited this page Sep 11, 2014 · 9 revisions

Welcome to the tekrice wiki!

Sensor Network elements

Nodes

Nodes are computing elements gathering data from the environment. Each node can have 0 or more sensors attached to it.

Sensors

Each sensor belongs to one node. Sensors gather information in "readings"

Readings

Each reading belongs to a sensor.

Reading API

This is what you will use for storing and accessing readings from sensors.

Get the most recent reading from a sensor

In order to address a sensor a node_id and the sensor within that node must be provided.

GET /reading/node_:node_id/:sensor_alias

Example

Request: GET /reading/node_1/inside_temperature

Response:

{
    "data": [
        {
            "timestamp" : 2014-09-10-11:29:41:468362,
            "value": 29.0
        }
    ],
    "errors": [],
    "request": {},
    "warnings": []
}

Node API

Get all the nodes in the network

Get the node_ids that belong to the current network

GET /node/all

Example

Request: GET /node/all

Response:

{
    "data": [
        {
            "nodes" : [{"node_id" : 1,
                        "node_alias": "Chris Hatake North side",
                        "sensors" : [{"sensor_alias" : "temperature",
                        "latest_reading" : {"value" : 26.0, "time"}},
                        {"sensor_alias" : "distance"}]}]
        }
    ],
    "errors": [],
    "request": {},
    "warnings": []
}