Skip to content

An example MQTT Rust application to monitor and control Linux GPIO pins via MQTT

License

Notifications You must be signed in to change notification settings

fpagliughi/mqtt.rust.sysfs.gpio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mqtt-sysfs-gpio

An example MQTT Rust application to monitor and control Linux GPIO pins via MQTT.

This uses the Rust SYSFS GPIO and Paho Rust crates to build a small application that monitors a selection of GPIO pins and publishes a message each time the state of one of the pins changes.

rust-sysfs-gpio https://github.com/rust-embedded/rust-sysfs-gpio

Paho MQTT Rust Client https://github.com/eclipse/paho.mqtt.rust

This initial implementation monitors changes to the state of a list of input pins, as requested by the user from the command line, then publishes a message to an MQTT broker each time a state change is detected.

The application is quite literally a simple combination of an example program from each of those projects: the tokio example app from rust-sysfs-gpio and async_publish from the Paho MQTT client.

The next version will also go in the other direction - accepting commands via MQTT and setting output pins according to the received commands.

This application was developed and tested on an UDOO NEO board (https://www.udoo.org/udoo-neo/), although it should work on any Linux system that can export GPIO pins to user space via sysfs, such as an RPi, BeagleBone, etc. Please report an issue if it fails on any particular hardware.

About

An example MQTT Rust application to monitor and control Linux GPIO pins via MQTT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages