From eb327e8f1cb0f281bc231e905541fe6874443176 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 28 Feb 2026 21:44:28 +0100 Subject: [PATCH] Update Readme --- README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 75afbc9..802ad50 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# MQTT Publisher +# MQTT RNV Publisher -A simple Rust application that publishes messages to an MQTT broker. +A simple Rust application that publishes the RNV Live Station ticker into your MQTT Sever ## Dependencies @@ -12,20 +12,34 @@ A simple Rust application that publishes messages to an MQTT broker. ## Usage ```bash -cargo run -- 192.168.1.100 1883 +cargo run -- --broker 192.168.1.100 --port 1883 --interval 60 --station Lettestr ``` Or run the binary directly: ```bash -./target/debug/mqtt-publisher [broker] [port] +./target/debug/mqtt-publisher --broker
--port --interval --station ``` ### Arguments -- `broker`: MQTT broker address (default: `localhost`) -- `port`: MQTT broker port (default: `1883`) -- `interval`: Interval in seconds between departure data fetches (default: `300`) +- `--broker`: MQTT broker address (default: `localhost`) +- `--port`: MQTT broker port (default: `1883`) +- `--interval`: Interval in seconds between departure data fetches (default: `300`) +- `--station`: Station name to look up (default: `Lettestr`) + +## MQTT Topics + +The application publishes departure data to the following topics: + +- `departure/station`: Station name +- `departure/outbound/station`: Outbound destination station +- `departure/outbound/line`: Outbound line number/name +- `departure/outbound/diff`: Seconds until outbound departure +- `departure/inbound/station`: Inbound destination station +- `departure/inbound/line`: Inbound line number/name +- `departure/inbound/diff`: Seconds until inbound departure +- `departure/failure`: Error message if data fetch fails ## Configuration @@ -33,9 +47,3 @@ Edit `src/main.rs` to customize: - Broker address (default: `localhost:1883`) - MQTT topic (default: `test/topic`) - Message payload - -## Example - -```rust -client.publish("your/topic", QoS::AtLeastOnce, false, b"Your message").await?; -```