Crates.io | yngvi |
lib.rs | yngvi |
version | 0.2.0 |
source | src |
created_at | 2023-09-30 23:59:32.477192 |
updated_at | 2023-10-01 01:20:32.514141 |
description | Read, calculate and write weather data |
homepage | |
repository | https://github.com/deebloo/yngvi |
max_upload_size | |
id | 988920 |
size | 137,385 |
Program for collecting and processing weather data.
HUGE THANKS TO WEEWX FOR DECODING THE VARIOUS MESSAGES FROM THE ACURITE DISPLAY
cargo install yngvi --features standalone
Name | Description | Default |
---|---|---|
WS_SRC | determines where to pull data from. ACURITE_DISPLAY, RTL_433, or FILE | DISPLAY |
WS_SRC_FILE_PATH | path to file with source readings | |
WS_DEST | INFLUXDB, INFLUXDB2, STDOUT, or INMEMORY | STDOUT |
WS_DEST_INFLUXDB_URL | influxdb url | http://localhost:8086 |
WS_DEST_INFLUXDB_DB | influxdb database | weather |
WS_DEST_INFLUXDB2_URL | influxdb url | |
WS_DEST_INFLUXDB2_ORG | influxdb org | |
WS_DEST_INFLUXDB2_BUCKET | influxdb bucket | |
WS_DEST_INFLUXDB2_TOKEN | auth token for influxdb |
Any data source can be defined as Iterator<Item = WeatherReading>
and all destinations are defined with the Writer
trait. WS comes with some prebuilt readers and writers but it should be straight forward to define new data sources and new destination without touching any of the core station logic. Give it a try!
cargo add yngvi
use yngvi::core::{InMemWriter, Station, StdoutWriter, WeatherReading, FileReader};
#[tokio::main]
async fn main() {
// create a new weather station
let mut station = Station::new();
// define where your source data will come from
let reader = FileReader::new("data/source.txt");
// define where your calculated data will be written to
let mut writer = StdoutWriter::new();
// start your station!
station.start(reader, writer).await
}