config switch for modbus debugging
This commit is contained in:
parent
9f6f449c5a
commit
d89d705b76
@ -20,7 +20,10 @@ class CommunicationProcessor(threading.Thread):
|
|||||||
wiringpi.wiringPiSetup()
|
wiringpi.wiringPiSetup()
|
||||||
wiringpi.pinMode(ERROR_PIN, wiringpi.OUTPUT)
|
wiringpi.pinMode(ERROR_PIN, wiringpi.OUTPUT)
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
logging.getLogger('pymodbus').setLevel(logging.ERROR)
|
if self.config.modbusDebug:
|
||||||
|
logging.getLogger('pymodbus').setLevel(logging.DEBUG)
|
||||||
|
else:
|
||||||
|
logging.getLogger('pymodbus').setLevel(logging.ERROR)
|
||||||
self.logger = logging.getLogger('CommunicationProcessor')
|
self.logger = logging.getLogger('CommunicationProcessor')
|
||||||
|
|
||||||
def __getSerial(self):
|
def __getSerial(self):
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
class Config(object):
|
class Config(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.logFile = '/tmp/mbm.log'
|
self.logFile = '/tmp/mbm.log'
|
||||||
|
self.modbusDebug = False
|
||||||
self.mqttBrokerHost = '172.16.2.16'
|
self.mqttBrokerHost = '172.16.2.16'
|
||||||
self.mqttBrokerPort = 1883
|
self.mqttBrokerPort = 1883
|
||||||
self.mqttLogin = ''
|
self.mqttLogin = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user