Prometheus exporter for the DHT11 sensor.
|
||
---|---|---|
.cargo | ||
debian | ||
src | ||
.gitignore | ||
.woodpecker.yml | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
Exporter for the DHT11 sensor
A Prometheus exporter for the DHT11 sensor.
Build
Cargo, the Rust package manager, is used to build this project.
Same architecture as system
Compile it for the same architecture as the build system:
cargo build --release
Cross-compile for amd64 (recent RaspberryPi)
Cross-compile it for the amd64 architecture:
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu --release
Debian
To build a package for Debian, Raspbian, and so on,
cargo-deb
can be used.
The package comes with an automatically started and enabled systemd
service unit which can be configured via
/etc/default/dht11-exporter
.
Same architecture as system
Build a deb
package for the same architecture as the build system:
cargo deb
Cross-compile for amd64 (recent RaspberryPi)
Build a deb
package for the amd64 architecture:
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo deb --target aarch64-unknown-linux-gnu
Usage
USAGE:
dht11-exporter [OPTIONS]
OPTIONS:
-a, --address <ADDRESS> The IPv4 or IPv6 address where the metrics are served [default:
127.0.0.1]
-g, --gpio <GPIO> The GPIO pin of the DHT11 data line [default: 4]
-h, --help Print help information
-p, --port <PORT> The port where the metrics are served [default: 9112]
-V, --version Print version information