https://github.com/skca01/esp32-udp-chat
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.
https://github.com/skca01/esp32-udp-chat
arduino esp32 websocket-chat
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/skca01/esp32-udp-chat
- Owner: Skca01
- Created: 2024-11-23T10:25:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-23T11:40:01.000Z (over 1 year ago)
- Last Synced: 2025-01-23T19:22:35.737Z (over 1 year ago)
- Topics: arduino, esp32, websocket-chat
- Language: HTML
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESP32 UDP/WebSocket Chat
## About
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.
## Features
- 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
## Prerequisites
- 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
### Required Libraries
1. AsyncTCP: https://github.com/me-no-dev/AsyncTCP
2. ESPAsyncWebServer: https://github.com/me-no-dev/ESPAsyncWebServer
3. ArduinoJson: Install via Library Manager
4. ESP32 SPIFFS Upload Tool: https://github.com/me-no-dev/arduino-esp32fs-plugin
5. WiFi.h (included in ESP32 board package)
6. ESPmDNS.h (included in ESP32 board package)
7. SPIFFS.h (included in ESP32 board package)
8. AsyncUDP.h (included in ESP32 board package)
### Hardware
- ESP32 Development Board
- USB Cable
- Computer with Arduino IDE installed
## Installation
1. Clone this repository
2. Open `esp32_chat.ino` in Arduino IDE 1.8.18
3. Install required libraries using the Arduino Library Manager
4. Update WiFi credentials in the code:
```cpp
const char* ssid = "Your_SSID";
const char* password = "Your_Password";
```
5. Upload the SPIFFS data:
- Install the [ESP32 Sketch Data Upload tool](https://github.com/me-no-dev/arduino-esp32fs-plugin)
- Go to Tools > ESP32 Sketch Data Upload
- Wait for the upload to complete
## Usage
1. Upload the code to your ESP32
2. Open the Serial Monitor to view the ESP32's IP address
3. 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`)
4. Enter a username when prompted
5. Start chatting!
## Project Structure
- `esp32_chat.ino` - Main Arduino sketch
- `data/index.html` - Web interface
- Client management for both WebSocket and UDP connections
- Automatic cleanup of stale connections
## Credits
Created by Kent Carlo Amante