MQTT Publisher

A simple Rust application that publishes messages to an MQTT broker.

Dependencies

  • tokio (with full features)
  • rumqttc
  • serde
  • serde_json

Usage

cargo run -- 192.168.1.100 1883

Or run the binary directly:

./target/debug/mqtt-publisher [broker] [port]

Arguments

  • broker: MQTT broker address (default: localhost)
  • port: MQTT broker port (default: 1883)
  • interval: Interval in seconds between departure data fetches (default: 300)

Configuration

Edit src/main.rs to customize:

  • Broker address (default: localhost:1883)
  • MQTT topic (default: test/topic)
  • Message payload

Example

client.publish("your/topic", QoS::AtLeastOnce, false, b"Your message").await?;
Description
No description provided
Readme 72 KiB
Languages
Rust 100%