A powerful, feature-rich ESP32-S3 sensor monitoring system with real-time web interface, OTA updates, and RGB status indicators.
๐ Quick Start โข ๐ Documentation โข ๐ฏ Features โข ๐ค Contributing โข ๐ฌ Support
|
|
git clone https://github.com/OmarTemsah99/ESP_WebSocket && cd ESP_WebSocket && pio run -t upload- Hardware: ESP32-S3 Development Board
- LED: WS2812B RGB LED (NeoPixel)
- Software: PlatformIO IDE or CLI
- Network: WiFi connection
โโโโโโโโโโโโโโโโโโโ
โ ESP32-S3 โ
โ โ
โ GPIO 48 โโโโโโโผโโโโ WS2812B RGB LED
โ โ (Data In)
โ โ
โ GND โโโโโโโผโโโโ LED GND
โ 3V3 โโโโโโโผโโโโ LED VCC
โโโโโโโโโโโโโโโโโโโ
| Component | ESP32-S3 Pin | Notes |
|---|---|---|
| WS2812B Data | GPIO 48 | Digital signal |
| WS2812B VCC | 3.3V | Power supply |
| WS2812B GND | GND | Ground connection |
โ ๏ธ Important: Ensure stable 3.3V power supply for reliable operation.
# Install PlatformIO CLI
pip install platformio
# Clone repository
git clone https://github.com/OmarTemsah99/ESP_WebSocket
cd ESP_WebSocketCreate src/config.cpp:
#include "config.h"
// ๐ถ WiFi Settings
const char *WIFI_SSID = "YourWiFiNetwork";
const char *WIFI_PASSWORD = "YourWiFiPassword";
// ๐ Network Configuration
const IPAddress STATIC_IP(192, 168, 1, 200); // Device IP
const IPAddress GATEWAY(192, 168, 1, 1); // Router IP
const IPAddress SUBNET(255, 255, 255, 0); // Subnet mask
const IPAddress DNS_SERVER(8, 8, 8, 8); // DNS server# ๐จ Build project
pio run
# ๐ค Upload firmware (USB)
pio run -t upload -e esp32-s3-usb
# ๐พ Upload web files
pio run -t uploadfs -e esp32-s3-usb
# ๐ก Monitor serial output
pio device monitor# Update IP in platformio.ini, then:
pio run -t upload -e esp32-s3-ota- Real-time Metrics: Live sensor data updates
- Client Management: View all connected sensors
- Status Monitoring: System health indicators
- LED Control: RGB color management
- Live Refresh: Automatically updates every 200ms
- Detailed Display:
- IP Address
- Client ID
- Sensor Value
- Error Handling: Displays fallback message on failure
- Clean UI: Styled via shared /styles.css
- Navigation: Includes back button to main dashboard
- Upload Files: Drag & drop interface
- File Browser: View SPIFFS contents
- Download: Retrieve stored files
- Delete: Remove unwanted files
- OTA Updates: Upload new firmware
- Progress Tracking: Real-time update status
- Rollback Support: Automatic recovery
- Verification: Checksum validation
| LED Color | Status | Description |
|---|---|---|
| ๐ด Red | Disconnected | No WiFi connection |
| ๐ต Blue (Blinking) | Connecting | Attempting WiFi connection |
| ๐ข Green | Connected | Ready and operational |
| ๐ต Blue (Solid) | Sensor Active | Sensor value = 1 |
| ๐ด Red (Solid) | Sensor Inactive | Sensor value = 0 |
POST /sensor
Content-Type: application/x-www-form-urlencoded
clientId=sensor1&value=1Response: 200 OK
GET /sensorDataResponse:
{
"192.168.1.100": {
"clientId": "sensor1",
"value": 1,
"timestamp": "2025-06-23T10:30:00Z"
}
}GET /color?r=255&g=128&b=0Parameters:
r: Red value (0-255)g: Green value (0-255)b: Blue value (0-255)
GET /list # List all files
POST /delete?file=config.txt # Delete specific file
POST /upload # Upload file (multipart/form-data)ESP_WebSocket/
โโโ ๐ data/ # Web interface files
โ โโโ ๐ index.html # Main dashboard
โ โโโ ๐ file_manager.html # File management
โ โโโ ๐ firmware_update.html # OTA interface
โ โโโ ๐จ styles.css # Styling
โโโ ๐ include/ # Header files
โ โโโ โ๏ธ config.h # Configuration
โ โโโ ๐ก led_controller.h # LED management
โ โโโ ๐ sensor_manager.h # Sensor handling
โ โโโ ๐ web_handlers.h # Web routes
โ โโโ ๐ถ wifi_manager.h # Network management
โ โโโ ๐พ filesystem_utils.h # File operations
โโโ ๐ src/ # Source code
โ โโโ ๐ main.cpp # Main application
โ โโโ ๐ก led_controller.cpp
โ โโโ ๐ sensor_manager.cpp
โ โโโ ๐ web_handlers.cpp
โ โโโ ๐ถ wifi_manager.cpp
โ โโโ ๐พ filesystem_utils.cpp
โโโ โ๏ธ platformio.ini # Build configuration
// config.h
#define RGB_LED_PIN 48 // GPIO pin for RGB LED
#define NUM_PIXELS 1 // Number of LEDs
#define LED_BRIGHTNESS 100 // Brightness (0-255)#define RECONNECT_INTERVAL 10000 // WiFi reconnect delay (ms)
#define SENSOR_UPDATE_INTERVAL 50 // Sensor refresh rate (ms)
#define WEB_SERVER_TIMEOUT 5000 // HTTP timeout (ms)#define WEB_SERVER_PORT 80 // HTTP server port
#define OTA_PORT 3232 // OTA update port
#define MAX_CLIENTS 10 // Maximum concurrent clients- Temperature monitoring
- Motion detection
- Light control
- Security systems
- Equipment monitoring
- Environmental sensing
- Predictive maintenance
- Data logging
- Soil moisture monitoring
- Weather station
- Greenhouse automation
- Irrigation control
- Sensor data collection
- IoT prototyping
- Remote monitoring
- Educational projects
- Memory Management: Efficient SPIFFS usage
- Power Efficiency: Deep sleep support ready
- Network Optimization: Keep-alive connections
- Real-time Updates: WebSocket ready architecture
- OTA Security: Password-protected updates
- Access Control: IP-based restrictions ready
- Data Validation: Input sanitization
- Secure Headers: CORS and security headers
- Modular Design: Easy feature addition
- Plugin Architecture: Sensor plugin support
- Custom Protocols: Multiple communication options
- Database Integration: Ready for external databases
๐ WiFi Connection Issues
Problem: Device not connecting to WiFi
Solutions:
- โ
Verify credentials in
config.cpp - โ Check signal strength (LED should blink blue)
- โ Confirm 2.4GHz network (ESP32 doesn't support 5GHz)
- โ Reset network settings: Hold reset during power-on
Debug Commands:
Serial.println("WiFi Status: " + String(WiFi.status()));
Serial.println("RSSI: " + String(WiFi.RSSI()));๐พ SPIFFS Mount Failed
Problem: Web interface not loading
Solutions:
- โ
Upload filesystem:
pio run -t uploadfs - โ Format SPIFFS via serial monitor
- โ
Check partition table in
platformio.ini - โ Verify file sizes don't exceed partition
Recovery:
# Force filesystem upload
pio run -t uploadfs --force๐ OTA Update Failed
Problem: Firmware update not working
Solutions:
- โ Ensure stable power supply (use USB power)
- โ
Check IP address in
platformio.ini - โ
Verify
.binfile integrity - โ Close other applications using the network
Prevention:
// Add to main.cpp for better OTA reliability
ArduinoOTA.setRebootOnSuccess(true);
ArduinoOTA.setTimeout(30000);๐ก LED Not Working
Problem: RGB LED not responding
Solutions:
- โ Check wiring (GPIO 48, VCC, GND)
- โ Verify power supply (3.3V stable)
- โ Test with different LED
- โ
Check pin configuration in
config.h
Test Code:
// Add to setup() for LED testing
pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Red
pixels.show();| Metric | Value | Notes |
|---|---|---|
| Boot Time | ~3-5 seconds | Including WiFi connection |
| Memory Usage | ~180KB RAM | With web server active |
| Flash Usage | ~1.2MB | Including SPIFFS data |
| Power Consumption | ~150mA | At 3.3V with LED |
| WiFi Range | ~50m indoor | Depends on environment |
| Update Rate | 20Hz | Sensor data refresh |
| Concurrent Clients | 10+ | Web interface users |
| File Upload Size | 1MB max | SPIFFS limitation |
- WebSocket Support: Real-time bidirectional communication
- Database Integration: SQLite for data persistence
- Multi-sensor Support: I2C/SPI sensor integration
- Advanced Visualization: Charts and graphs
- Mobile App: Companion mobile application
- Machine Learning: On-device sensor prediction
- Mesh Networking: ESP-NOW multi-device support
- Cloud Integration: AWS/Azure IoT connectivity
- Voice Control: Alexa/Google Assistant integration
We welcome contributions! Here's how you can help:
Found a bug? Open an issue with:
- Detailed description
- Steps to reproduce
- Expected vs actual behavior
- Serial monitor output
- Hardware configuration
Have an idea? Create a feature request with:
- Clear description of the feature
- Use cases and benefits
- Implementation suggestions
- Mockups or examples (if applicable)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Improve README sections
- Add code comments
- Create tutorials
- Fix typos and grammar
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Free for personal and commercial use
Get a comprehensive look at the ESP32-S3 Sensor Monitor's features and operation:
*Click to watch the Project Overview Demo*
Using ESP32-S3 Sensor Monitor
- Smart Garden Monitor - Automated plant care system
- Home Security Hub - Multi-sensor security monitoring
- Weather Station - Environmental data collection
- Industrial Monitor - Equipment health tracking
Want your project featured? Submit your implementation!
- ๐ Documentation: Check this README first
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Direct Contact: Open an issue for project-specific questions
- ๐ฅ Contributors: See Contributors
- โญ Star this repository if it helped you!
- ๐ด Fork to create your own version
- ๐ข Share with the community
Made with โค๏ธ by OmarTemsah99