This application, developed in Rust programming language, allows to control remotely a relay controlled by an ESP32 device kit. The application communicates with Elisys Home Automation (Java) from wich retrieves the configuration and activates or deactivates the relay. Please check the Configuration
section to build the project.
The application tries to connect to the WiFi, if the connection fails, then it will retry until it succeeds. After a connection is established, the application makes a request to the server in order to register the device and then it downloads the configuration from the remote server. The configuration contains information about the status that should have the device: on or off. So that the relay is disabled or enabled in base of the configuration JSON received by the remote server. The ESP32 application will check every 2 seconds for new configuration.
GPIO | Description |
---|---|
15 | relay pin |
Before you proceed with building the project, you need to rename the /src/configuration/configuration-sample.rs
to /src/configuration/configuration.rs
. Then you shall edit the variables in the configuration.rs
file (WiFi SSID, WiFi Password and Configuration Server Endpoint)
cargo run
I tested on ESP32-DevKitC and developed on Ubuntu. If you have environment configuration issues, take a look here.
If you found a bug, feel free to contact me.