goruuvitag

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build Status

Description

This program listens for RuuviTag devices and posts JSON data to HTTP endpoint specified by HTTP_URL environment variable.

Currently support ruuvi sensor protocol 3.

JSON data looks like this:

{
	"Temp": 1.25, <- temperature celcius
	"Humidity": 94.5, <- relative humidity (%)
	"Pressure": 98760, <- atmospheric pressure (Pa)
	"Battery": 2845, <- battery voltage (mV)
	"Address": "D3:C7:D0:2E:14:D7", <- unique device address
	"AccelerationX": -74, <-- acceleration (milli g)
	"AccelerationY": -156,
	"AccelerationZ": 976,
	"TimeStamp": "2017-12-30T15:02:44.3560173+02:00"
}

I currently use this project to record sensor data from Ruuvi Tags around my apartment. The data is posted straight to ElasticSearch index.

ElasticSearch quickstart

Create index

PUT ruuvi/_mapping
{
  "type": {
    "data_point": {
      "properties": {
        "Address": {
          "type": "keyword"
        },
        "TimeStamp": {
          "type": "date"
        },
        "Humidity": {
          "type": "float"
        },
        "Pressure": {
          "type": "float"
        },
        "Battery": {
          "type": "float"
        },
        "Temp": {
          "type": "float"
        },
        "AccelerationX": {
          "type": "integer"
        },
        "AccelerationY": {
          "type": "integer"
        },
        "AccelerationZ": {
          "type": "integer"
        }
      }
    }
  }
}

Start posting data.

$ export HTTP_URL=http://<elasticsearch ip>:9200/ruuvi/data_point
$ ./goruuvitag

TODO

License

Copyright (c) Turkka Mannila

Licensed under MIT license

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址