Skip to content

exzz/emon-http-arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

emon-http-arduino

emonlib HTTP JSON server

Super simple JSON HTTP server to read energy monitor status.

Please see open energy monitor projet and emonlib

This code has been tested with this open energy monitor shield and Arduino yun.

Quickstart

  • Configure your Arduino yun board with NTP enabled
  • Clone this repo
  • Setup your project with platformio.org
platformio init --board=yun
platformio lib install 116
  • Customize your settings
// Energy monitor setup
emon1.current(1, 60.606);
emon1.voltage(0, 250, 1.7);
  • Build code
platformio run
  • Upload firmware to Arduino yun
scp .pioenvs/yun/firmware.hex arduino.local:/tmp/
ssh arduino.local '/usr/bin/merge-sketch-with-bootloader.lua /tmp/firmware.hex && /usr/bin/kill-bridge && /usr/bin/run-avrdude /tmp/firmware.hex'

Usage

curl -i 'http://arduino.local:5555'
HTTP/1.1 200 OK
Content-type: text/json

{ "SiteName": "Home", "ModuleName": "mainPower", "Irms": 0.95, "Vrms": 239.87, "RealPower": 126.21, "ApparentPower": 228.76, "PowerFactor": 0.55, "Time": 1442234001, "ExecTime": 1860788 }

About

Super simple HTTP api to read energy monitor status

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%