Extend Cargo.toml and Readme.md
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
finga 2022-04-24 18:14:26 +02:00
parent e156d5958b
commit 599e6b692d
2 changed files with 45 additions and 4 deletions

View file

@ -1,8 +1,10 @@
[package] [package]
name = "mightyohm-gc-exporter" name = "mightyohm-gc-exporter"
version = "0.1.0-dev" version = "0.1.0-dev"
authors = ["finga <finga@onders.org>"]
edition = "2021" edition = "2021"
description = "Prometheus exporter for the MightyOhm Geiger Counter" description = "Prometheus exporter for the MightyOhm Geiger Counter."
readme = "README.md"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://git.onders.org/finga/mightyohm-gc-exporter" repository = "https://git.onders.org/finga/mightyohm-gc-exporter"
keywords = ["prometheus", "metrics"] keywords = ["prometheus", "metrics"]

View file

@ -2,14 +2,53 @@
A Prometheus exporter for the [MightyOhm Geiger Counter](https://mightyohm.com/blog/products/geiger-counter/). A Prometheus exporter for the [MightyOhm Geiger Counter](https://mightyohm.com/blog/products/geiger-counter/).
## Build ## Build
Cargo, the Rust package manager, is used to build this project.
### Same architecture as system ### Same architecture as system
To compile it for the same architecture as the build system: Compile it for the same architecture as the build system:
```sh ```sh
cargo build --release cargo build --release
``` ```
### Cross-compile for aarch64 (recent RaspberryPi) ### Cross-compile for amd64 (recent RaspberryPi)
To cross-compile it for RaspberryPi: Cross-compile it for the amd64 architecture:
```sh ```sh
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu --release 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/mightyohm-gc-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:
mightyohm-gc-exporter [OPTIONS]
OPTIONS:
-a, --address <ADDRESS> The IPv4 or IPv6 address where the metrics are served
[default: 127.0.0.1]
-b, --baud-rate <BAUD_RATE> The baudrate of the serial connection [default: 9600]
-h, --help Print help information
-p, --port <PORT> The port where the metrics are served [default: 9111]
-s, --serial-port <SERIAL_PORT> The port of the serial device, usually in '/dev/...'
[default: /dev/serial0]
-t, --timeout <TIMEOUT> Timeout of the serial connection in ms [default: 1000]
-V, --version Print version information
```