Code Monkey home page Code Monkey logo

lightclock's Introduction

LightClock

A programmable red-light/green-light alarm clock for ESP8266 (built on NodeMCU devkit) with configuration, time synchronization, and overrides via WiFi.

Functional highlights:

  • Default connection to a WiFi network, with fallback to broadcasting its own SSID (great for travel away from your home network)
  • NTP synchronization with default (but configurable) timezone offset
  • Once alarm time is reached, the light stays green until the clock is reset
  • Any state (red, yellow, green, off) can be selected manually from the UI

To use:

  • Change the configurables based on your wiring to LEDs. Compile & upload to the board
  • On first load, it will fail to connect to a wifi network and will broadcast its own ("LightClock" SSID, unless you changed it). Connect to that network and load http://192.168.4.1
  • You can configure it for your WiFi SSID and PSK on that page.
  • When it connects, either use the Serial readout or it flashes LEDs (red = 100s place, yellow = 10s, green = 1s) to give you the last octet of the IP. All LEDs on = SoftAP mode
  • Pull the page up (http://) in a browser - tested in Chrome & Safari mobile
  • If needed, you can change the timezone offset or manually reset the clock (if it's connected to a network without NTP access, like its own) at the bottom
  • Set the alarm by entering a 24hr time, no seconds ("6:00") in the alarm box, and mash the button
  • Use the color buttons for overrides. Any color button disables the alarm functionality

lightclock's People

Contributors

azollman avatar

Watchers

 avatar

lightclock's Issues

Auto shut-off

Requesting a feature to automatically turn off the green light after some time. Avoid the night-time scenario of "My green light is on!" when I forget to turn it off after successful wakeup.

Hard-coded network config

Would be better to use something like WifiManager or EEPROM to store network config (and TZ offset too, so it persists resets)

Bootstrap CSS is slow when self-hosted

When it's serving its own WiFi network, the Bootstrap CSS file has to be served from SPIFFS rather than a reference to the CDN. SPIFFS is slow - so slow, in fact, that about half the time the browser just goes on ahead and renders the page without the CSS coming down because it's too slow. More extreme minification (it's not using the vast majority of style elements) could cut that out and maybe remove reliance on SPIFFS altogether.

Hard-coded NTP config

IP address hardcoded. Would be best to support DNS so pool.ntp can be used instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.