Initial commit: MQTT publisher with rumqttc
This commit is contained in:
29
README.md
Normal file
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# MQTT Publisher
|
||||
|
||||
A simple Rust application that publishes messages to an MQTT broker.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- tokio (with full features)
|
||||
- rumqttc
|
||||
- serde
|
||||
- serde_json
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
cargo run
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
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?;
|
||||
```
|
||||
Reference in New Issue
Block a user