From 6505223782fc26290a1b6c5c6314553368a0067f Mon Sep 17 00:00:00 2001 From: Russell Stanley Date: Thu, 3 Feb 2022 16:28:28 +1030 Subject: [PATCH] reduce max frames --- cmd/rv/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/rv/main.go b/cmd/rv/main.go index 7b6e4c85..d14466e4 100644 --- a/cmd/rv/main.go +++ b/cmd/rv/main.go @@ -107,7 +107,7 @@ const ( profilePath = "rv.prof" pkg = "rv: " runPreDelay = 20 * time.Second - maxImages = 10 // Max number of images read when evaluating turbidity. + maxImages = 1 // Max number of images read when evaluating turbidity. ) // Software define pin values. @@ -189,12 +189,14 @@ func (tp *turbidityProbe) Write(p []byte) (int, error) { imgs = append(imgs, img.Clone()) } if len(imgs) <= 0 { - tp.log.Log(logger.Info, "no frames found") + tp.log.Log(logger.Warning, "no frames found", "error", err.Error()) return len(p), nil } + tp.log.Log(logger.Debug, "found frames", "frames", len(imgs)) // Process video data to get saturation and contrast scores. res, err := tp.ts.Evaluate(imgs) + tp.log.Log(logger.Debug, "finished evaluation") if err != nil { tp.log.Error("evaluate failed", "error", err.Error()) return len(p), err @@ -240,7 +242,7 @@ func main() { rv *revid.Revid p *turbidityProbe ) - p, err := NewTurbidityProbe(*log, 60*time.Second) + p, err := NewTurbidityProbe(*log, 120*time.Second) log.Log(logger.Debug, "initialising netsender client") ns, err := netsender.New(log, nil, readPin(p, rv, log), nil, createVarMap())