Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Understanding the data/code
I've been reading the code, trying to understand how/why everything works.  Mostly I've been going over main/reader.go and smartpi/ade7878.go.

I'm wondering if there is some additional documentation on all of the inputs and outputs.

I'm considering refactoring this code to make it easier to follow.  The big one is smartpi.ReadoutValues(), which returns a completely unformated slice of floats.  This should really be a struct, or broken up into several smaller sub-functions.

For example, in the main for{} loop of readout.go, there is a sub-loop that updates all of the current/voltage gauges (I think), but it ignores the cumulative counters every 5 seconds.

Then every 12 iterations (1min) it updates the database storage and two persistent cumulative counters.

Then it resets the value state for everything and starts the temporary cumulative counters over again.

Does this all sound correct?

I'm also wondering what unit these values are:

EB1: 1.116625  EB2: 0.0341316  EB3: 0.033458143  EL1: 0  EL2: 0  EL3: 0

One more question, it looks like there is no way to ignore disconnected phases, my apartment only has one phase, I can turn off voltage readings, but it appears to be counting some current against the cumulative counter on phases that are disconnected.

Messages In This Thread
Understanding the data/code - by SuperQ - 26.04.2017, 17:11
RE: Understanding the data/code - by Epposan - 27.04.2017, 06:43
RE: Understanding the data/code - by SuperQ - 27.04.2017, 10:52
RE: Understanding the data/code - by jens - 28.04.2017, 07:25
RE: Understanding the data/code - by SuperQ - 29.04.2017, 10:35
RE: Understanding the data/code - by d55m14 - 28.04.2017, 15:07

Forum Jump:

Users browsing this thread: 2 Guest(s)