From 0cbb793944b13e7e218d4e25a09cc15e28ba0685 Mon Sep 17 00:00:00 2001 From: gferraro Date: Mon, 11 Oct 2021 12:46:11 +1300 Subject: [PATCH 1/7] return frame over dbus --- cmd/thermal-recorder/main.go | 9 ++- cmd/thermal-recorder/service.go | 25 ++++++-- cmd/thermal-recorder/snapshot.go | 98 ++++++++++++++++---------------- 3 files changed, 76 insertions(+), 56 deletions(-) diff --git a/cmd/thermal-recorder/main.go b/cmd/thermal-recorder/main.go index 9bb823b..4d3ec24 100644 --- a/cmd/thermal-recorder/main.go +++ b/cmd/thermal-recorder/main.go @@ -45,8 +45,10 @@ const ( ) var ( - version = "" - processor *motion.MotionProcessor + version = "" + processor *motion.MotionProcessor + header *headers.HeaderInfo + frameLogIntervalFirstMin = 15 frameLogInterval = 60 * 5 ) @@ -102,8 +104,11 @@ func runMain() error { log.Println("starting d-bus service") err = startService(conf.OutputDir) if err != nil { + log.Printf("serrrrrrrr %v", err) + return err } + log.Println("started d-bus service") deleteSnapshot(conf.OutputDir) diff --git a/cmd/thermal-recorder/service.go b/cmd/thermal-recorder/service.go index 8fa18cd..6c62369 100644 --- a/cmd/thermal-recorder/service.go +++ b/cmd/thermal-recorder/service.go @@ -18,9 +18,12 @@ package main import ( "errors" - + "fmt" + "github.com/TheCacophonyProject/go-cptv/cptvframe" + "github.com/TheCacophonyProject/thermal-recorder/headers" "github.com/godbus/dbus" "github.com/godbus/dbus/introspect" + "log" ) const ( @@ -50,28 +53,40 @@ func startService(dir string) error { } conn.Export(s, dbusPath, dbusName) conn.Export(genIntrospectable(s), dbusPath, "org.freedesktop.DBus.Introspectable") + log.Println("introspect done") return nil } func genIntrospectable(v interface{}) introspect.Introspectable { + log.Println("introspect") + node := &introspect.Node{ Interfaces: []introspect.Interface{{ Name: dbusName, Methods: introspect.Methods(v), }}, } + log.Printf("introspect %v", node) return introspect.NewIntrospectable(node) } // TakeSnapshot will save the next frame as a still -func (s *service) TakeSnapshot() *dbus.Error { - err := newSnapshot(s.dir) +func (s *service) TakeSnapshot() (*cptvframe.Frame, *dbus.Error) { + f, err := newSnapshot(s.dir) if err != nil { - return &dbus.Error{ + return nil, &dbus.Error{ Name: dbusName + ".StayOnForError", Body: []interface{}{err.Error()}, } } - return nil + + return f, nil +} + +func (s *service) CameraInfo() *dbus.Error { + return &dbus.Error{ + Name: dbusName + ".HeaderFailed", + Body: []interface{}{fmt.Errorf("No headers available")}, + } } diff --git a/cmd/thermal-recorder/snapshot.go b/cmd/thermal-recorder/snapshot.go index e879504..1eeb007 100644 --- a/cmd/thermal-recorder/snapshot.go +++ b/cmd/thermal-recorder/snapshot.go @@ -18,17 +18,12 @@ package main import ( "errors" - "image" - "image/color" - "image/png" + "github.com/TheCacophonyProject/go-cptv/cptvframe" "log" - "math" "os" "path" "sync" "time" - - "github.com/TheCacophonyProject/lepton3" ) const ( @@ -42,60 +37,65 @@ var ( mu sync.Mutex ) -func newSnapshot(dir string) error { +func getHeaders() *headers.HeaderInfo { + return header +} + +func newSnapshot(dir string) (*cptvframe.Frame, error) { mu.Lock() defer mu.Unlock() if time.Since(previousSnapshotTime) < allowedSnapshotPeriod { - return nil + return nil, nil } if processor == nil { - return errors.New("reading from camera has not started yet") + return nil, errors.New("reading from camera has not started yet") } f := processor.GetRecentFrame() if f == nil { - return errors.New("no frames yet") - } - g16 := image.NewGray16(image.Rect(0, 0, lepton3.FrameCols, lepton3.FrameRows)) - // Max and min are needed for normalization of the frame - var valMax uint16 - var valMin uint16 = math.MaxUint16 - var id int - for _, row := range f.Pix { - for _, val := range row { - id += int(val) - valMax = maxUint16(valMax, val) - valMin = minUint16(valMin, val) - } + return nil, errors.New("no frames yet") } - - // Check if frame had already been processed - if id == previousSnapshotID { - return nil - } - previousSnapshotID = id - - var norm = math.MaxUint16 / (valMax - valMin) - for y, row := range f.Pix { - for x, val := range row { - g16.SetGray16(x, y, color.Gray16{Y: (val - valMin) * norm}) - } - } - - out, err := os.Create(path.Join(dir, snapshotName)) - if err != nil { - return err - } - defer out.Close() - - if err := png.Encode(out, g16); err != nil { - return err - } - - // the time will be changed only if the attempt is successful - previousSnapshotTime = time.Now() - return nil + return f, nil + // g16 := image.NewGray16(image.Rect(0, 0, lepton3.FrameCols, lepton3.FrameRows)) + // // Max and min are needed for normalization of the frame + // var valMax uint16 + // var valMin uint16 = math.MaxUint16 + // var id int + // for _, row := range f.Pix { + // for _, val := range row { + // id += int(val) + // valMax = maxUint16(valMax, val) + // valMin = minUint16(valMin, val) + // } + // } + // + // // Check if frame had already been processed + // if id == previousSnapshotID { + // return nil + // } + // previousSnapshotID = id + // + // var norm = math.MaxUint16 / (valMax - valMin) + // for y, row := range f.Pix { + // for x, val := range row { + // g16.SetGray16(x, y, color.Gray16{Y: (val - valMin) * norm}) + // } + // } + // + // out, err := os.Create(path.Join(dir, snapshotName)) + // if err != nil { + // return err + // } + // defer out.Close() + // + // if err := png.Encode(out, g16); err != nil { + // return err + // } + // + // // the time will be changed only if the attempt is successful + // previousSnapshotTime = time.Now() + // return nil } func deleteSnapshot(dir string) { From bb49ee9c693280e73079a390e244e964a510c191 Mon Sep 17 00:00:00 2001 From: gferraro Date: Tue, 12 Oct 2021 12:17:52 +1300 Subject: [PATCH 2/7] updated to send frame over dbus instead of using png file --- cmd/thermal-recorder/main.go | 37 ++++++++------- cmd/thermal-recorder/service.go | 33 ++++++++----- cmd/thermal-recorder/snapshot.go | 79 ++++---------------------------- headers/headerinfo.go | 6 +-- motion/motionprocessor.go | 17 +++++-- 5 files changed, 63 insertions(+), 109 deletions(-) diff --git a/cmd/thermal-recorder/main.go b/cmd/thermal-recorder/main.go index 4d3ec24..cb5283c 100644 --- a/cmd/thermal-recorder/main.go +++ b/cmd/thermal-recorder/main.go @@ -45,9 +45,9 @@ const ( ) var ( - version = "" - processor *motion.MotionProcessor - header *headers.HeaderInfo + version = "" + processor *motion.MotionProcessor + headerInfo *headers.HeaderInfo = nil frameLogIntervalFirstMin = 15 frameLogInterval = 60 * 5 @@ -110,8 +110,6 @@ func runMain() error { } log.Println("started d-bus service") - deleteSnapshot(conf.OutputDir) - log.Println("host initialisation") if _, err := host.Init(); err != nil { return err @@ -149,33 +147,34 @@ func handleConn(conn net.Conn, conf *Config) error { leptondController.SetAutoFFC(true) totalFrames := 0 reader := bufio.NewReader(conn) - header, err := headers.ReadHeaderInfo(reader) + var err error + headerInfo, err = headers.ReadHeaderInfo(reader) if err != nil { return err } - log.Printf("connection from %s %s (%dx%d@%dfps)", header.Brand(), header.Model(), header.ResX(), header.ResY(), header.FPS()) - conf.LoadMotionConfig(header.Model()) + log.Printf("connection from %s %s (%dx%d@%dfps)", headerInfo.Brand(), headerInfo.Model(), headerInfo.ResX(), headerInfo.ResY(), headerInfo.FPS()) + conf.LoadMotionConfig(headerInfo.Model()) logConfig(conf) - parseFrame := frameParser(header.Brand(), header.Model()) + parseFrame := frameParser(headerInfo.Brand(), headerInfo.Model()) if parseFrame == nil { - return fmt.Errorf("unable to handle frames for %s %s", header.Brand(), header.Model()) + return fmt.Errorf("unable to handle frames for %s %s", headerInfo.Brand(), headerInfo.Model()) } - cptvRecorder := NewCPTVFileRecorder(conf, header, header.Brand(), header.Model(), header.CameraSerial(), header.Firmware()) + cptvRecorder := NewCPTVFileRecorder(conf, headerInfo, headerInfo.Brand(), headerInfo.Model(), headerInfo.CameraSerial(), headerInfo.Firmware()) defer cptvRecorder.Stop() var recorder recorder.Recorder = cptvRecorder if conf.Throttler.Activate { minRecordingLength := conf.Recorder.MinSecs + conf.Recorder.PreviewSecs - recorder = throttle.NewThrottledRecorder(cptvRecorder, &conf.Throttler, minRecordingLength, new(throttle.ThrottledEventRecorder), header) + recorder = throttle.NewThrottledRecorder(cptvRecorder, &conf.Throttler, minRecordingLength, new(throttle.ThrottledEventRecorder), headerInfo) } // Constant Recorder var constantRecorder *CPTVFileRecorder if conf.Recorder.ConstantRecorder { - constantRecorder = NewCPTVFileRecorder(conf, header, header.Brand(), header.Model(), header.CameraSerial(), header.Firmware()) + constantRecorder = NewCPTVFileRecorder(conf, headerInfo, headerInfo.Brand(), headerInfo.Model(), headerInfo.CameraSerial(), headerInfo.Firmware()) constantRecorder.SetAsConstantRecorder() } @@ -186,14 +185,14 @@ func handleConn(conn net.Conn, conf *Config) error { &conf.Location, nil, recorder, - header, + headerInfo, constantRecorder, ) log.Print("reading frames") - frameLogIntervalFirstMin *= header.FPS() - frameLogInterval *= header.FPS() - rawFrame := make([]byte, header.FrameSize()) + frameLogIntervalFirstMin *= headerInfo.FPS() + frameLogInterval *= headerInfo.FPS() + rawFrame := make([]byte, headerInfo.FrameSize()) for { _, err := io.ReadFull(reader, rawFrame[:5]) if err != nil { @@ -202,7 +201,7 @@ func handleConn(conn net.Conn, conf *Config) error { message := string(rawFrame[:5]) if message == clearBuffer { log.Print("clearing motion buffer") - processor.Reset(header) + processor.Reset(headerInfo) continue } @@ -214,7 +213,7 @@ func handleConn(conn net.Conn, conf *Config) error { totalFrames++ if totalFrames%frameLogIntervalFirstMin == 0 && - totalFrames <= 60*header.FPS() || totalFrames%frameLogInterval == 0 { + totalFrames <= 60*headerInfo.FPS() || totalFrames%frameLogInterval == 0 { log.Printf("%d frames for this connection", totalFrames) } diff --git a/cmd/thermal-recorder/service.go b/cmd/thermal-recorder/service.go index 6c62369..8ca2de7 100644 --- a/cmd/thermal-recorder/service.go +++ b/cmd/thermal-recorder/service.go @@ -18,9 +18,9 @@ package main import ( "errors" - "fmt" "github.com/TheCacophonyProject/go-cptv/cptvframe" "github.com/TheCacophonyProject/thermal-recorder/headers" + "github.com/godbus/dbus" "github.com/godbus/dbus/introspect" "log" @@ -32,7 +32,6 @@ const ( ) type service struct { - dir string } func startService(dir string) error { @@ -48,9 +47,7 @@ func startService(dir string) error { return errors.New("name already taken") } - s := &service{ - dir: dir, - } + s := &service{} conn.Export(s, dbusPath, dbusName) conn.Export(genIntrospectable(s), dbusPath, "org.freedesktop.DBus.Introspectable") log.Println("introspect done") @@ -72,21 +69,33 @@ func genIntrospectable(v interface{}) introspect.Introspectable { } // TakeSnapshot will save the next frame as a still -func (s *service) TakeSnapshot() (*cptvframe.Frame, *dbus.Error) { - f, err := newSnapshot(s.dir) +func (s *service) TakeSnapshot(lastFrame int) (*cptvframe.Frame, *dbus.Error) { + f, err := newSnapshot(lastFrame) if err != nil { return nil, &dbus.Error{ Name: dbusName + ".StayOnForError", Body: []interface{}{err.Error()}, } } - return f, nil } +func (s *service) CameraInfo() (map[string]interface{}, *dbus.Error) { -func (s *service) CameraInfo() *dbus.Error { - return &dbus.Error{ - Name: dbusName + ".HeaderFailed", - Body: []interface{}{fmt.Errorf("No headers available")}, + if headerInfo == nil { + return nil, &dbus.Error{ + Name: dbusName + ".NoHeaderInfo", + Body: nil, + } + } + camera_specs := map[string]interface{}{ + headers.XResolution: headerInfo.ResX(), + headers.YResolution: headerInfo.ResY(), + headers.FrameSize: headerInfo.FrameSize(), + headers.Model: headerInfo.Model(), + headers.Brand: headerInfo.Brand(), + headers.FPS: headerInfo.FPS(), + headers.Serial: headerInfo.CameraSerial(), + headers.Firmware: headerInfo.Firmware(), } + return camera_specs, nil } diff --git a/cmd/thermal-recorder/snapshot.go b/cmd/thermal-recorder/snapshot.go index 1eeb007..4097732 100644 --- a/cmd/thermal-recorder/snapshot.go +++ b/cmd/thermal-recorder/snapshot.go @@ -19,15 +19,11 @@ package main import ( "errors" "github.com/TheCacophonyProject/go-cptv/cptvframe" - "log" - "os" - "path" "sync" "time" ) const ( - snapshotName = "still.png" allowedSnapshotPeriod = 500 * time.Millisecond ) @@ -37,83 +33,26 @@ var ( mu sync.Mutex ) -func getHeaders() *headers.HeaderInfo { - return header -} - -func newSnapshot(dir string) (*cptvframe.Frame, error) { +func newSnapshot(lastFrame int) (*cptvframe.Frame, error) { mu.Lock() defer mu.Unlock() if time.Since(previousSnapshotTime) < allowedSnapshotPeriod { return nil, nil } - if processor == nil { return nil, errors.New("reading from camera has not started yet") } - f := processor.GetRecentFrame() - if f == nil { - return nil, errors.New("no frames yet") + if lastFrame >= 0 && uint32(lastFrame) == processor.CurrentFrame { + return nil, errors.New("no new frames yet") } - return f, nil - // g16 := image.NewGray16(image.Rect(0, 0, lepton3.FrameCols, lepton3.FrameRows)) - // // Max and min are needed for normalization of the frame - // var valMax uint16 - // var valMin uint16 = math.MaxUint16 - // var id int - // for _, row := range f.Pix { - // for _, val := range row { - // id += int(val) - // valMax = maxUint16(valMax, val) - // valMin = minUint16(valMin, val) - // } - // } - // - // // Check if frame had already been processed - // if id == previousSnapshotID { - // return nil - // } - // previousSnapshotID = id - // - // var norm = math.MaxUint16 / (valMax - valMin) - // for y, row := range f.Pix { - // for x, val := range row { - // g16.SetGray16(x, y, color.Gray16{Y: (val - valMin) * norm}) - // } - // } - // - // out, err := os.Create(path.Join(dir, snapshotName)) - // if err != nil { - // return err - // } - // defer out.Close() - // - // if err := png.Encode(out, g16); err != nil { - // return err - // } - // - // // the time will be changed only if the attempt is successful - // previousSnapshotTime = time.Now() - // return nil -} -func deleteSnapshot(dir string) { - if err := os.Remove(path.Join(dir, snapshotName)); err != nil && !os.IsNotExist(err) { - log.Printf("error with deleting snapshot image %s", err) - } -} - -func maxUint16(a, b uint16) uint16 { - if a > b { - return a + frameNum, f := processor.GetRecentFrame() + if f == nil { + return nil, errors.New("no frames yet") } - return b -} - -func minUint16(a, b uint16) uint16 { - if a < b { - return a + if f.Status.FrameCount == 0 { + f.Status.FrameCount = int(frameNum) } - return b + return f, nil } diff --git a/headers/headerinfo.go b/headers/headerinfo.go index d4ac6a2..539568d 100644 --- a/headers/headerinfo.go +++ b/headers/headerinfo.go @@ -95,8 +95,7 @@ func ReadHeaderInfo(reader *bufio.Reader) (*HeaderInfo, error) { if err != nil { return nil, err } - - return &HeaderInfo{ + header := &HeaderInfo{ resX: toInt(h[XResolution]), resY: toInt(h[YResolution]), fps: toInt(h[FPS]), @@ -105,7 +104,8 @@ func ReadHeaderInfo(reader *bufio.Reader) (*HeaderInfo, error) { model: toStr(h[Model]), serial: toInt(h[Serial]), firmware: toStr(h[Firmware]), - }, nil + } + return header, nil } func toInt(v interface{}) int { diff --git a/motion/motionprocessor.go b/motion/motionprocessor.go index c5d1ddb..eed2114 100644 --- a/motion/motionprocessor.go +++ b/motion/motionprocessor.go @@ -18,11 +18,11 @@ package motion import ( "errors" - "reflect" - "time" - "github.com/TheCacophonyProject/go-cptv/cptvframe" "github.com/TheCacophonyProject/window" + "math" + "reflect" + "time" config "github.com/TheCacophonyProject/go-config" "github.com/TheCacophonyProject/thermal-recorder/loglimiter" @@ -59,6 +59,7 @@ func NewMotionProcessor( log: loglimiter.New(minLogInterval), constantRecorder: constantRecorder, constantRecording: !isNullOrNullPointer(constantRecorder), + CurrentFrame: 0, } } @@ -89,6 +90,7 @@ type MotionProcessor struct { constantRecording bool constantRecorder recorder.Recorder crFrames int + CurrentFrame uint32 } type RecordingListener interface { @@ -109,6 +111,11 @@ func (mp *MotionProcessor) Process(rawFrame []byte) error { mp.stopConstantRecorder() return err } + if mp.CurrentFrame == math.MaxUint32 { + mp.CurrentFrame = 0 + } else { + mp.CurrentFrame += 1 + } mp.process(frame) mp.processConstantRecorder(frame) return nil @@ -190,8 +197,8 @@ func (mp *MotionProcessor) ProcessFrame(srcFrame *cptvframe.Frame) { mp.process(frame) } -func (mp *MotionProcessor) GetRecentFrame() *cptvframe.Frame { - return mp.frameLoop.CopyRecent() +func (mp *MotionProcessor) GetRecentFrame() (uint32, *cptvframe.Frame) { + return mp.CurrentFrame, mp.frameLoop.CopyRecent() } func (mp *MotionProcessor) canStartWriting() error { From 5f116a1fd040dfac36dcf909fa935f76950760a0 Mon Sep 17 00:00:00 2001 From: gferraro Date: Wed, 13 Oct 2021 14:00:12 +1300 Subject: [PATCH 3/7] tidy up --- cmd/thermal-recorder/main.go | 3 --- cmd/thermal-recorder/service.go | 6 ------ 2 files changed, 9 deletions(-) diff --git a/cmd/thermal-recorder/main.go b/cmd/thermal-recorder/main.go index cb5283c..bf13637 100644 --- a/cmd/thermal-recorder/main.go +++ b/cmd/thermal-recorder/main.go @@ -104,11 +104,8 @@ func runMain() error { log.Println("starting d-bus service") err = startService(conf.OutputDir) if err != nil { - log.Printf("serrrrrrrr %v", err) - return err } - log.Println("started d-bus service") log.Println("host initialisation") if _, err := host.Init(); err != nil { diff --git a/cmd/thermal-recorder/service.go b/cmd/thermal-recorder/service.go index 8ca2de7..a17332c 100644 --- a/cmd/thermal-recorder/service.go +++ b/cmd/thermal-recorder/service.go @@ -23,7 +23,6 @@ import ( "github.com/godbus/dbus" "github.com/godbus/dbus/introspect" - "log" ) const ( @@ -50,21 +49,16 @@ func startService(dir string) error { s := &service{} conn.Export(s, dbusPath, dbusName) conn.Export(genIntrospectable(s), dbusPath, "org.freedesktop.DBus.Introspectable") - log.Println("introspect done") - return nil } func genIntrospectable(v interface{}) introspect.Introspectable { - log.Println("introspect") - node := &introspect.Node{ Interfaces: []introspect.Interface{{ Name: dbusName, Methods: introspect.Methods(v), }}, } - log.Printf("introspect %v", node) return introspect.NewIntrospectable(node) } From 2eec61ca512227a106b929f0d7052b7a3f53341c Mon Sep 17 00:00:00 2001 From: gferraro Date: Wed, 13 Oct 2021 14:02:43 +1300 Subject: [PATCH 4/7] go imported --- cmd/thermal-recorder/service.go | 1 + cmd/thermal-recorder/snapshot.go | 3 ++- motion/motionprocessor.go | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/thermal-recorder/service.go b/cmd/thermal-recorder/service.go index a17332c..afb50da 100644 --- a/cmd/thermal-recorder/service.go +++ b/cmd/thermal-recorder/service.go @@ -18,6 +18,7 @@ package main import ( "errors" + "github.com/TheCacophonyProject/go-cptv/cptvframe" "github.com/TheCacophonyProject/thermal-recorder/headers" diff --git a/cmd/thermal-recorder/snapshot.go b/cmd/thermal-recorder/snapshot.go index 4097732..cebb763 100644 --- a/cmd/thermal-recorder/snapshot.go +++ b/cmd/thermal-recorder/snapshot.go @@ -18,9 +18,10 @@ package main import ( "errors" - "github.com/TheCacophonyProject/go-cptv/cptvframe" "sync" "time" + + "github.com/TheCacophonyProject/go-cptv/cptvframe" ) const ( diff --git a/motion/motionprocessor.go b/motion/motionprocessor.go index eed2114..162a700 100644 --- a/motion/motionprocessor.go +++ b/motion/motionprocessor.go @@ -18,12 +18,13 @@ package motion import ( "errors" - "github.com/TheCacophonyProject/go-cptv/cptvframe" - "github.com/TheCacophonyProject/window" "math" "reflect" "time" + "github.com/TheCacophonyProject/go-cptv/cptvframe" + "github.com/TheCacophonyProject/window" + config "github.com/TheCacophonyProject/go-config" "github.com/TheCacophonyProject/thermal-recorder/loglimiter" "github.com/TheCacophonyProject/thermal-recorder/recorder" From 5aac8f637dd5d047ef7c4969a7c558bb46c18553 Mon Sep 17 00:00:00 2001 From: gferraro Date: Fri, 5 Nov 2021 10:56:06 +1300 Subject: [PATCH 5/7] correct error name and remove unnessesary code --- cmd/thermal-recorder/service.go | 2 +- motion/motionprocessor.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/thermal-recorder/service.go b/cmd/thermal-recorder/service.go index afb50da..9ad8252 100644 --- a/cmd/thermal-recorder/service.go +++ b/cmd/thermal-recorder/service.go @@ -68,7 +68,7 @@ func (s *service) TakeSnapshot(lastFrame int) (*cptvframe.Frame, *dbus.Error) { f, err := newSnapshot(lastFrame) if err != nil { return nil, &dbus.Error{ - Name: dbusName + ".StayOnForError", + Name: dbusName + ".TakeSnapshot", Body: []interface{}{err.Error()}, } } diff --git a/motion/motionprocessor.go b/motion/motionprocessor.go index 162a700..9f529a4 100644 --- a/motion/motionprocessor.go +++ b/motion/motionprocessor.go @@ -112,11 +112,7 @@ func (mp *MotionProcessor) Process(rawFrame []byte) error { mp.stopConstantRecorder() return err } - if mp.CurrentFrame == math.MaxUint32 { - mp.CurrentFrame = 0 - } else { - mp.CurrentFrame += 1 - } + mp.CurrentFrame += 1 mp.process(frame) mp.processConstantRecorder(frame) return nil From f928f881bdce1546a739ab4690454219bc2be218 Mon Sep 17 00:00:00 2001 From: gferraro Date: Fri, 5 Nov 2021 11:01:38 +1300 Subject: [PATCH 6/7] fix travis --- motion/motionprocessor.go | 1 - 1 file changed, 1 deletion(-) diff --git a/motion/motionprocessor.go b/motion/motionprocessor.go index 9f529a4..7faf2e9 100644 --- a/motion/motionprocessor.go +++ b/motion/motionprocessor.go @@ -18,7 +18,6 @@ package motion import ( "errors" - "math" "reflect" "time" From d4f76ad9b8bfdf33ccf8db818a59e26d795b4b0c Mon Sep 17 00:00:00 2001 From: gferraro Date: Wed, 17 Nov 2021 11:20:06 +1300 Subject: [PATCH 7/7] up go-cptv version --- go.mod | 2 +- go.sum | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a0e3d0f..c4e68c0 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/TheCacophonyProject/event-reporter v1.3.2-0.20200210010421-ca3fcb76a231 github.com/TheCacophonyProject/go-config v1.6.4 - github.com/TheCacophonyProject/go-cptv v0.0.0-20201215230510-ae7134e91a71 + github.com/TheCacophonyProject/go-cptv v0.0.0-20211109233846-8c32a5d161f7 github.com/TheCacophonyProject/lepton3 v0.0.0-20210324024142-003e5546e30f github.com/TheCacophonyProject/window v0.0.0-20200312071457-7fc8799fdce7 github.com/alexflint/go-arg v1.3.0 diff --git a/go.sum b/go.sum index a2c3af2..2b1a7dd 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/TheCacophonyProject/go-config v1.6.4/go.mod h1:eDQfBjmTDh/l+2QLBgsotm github.com/TheCacophonyProject/go-cptv v0.0.0-20200116020937-858bd8b71512/go.mod h1:8H6Aaft5549sIWxcsuCIL2o60/TQkoF93fVoSTpgZb8= github.com/TheCacophonyProject/go-cptv v0.0.0-20200616224711-fc633122087a/go.mod h1:Vg73Ezn4kr8qDNP9LNgjki9qgi+5T/0Uc9oDyflaYUY= github.com/TheCacophonyProject/go-cptv v0.0.0-20200818214604-bd5d4aa36043/go.mod h1:wG4/P/TsGtk33uBClYPjRlSbcdQrIASXutOUV8LMn2o= -github.com/TheCacophonyProject/go-cptv v0.0.0-20201215230510-ae7134e91a71 h1:g6XLYIt3hFo2JOQhbfySLxcFFv0kofg0L1Z7MyNXsLc= -github.com/TheCacophonyProject/go-cptv v0.0.0-20201215230510-ae7134e91a71/go.mod h1:pExPO/gk28kgWnd1z55xJ7YtC0KgQBDKvJoGYExc+l0= +github.com/TheCacophonyProject/go-cptv v0.0.0-20211109233846-8c32a5d161f7 h1:sf9KTj7u3mFMx5NsLpQtf8FtP3BDZAgtHutanDygQgk= +github.com/TheCacophonyProject/go-cptv v0.0.0-20211109233846-8c32a5d161f7/go.mod h1:T74NuMjo2YrLoyhAd0+9hj2pgVt8F7DWWzTMlU8aH6k= github.com/TheCacophonyProject/lepton3 v0.0.0-20200121020734-2ae28662e1bc/go.mod h1:xzPAWtvVCbJdJC2Gn1cG0Ovs/VP7XGGiQpUU8wU4HME= github.com/TheCacophonyProject/lepton3 v0.0.0-20200213011619-1934a9300bd3/go.mod h1:xzPAWtvVCbJdJC2Gn1cG0Ovs/VP7XGGiQpUU8wU4HME= github.com/TheCacophonyProject/lepton3 v0.0.0-20200909032119-e2b2b778a8ee/go.mod h1:+FTQKx63hdEbuTe/nxNv9TQ2EWqdlzMZx7UNLGCX9SE= @@ -97,6 +97,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -122,6 +123,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -138,8 +141,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -172,6 +176,7 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=