WiFi-enabled embedded system implementing a Finite State Machine (FSM) for real-time device control.
- Non-blocking Execution: Uses
millis()instead ofdelay()to maintain responsiveness - State Machine Design:
OFFONAUTO_TIMEOUT
- REST-style API:
/api/statereturns current state in JSON
- Dynamic UI:
- Web interface updates in real-time using API polling
- Lightweight Web Server:
- Runs directly on ESP8266
- Hardware: ESP8266 (NodeMCU)
- Firmware: C++ (Arduino framework)
- Communication: HTTP
- Frontend: HTML, CSS, JavaScript
| Endpoint | Method | Description |
|---|---|---|
/api/state |
GET | Returns current state |
/on |
GET | Set state to ON |
/off |
GET | Set state to OFF |
- WiFi Layer: Connects ESP8266 to local network
- Server Layer: Handles HTTP requests
- Logic Layer: Implements FSM and timing using
millis()
- Clone the repo
- Add WiFi credentials in
.inofile - Upload using Arduino IDE
- Open Serial Monitor to get IP
- Access via browser
https://drive.google.com/file/d/16QziZQ29N9CDDHXkpdHTcYWKCPKWFhA3/view?usp=sharing
- MQTT-based communication
- Sensor-based automation
- OTA firmware updates