This project enables communication between an ESP32, a client dashboard, and a servo motor for controlling a volet roulant (rolling shutter). Real-time data is sent to an MQTT broker via Wi-Fi, and the data is displayed in real-time on the dashboard.
- Arduino IDE
- [Library Name and Version](Link to the library documentation)
-
Clone this repository:
git clone https://github.com/your-username/esp32-mqtt-servo-control.git
-
Open the Arduino IDE and load the sketch located in the src folder.
3.Install the required libraries using the Arduino Library Manager. 4. Upload the sketch to your ESP32.
-
Connect the ESP32 to your Wi-Fi network.
-
Configure the MQTT broker settings in the sketch.
// MQTT Broker Configuration #define MQTT_BROKER "your_mqtt_broker_address" #define MQTT_PORT 1883 #define MQTT_USER "your_mqtt_username" #define MQTT_PASSWORD "your_mqtt_password"
-
Power on the servo motor.
-
Install and run Mosquitto (MQTT broker):
-
Follow the installation instructions for your operating system from the Mosquitto website.
-
Start the Mosquitto broker.
mosquitto_sub -t "topic" -h "mqtt_broker_host"
-
-
Install Node.js for real-time communication with Socket.IO:
-
Follow the installation instructions for your operating system from the Node.js website.
-
Verify the installation:
node -v npm -v
-
-
Install project dependencies:
cd path/to/your/project npm install
7.node server.js 8.Open a web browser and navigate to http://localhost:3000.
The dashboard should be accessible at this address, provided that the server is running and configured correctly.