#ruuvi #ruuvitag #telegraf

app ruuvitag-listener

Print RuuviTag measurements in Telegraf compatible format

7 releases (4 breaking)

0.5.1 May 23, 2020
0.4.1 Feb 29, 2020
0.3.1 Jan 5, 2019
0.2.0 Jan 3, 2019
0.1.0 Dec 16, 2018

#70 in Embedded development

Download history 30/week @ 2020-04-13 2/week @ 2020-04-20 1/week @ 2020-04-27 1/week @ 2020-05-04 18/week @ 2020-05-11 10/week @ 2020-05-18 11/week @ 2020-05-25 22/week @ 2020-06-01 2/week @ 2020-06-08 7/week @ 2020-06-15 7/week @ 2020-06-29 7/week @ 2020-07-06 14/week @ 2020-07-13 23/week @ 2020-07-20 2/week @ 2020-07-27

59 downloads per month

MIT license

18KB
438 lines

RuuviTag Listener

A command-line client to listen to RuuviTag Bluetooth LE sensor measurements and output as InfluxDB line protocol. Binary downloads for x86 and ARM are available for releases.

The output could be e.g. piped to Telegraf Socket Listener with netcat. For an example setup, check out examples/telegraf.

Requirements

  • Linux with BlueZ bluetooth stack

Installation

Download binary from releases to your $PATH. Then, set file capabilities to allow access to Bluetooth with

sudo setcap 'cap_net_raw,cap_net_admin+eip' `which ruuvitag-listener`

Usage

ruuvitag-listener

Running ruuvitag-listener will output measurements to STDOUT until interrupted.

Example output:

ruuvi_measurement,name=F7:2A:60:0D:6E:1E acceleration_x=-0.055,acceleration_y=-0.032,acceleration_z=0.998,battery_potential=3.007,humidity=19.5,pressure=101.481,temperature=19.63 1546681652675044272
ruuvi_measurement,name=F1:FC:AA:80:4E:59 acceleration_x=0.005,acceleration_y=0.015,acceleration_z=1.036,battery_potential=2.989,humidity=17.5,pressure=101.536,temperature=21.97 1546681653451240083
ruuvi_measurement,name=F1:FC:AA:80:4E:59 acceleration_x=0.002,acceleration_y=0.017,acceleration_z=1.032,battery_potential=2.977,humidity=17.5,pressure=101.536,temperature=21.97 1546681654458923308
ruuvi_measurement,name=F7:2A:60:0D:6E:1E acceleration_x=-0.052,acceleration_y=-0.032,acceleration_z=1,battery_potential=3.013,humidity=19.5,pressure=101.481,temperature=19.63 1546681655691300729

You can also define the InfluxDB measurement name or aliases using command line arguments. For example

ruuvitag-listener --influxdb-measurement=ruuvi --alias F1:FC:AA:80:4E:59=Indoor --alias F7:2A:60:0D:6E:1E=Outdoor
ruuvi,name=Indoor acceleration_x=0,acceleration_y=0.017,acceleration_z=1.027,battery_potential=2.989,humidity=17.5,pressure=101.54,temperature=21.97 1546681957964524841
ruuvi,name=Outdoor acceleration_x=-0.054,acceleration_y=-0.032,acceleration_z=1.005,battery_potential=3.013,humidity=83.5,pressure=101.487,temperature=-5.63 1546681958085455294

All options can be listed with ruuvitag-listener --help.

Development

Use cargo to build the project to target/debug directory:

cargo build

Tests can be run with

cargo test

License

MIT

Dependencies

~5.5–7.5MB
~142K SLoC