# Exporter for the DHT11 sensor [![status-badge](https://ci.onders.org/api/badges/finga/dht11-exporter/status.svg)](https://ci.onders.org/finga/dht11-exporter) 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: ```sh cargo build --release ``` ### Cross-compile for amd64 (recent RaspberryPi) Cross-compile it for the amd64 architecture: ```sh 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`](https://crates.io/crates/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: ```sh cargo deb ``` ### Cross-compile for amd64 (recent RaspberryPi) Build a `deb` package for the amd64 architecture: ```sh PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo deb --target aarch64-unknown-linux-gnu ``` ## Usage ``` USAGE: dht11-exporter [OPTIONS] OPTIONS: -a, --address
The IPv4 or IPv6 address where the metrics are served [default: 127.0.0.1] -g, --gpio The GPIO pin of the DHT11 data line [default: 4] -h, --help Print help information -p, --port The port where the metrics are served [default: 9112] -V, --version Print version information ```