diff --git a/provider/modbus.go b/provider/modbus.go index e85b4b158..a50a26246 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 }