Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (35 loc) · 2.44 KB

readme.md

File metadata and controls

64 lines (35 loc) · 2.44 KB

PowerMeter Monitoring

Using Prometheus and Graphana

Using OS- tools can more or less give accurate information about the energy consumption by the operating system and the CPU. In any general device, this could be sufficient as in such devices as the most energy supply Is used by CPU computation.

But in cases of SBCs like Raspberry Pi, Nvidia Jetson Boards this is not sufficient as there are other factors as well which consume energy comparable to that of CPU computation. Eg.Energy consumption by networking components like Ethernet, GPIO, UART, etc.

To overcome this problem and to get the complete power consumption, an external power meter needs to be integrated into the SBC f83f1a_e2d765a97e914125b200aeefdd810740_mv2

For this we would be using Tasmota EU plug V2 by Athom . This is based on tasmota-HLW8032 , providing control using MQTT,Web UI , HTTP.

Local SetUp

Dev SetUp

Pre-requisite

  1. Go compiler
  1. Configured PowerMeter (Tasmotta-HLW8032)

open up a terminal

  1. Clone the repo ,go in the folder

  2. Run using go compiler sudo go run cmd/main.go
    powertop requires sudo permission to access the system stats

  3. Bare prometheus metrics can be seen using curl 0.0.0.0:8881/metrics

Run Using Docker

  1. docker run -d -p 8888:8881 sibseh/powermeter:v4
  2. Bare prometheus metrics can be seen using curl 0.0.0.0:8888/metrics |grep current_count|voltage_count

These can be run with graphana and prometheus easily with the docker compose file

Monitoring with Graphana and Prometheus using docker compose

  1. Open up a terminal in the same directory docker-compose up

  2. Open your favourite brower with localhost:3000 , it will open up Graphana, login with username and password both as admin

  3. Go to configuration ->Data sources -> Add Prometheus -> set Http as http://prometheus:9090

  4. Go to create -> Dashboard -> Select one

  5. Add current_count , voltage_count

6 . Now you can see clearly the parameters of your system calculated !!

The final set up should look like this Screenshot from 2022-09-05 16-50-16

Viewing voltage_count variation