LED/TCP
Just a silly little learning project to control an LED hooked up to a micro-controller over a TCP connection.
The firmware written for the ESP32 connects to the provided WiFi access point and sets up a TCP server on which it will listen to commands to toggle the LED. To communicate with the MCU there is a desktop GUI application written in Rust that allows the user to connect to the TCP server and press a button to issue commands to the MCU.
Usage
Firmware
Requirements: ESP32 MCU, VSCode + ESP-IDF toolchain
- Open the
firmware/
sub-directory in VSCode - Set the ESP device target (use Ctrl Shift P to run commands in VSCode)
- Run SDK configuration (Ctrl E G)
- Open the "LED over TCP Configuration" section
- Set WiFi SSID and password
- Set GPIO pin for LED
- Set the port for the MCU (Ctrl E P)
- Build, flash and monitor (Ctrl E D)
The IP address of the MCU will be available in the logs found in the monitor view.
GUI
Requirements: Rust/Cargo
The control application can easily be built using cargo
:
- Move to the
gui/
sub-directory - Run
cargo r --release
to compile and run the application - Enter the MCU's IP and port of the TCP server
- Toggle the LED using the button after connecting
The resulting binary can also be found at gui/target/release/gui
.
License
Licensed under the MIT License.