A real-time chat application using ESP32, featuring both WebSocket and UDP communication protocols. The application provides a modern, responsive web interface for seamless communication between multiple clients.
- Real-time messaging using WebSocket and UDP
- Modern, responsive web interface
- Username-based chat system
- Connection status indicators
- Auto-reconnect functionality
- mDNS support for easy access
- Arduino IDE 1.8.18
- ESP32 board support
- Install ESP32 board package in Arduino IDE via Boards Manager
- Select appropriate ESP32 board from Tools > Board menu
- AsyncTCP: https://github.com/me-no-dev/AsyncTCP
- ESPAsyncWebServer: https://github.com/me-no-dev/ESPAsyncWebServer
- ArduinoJson: Install via Library Manager
- ESP32 SPIFFS Upload Tool: https://github.com/me-no-dev/arduino-esp32fs-plugin
- WiFi.h (included in ESP32 board package)
- ESPmDNS.h (included in ESP32 board package)
- SPIFFS.h (included in ESP32 board package)
- AsyncUDP.h (included in ESP32 board package)
- ESP32 Development Board
- USB Cable
- Computer with Arduino IDE installed
- Clone this repository
- Open
esp32_chat.ino
in Arduino IDE 1.8.18 - Install required libraries using the Arduino Library Manager
- Update WiFi credentials in the code:
const char* ssid = "Your_SSID"; const char* password = "Your_Password";
- Upload the SPIFFS data:
- Install the ESP32 Sketch Data Upload tool
- Go to Tools > ESP32 Sketch Data Upload
- Wait for the upload to complete
- Upload the code to your ESP32
- Open the Serial Monitor to view the ESP32's IP address
- Access the chat interface:
- Using mDNS: Navigate to
http://esp32chat.local
in your web browser - If mDNS doesn't work, use the IP address shown in Serial Monitor (e.g.,
http://192.168.1.100
)
- Using mDNS: Navigate to
- Enter a username when prompted
- Start chatting!
esp32_chat.ino
- Main Arduino sketchdata/index.html
- Web interface- Client management for both WebSocket and UDP connections
- Automatic cleanup of stale connections
Created by Kent Carlo Amante