--- a/Beremiz_service.py Thu May 28 11:16:59 2020 +0100
+++ b/Beremiz_service.py Sat Jun 06 08:43:41 2020 +0100
@@ -493,6 +493,7 @@
installThreadExcepthook()
havewamp = False
haveBNconf = False
+haveMBconf = False
if havetwisted:
@@ -512,7 +513,16 @@
haveBNconf = True
except Exception:
LogMessageAndException(_("BACnet configuration web interface - import failed :"))
-
+
+ # Try to add support for Modbus configuration via web server interface
+ # NOTE:Modbus web config only makes sense if web server is available
+ if webport is not None:
+ try:
+ import runtime.Modbus_config as MBconf
+ haveMBconf = True
+ except Exception:
+ LogMessageAndException(_("Modbus configuration web interface - import failed :"))
+
try:
import runtime.WampClient as WC # pylint: disable=ungrouped-imports
WC.WorkingDir = WorkingDir
@@ -557,6 +567,12 @@
except Exception:
LogMessageAndException(_("BACnet web configuration failed startup. "))
+ if haveMBconf:
+ try:
+ MBconf.init(plcobj, NS, WorkingDir)
+ except Exception:
+ LogMessageAndException(_("Modbus web configuration failed startup. "))
+
if havewamp:
try:
WC.SetServer(pyroserver)