Tom,
I have written a weewx device driver which collects data from a modbus energy meter.
=======
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.compat import iteritems
from collections import OrderedDict
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.compat import iteritems
from collections import OrderedDict
=======
In version 3.9.2 I got only weewx debug messages in the syslog file when debug was set to 1.
In version 4.0.0b14 I also get the pymodbus logging, see snippet below.
This logging is HUGE: 20,500 lines per minute!!
====================
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Running transaction 2184
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: SEND: 0x1 0x4 0x0 0x52 0x0 0x2 0xd0 0x1a
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.framer.rtu_framer: Changing state to IDLE - Last Frame End - 1584184619.972779, Current Time stamp - 1584184620.01192
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.client.sync: New Transaction state 'SENDING'
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: RECV: 0x1 0x4 0x4 0x47 0x12 0xdc 0xa6 0x97 0x8f
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.framer.rtu_framer: Getting Frame - 0x4 0x4 0x47 0x12 0xdc 0xa6
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.factory: Factory Response[ReadInputRegistersResponse: 4]
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.framer.rtu_framer: Frame advanced, resetting header!!
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Adding transaction 1
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Getting transaction 1
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.transaction: Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.payload: [18194, 56486]
Mar 14 08:17:00 pi31 mben[1835] DEBUG pymodbus.payload: [b'G\x12', b'\xdc\xa6']
Mar 14 08:17:00 pi31
====================
As a workaround I have set the folowing line in file/etc/rsyslog.conf.
:msg,
contains, "DEBUG pymodbus" stop
which suppresses the log lines in the syslog file.
But I wonder: is there a better way?
Luc