1.0.4 • Published 7 years ago

senshub v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Hub for sensor data

Build Status

Personal project for temperature and humidity sensors.

Example of use

For use, you can install as a service in a raspberry pi with pm2 (http://pm2.keymetrics.io/)

This is an example of pm2 config file:

{
    "apps": [
        {
            "name": "senshub",
            "script": "senshub",
            "args": "-s",
            "watch": true,
            "env_production": {
                "NODE_ENV": "production",
                "INFLUX_HOST": "host",
                "INFLUX_PORT": "port",
                "INFLUX_PROTOCOL": "protocol",
                "INFLUX_USERNAME": "username",
                "INFLUX_PASSWORD": "password",
                "INFLUX_DATABASE": "database"
            },
            "out_file": "/path/to/log_senshub.log",
            "error_file": "/path/to/error_senshub.log",
            "pid_file": "/path/to/senshub_id.pid"
        }
    ]
}

After config this you need to install senshub as global with:

npm i -g senshub

After installed you can add to pm2 and start with:

pm2 start app.json --env production
pm2 startup
pm2 save 

Paths after you start service:

  • Write data: POST /sensor/write (Body paramater names: temperature, humidity, heatIndex, room)
  • Read data: GET /sensor/read (See next section to use query)

Read query string params:

  • Select clause form: param and operation separated by +
    • Operation is optional and it can be: count, max, min, median, mean
    • Param is required and it can be: all, temperature, humidity, heatIndex, room
  • Where clause form: param, operation and value separated by +
    • Param is required and it can be: temperature, humidity, heatIndex, room
    • Operation is required and it can be: eq(equal), gt(greather than), lt(lower than)
    • Value is required and it can be anything.
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-rc.1

7 years ago

1.0.0-beta.6

8 years ago

1.0.0-beta.5

8 years ago

1.0.0-beta.4

8 years ago

1.0.0-beta.3

8 years ago

1.0.0-beta.2

8 years ago

1.0.0-beta.1

8 years ago