Giter VIP home page Giter VIP logo

elektro-meter's Introduction

Elektro Meter

Elektro Meter is a logger for analog electricity meters using an (old) Android phone. It uses the phone's camera to detect the marker on the rotor disk. When the marker is detected, it logs the timestamp to a text file on the internal storage.

A simple website is provided to analyze the data.

App

Website

Installation

You need an (old) Android phone and mount it in front of the meter.

Install the APK app/build/outputs/apk/release/app-release.apk on Android and open the App.

Press the Settings button and choose settings that provide good detection of the maker.

To simplify the process of finding the right settings wait until the marker comes into view and press the Dump button. It creates the file ElektroMeter.dump.png in the internal storage.

Copy the file to your computer and run ./dump-inspector.py /path/to/ElektroMeter.dump.png. It creates a series of images that can be used to quickly determine good parameters. Run ./dump-inspector.py --help to see the arguments for changing the default parameters (e.g. run ./dump-inspector.py /path/to/ElektroMeter.dump.png --rotation 90 --luma 10 and check the generated images again).

Web server

The website for accessing and analyzing the data can be hosted directly on the phone using Termux.

Install Termux and Termux:Boot.

Start the app Termux:Boot at least once for it to work.

In Termux first do an update.

pkg update

Allow access to the internal storage.

termux-setup-storage

Install the webserver.

pkg install nginx

Edit the file ~/../usr/etc/nginx/nginx.conf and add/replace the following in the server section:

location / {
    root   /data/data/com.termux/files/home/html;
    index  index.html index.htm;
}

location = /ElektroMeter.log {
    root   /data/data/com.termux/files/home/storage/shared;
}

Open the file website/index.html with a text editor and set the meter constant.

// ===== Settings =====
const cz = 1; // Meter constant
// === End Settings ===

You can find the value written on your electricity meter.

Copy the file website/index.html to your phone and place it in the folder ~/html/. Additionally you need to download lightweight-charts.standalone.production.js and put it in the folder too.

To start the webserver on boot create the file ~/.termux/boot/start-nginx:

#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
nginx -g "daemon off;"

Finally start the webserver (without rebooting).

chmod +x ~/.termux/boot/start-nginx
~/.termux/boot/start-nginx

Building

Run ./gradlew assembleRelease. It creates the signed (using app/DummyKeystore.jks) APK at app/build/outputs/apk/release/app-release.apk.

elektro-meter's People

Contributors

unrud avatar

Watchers

 avatar  avatar  avatar

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.