/roomlightesp8266

Control my room light using ESP8266 and a Relay

Primary LanguagePython

roomlightesp8266

My simple IOT setup to control room light using esp8266.

Highlights

  • A relay bridging the power to room light controlled from esp8266's GPIO
  • Uses Micropython Framework

Setup

Hardware

TODO: Circuit Schematics

Software

Installation

  1. Install Micropython, follow this documentation here
  2. Upload this code using the WebREPL, documentation

Usage

Write the WiFi credentials in config.py

# contents of config.py

wifi_cred = ("SSID", "PASSWD")

Find the IP address of the esp8266 connected to WiFi either from the router page or nmap. Then, go that ip address from browser on your phone or pc.

You can cURL follow urls to toggle the light

# to turn on the lights
curl http://<ip addr>/turnon 

# to turn off the lights
curl http://<ip addr>/turnoff

Todo

  • Complete Implementation of NTP for toggle lights by the time of the Day