bme280-exporter

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

README

BME280-Exporter

Golang Prometheus exporter for the Bosch BME280 sensor

Usage

In order to support multiple devices/sensors, the metrics path contains the device and the I2C address of the sensor like the following: /metrics/{device}/{register}.

Since this container runs with a low privilege user, you should change the group of device before mounting it in the container to 500 GID.

sudo chgrp 500 /dev/i2c-1
docker pull spawn2kill/bme280-exporter:1.0.0
docker run -it --device /dev/i2c-1 -p 8080:8080 spawn2kill/bme280-exporter:1.0.0

curl -X GET localhost:8080/metrics/i2c-1/0x76
Docker-Compose
version: "3"

services:
  bme280:
    image: spawn2kill/bme280-exporter:1.0.0
    expose:
     - 8080
    devices:
     - /dev/i2c-1
Prometheus Configuration
scrape_configs:
  - job_name: 'bme280'
    scrape_interval: 5s
    static_configs:
    - targets:
      - 'bme280:8080'
      labels:
        alias: 'Room #1'
    metrics_path: '/metrics/i2c-1/0x76'

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