Skip to content

John-Weak/Rain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rain - Electricity Outage Logger

This project aimed to record the timing and duration of power outage in my home.

PS: Work in progress and not yet deployedNow gathering data for few weeks,till then only live status of outage will be shown..

This project has been terminated, w.e.f. 26 oct 2022, I have realised that everything I did, could be done in a better and more efficient way. Someday I am going to re-write this from scratch and maybe start monitoring internet latency/speed along with it.


Why does this project exists?

Information is power

There is no publicly accessible information regarding the timing and duration of power outage in my area.


Local Setup

Important

Do not forget to change the password, host, url etcetra from the client.ino file.

Just search for the word CHEESE and it will take you to neccessary places.

Also do not forget to update the .env .

Service

To install dependencies:

  cd service
  go get

To run Go Service:

  cd service/src
  go run .

App

To install dependencies:

  cd app
  pnpm install

To run Next.js app:

  cd app
  pnpm run dev

What does LED signals mean?

LED STATUS Description
Constant ON Waiting to connect to WIFI.
BLINKS 3 times Web Socket disconnected.
BLINKS 5 times Fatal error has occured.
Constant OFF Everything is working fine .

Basic Idea of Working

  • Websocket hearbeat is used to monitor if the client is alive.
  • Basic HTTP auth is used to authorize the client.
  • If the client disconnects an outage is registered.

Tech

  • WebSocket

  • Basic Http Authentication

    Client:

    • ESP8266
    • Arduino Language

    Service:

    • Golang
    • Gin
    • Gorilla

    App

    • Next.js
    • TailwindCSS
    • TypeScript
    • HighCharts

    Deployment

    • Docker on private server (Service)
    • Vercel (App)

Acknowledgements


Useful Links