Skip to content

sbirmecha99/esp8266-smart-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›°οΈ ESP8266 Smart Device Controller

WiFi-enabled embedded system implementing a Finite State Machine (FSM) for real-time device control.


πŸš€ Key Features

  • Non-blocking Execution: Uses millis() instead of delay() to maintain responsiveness
  • State Machine Design:
    • OFF
    • ON
    • AUTO_TIMEOUT
  • REST-style API:
    • /api/state returns current state in JSON
  • Dynamic UI:
    • Web interface updates in real-time using API polling
  • Lightweight Web Server:
    • Runs directly on ESP8266

πŸ› οΈ Tech Stack

  • Hardware: ESP8266 (NodeMCU)
  • Firmware: C++ (Arduino framework)
  • Communication: HTTP
  • Frontend: HTML, CSS, JavaScript

πŸ”Œ API Reference

Endpoint Method Description
/api/state GET Returns current state
/on GET Set state to ON
/off GET Set state to OFF

🧠 System Architecture

  • WiFi Layer: Connects ESP8266 to local network
  • Server Layer: Handles HTTP requests
  • Logic Layer: Implements FSM and timing using millis()

πŸ”§ Setup

  1. Clone the repo
  2. Add WiFi credentials in .ino file
  3. Upload using Arduino IDE
  4. Open Serial Monitor to get IP
  5. Access via browser

πŸŽ₯ Demo

https://drive.google.com/file/d/16QziZQ29N9CDDHXkpdHTcYWKCPKWFhA3/view?usp=sharing


πŸ“ˆ Future Improvements

  • MQTT-based communication
  • Sensor-based automation
  • OTA firmware updates

About

WiFi-enabled embedded system with state machine and REST API using ESP8266

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages