shark100mon

command module
v0.0.0-...-5a58993 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2019 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Shark 100 Power Meter Monitoring and Display

The Shark 100 power meter is network-connected but does not have a web server. It does, however, provide a TCP modbus interface.

This is a simple go server that reads power draw, voltage, and frequency from the Shark and either logs it to the console or makes it available via a webserver running on (default) port 8081.

Note that this version displays the voltage across both hot lines, as I'm using it in a 240V application. You can change the registers it reads to show different values. (They're listed in the manual for the meter).

The IP address of the shark meter is hard-coded. If you find this program useful and would like me to generalize that a little, let me know. Otherwise, I assume I'm either the only one using it, or that anyone else is using it as reference code for hacking their own thing up.

The included 'powermon.html' web page has a bit of javascript that auto-refreshes from the Go web server. It's formatted to fit nicely on a horizontally-oriented iPad.

Building

Either use the normal go techniques, or just build in directory:

go build main.go
mv main powermon

Web server use:

nohup ./powermon >& /dev/null &

Web page

Image of web server output showing watts, volts, and frequency in large green text

Interactive use:

./powermon -i

Output
dga@server:~$ ./powermon -i
Watts: 19736  volts: 220.41   frequency: 59.9833 hz
Watts: 19696  volts: 220.39   frequency: 59.9826 hz
Watts: 19682  volts: 220.37   frequency: 59.9832 hz

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址