From 6cbfc55902e1469ad78ff5fddc4905c9684351bc Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 21 Apr 2020 11:23:29 +0200 Subject: [PATCH] Minor fixes --- provider/modbus.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/modbus.go b/provider/modbus.go index e85b4b1584..a50a262462 100644 --- a/provider/modbus.go +++ b/provider/modbus.go @@ -10,6 +10,7 @@ import ( "github.com/volkszaehler/mbmd/meters/sunspec" ) +// Modbus implements modbus RTU and TCP access type Modbus struct { log *api.Logger conn meters.Connection @@ -130,7 +131,9 @@ func (m *Modbus) FloatGetter() (float64, error) { res, err = dev.QueryOp(m.conn.ModbusClient(), m.op.IEC61850) } - m.log.TRACE.Printf("%+v", res) + if err == nil { + m.log.TRACE.Printf("%+v", res) + } return res.Value, err }