#为了演示，我们把下面的脚本新建到main.py脚本文件中，并且从mylib中引入测试函数。
#在问题返回时 出现版本信息 其他正常指令不回复[减少问题的处理  -- 因为不涉及与控制器的通信]
#softwareVersion = "2.31" #2021-03-14 23:26:18 软件版本 
#softwareVersion = "2.32 (2021-04-21)" #2021-04-21 11:08:01 修改HTML架构 #2021-03-14 23:26:18 软件版本 
#2021-04-24 18:08:58 dataserverIP = ""   #服务器IP
#dataserverPort = 61005           #服务器端口
# 2023-11-20 18:08:08 import operator
# from m1006debugmem import * #2023-03-03 19:06:39
import sys
if 82 - 82: Iii1i
from . m1001CloudServerUDP import *
from . m1001CloudServerTCP import *
if 87 - 87: Ii % i1i1i1111I . Oo / OooOoo * I1Ii1I1 - I1I
from . m1002CloudServerWEBAPI import *
from . m1004websocketServer import WGWSServerProtocol
from . mMonitorInfo import wgcontrollerDoorStatus , mMonitorInfo , wgConRPCLongTime
from autobahn . twisted . websocket import WebSocketServerFactory , WebSocketServerProtocol
if 81 - 81: i1 + ooOOO / oOo0O00 * i1iiIII111 * IiIIii11Ii
if 84 - 84: ooo000 - Ooo0Ooo + iI1iII1I1I1i . IIiIIiIi11I1
if 98 - 98: I11iiIi11i1I % oOO
if 31 - 31: i1I
import paho . mqtt . publish as publish
import paho . mqtt . client as mqtt
from . wgAppConfig import wgAppConfig
if 9 - 9: IiI11Ii111 / oOo0O00 / IiIIii11Ii - I11iiIi11i1I - iI1iII1I1I1i
if 16 - 16: i1i1i1111I / i1iiIII111
if 3 - 3: i1 % i1 % i1i1i1111I . Ii * i1
if 9 - 9: i1iiIII111
if 10 - 10: ooOOO / IIiIIiIi11I1 * oOO / i1I / i1I
from . m1005rsa import *
if 61 - 61: Ooo0Ooo - I1I
if 13 - 13: Ooo0Ooo
def getConfigString ( paramval , paramName ) :
 OO0o000o = configparser . ConfigParser ( allow_no_value = True )
 OO0o000o . read ( "wgconfig.ini" , encoding = "utf-8-sig" )
 if ( OO0o000o . has_option ( 'wgconf' , paramName ) ) :
  paramval = OO0o000o [ 'wgconf' ] [ paramName ]
 return paramval
 if 8 - 8: i1iiIII111 * i1 . I1I / oOO
def getConfigInt ( paramval , paramName ) :
 OO0o000o = configparser . ConfigParser ( allow_no_value = True )
 OO0o000o . read ( "wgconfig.ini" , encoding = "utf-8-sig" )
 if ( OO0o000o . has_option ( 'wgconf' , paramName ) ) :
  paramval = int ( OO0o000o [ 'wgconf' ] [ paramName ] )
 return paramval
 if 58 - 58: I1Ii1I1 - ooOOO
 if 60 - 60: iI1iII1I1I1i . oOO
 if 13 - 13: oOO
 if 2 - 2: i1
 if 22 - 22: IIiIIiIi11I1 - ooo000 / I1Ii1I1 . ooo000
 if 1 - 1: iI1iII1I1I1i + Ooo0Ooo + oOO * IIiIIiIi11I1
 if 20 - 20: I1I + Ii
 if 75 - 75: Ii % i1iiIII111 * Ii . IIiIIiIi11I1 % I11iiIi11i1I % I1Ii1I1
 if 8 - 8: I1Ii1I1 . IiI11Ii111 . i1 . Oo - i1I
 if 32 - 32: Ii % i1i1i1111I % i1I - I11iiIi11i1I % i1iiIII111
 if 34 - 34: i1iiIII111 * i1
 if 34 - 34: oOo0O00 / i1iiIII111 - Iii1i . iI1iII1I1I1i
 if 80 - 80: i1i1i1111I . I1I % ooOOO % IiIIii11Ii / i1i1i1111I
 if 32 - 32: I1Ii1I1 + oOO - oOo0O00
 if 79 - 79: Iii1i % oOO * Oo + ooOOO / Oo . oOO
 if 20 - 20: IiI11Ii111 + i1iiIII111 / I1I
 if 88 - 88: I11iiIi11i1I + ooOOO - i1i1i1111I . Ooo0Ooo * Ii + Iii1i
 if 43 - 43: ooOOO * I1Ii1I1
 if 95 - 95: Ooo0Ooo % Iii1i % i1i1i1111I . OooOoo
 if 70 - 70: IiIIii11Ii
 if 75 - 75: Ooo0Ooo / Ii / IiIIii11Ii + IiIIii11Ii . I1I
 if 88 - 88: Oo * IiIIii11Ii
 if 100 - 100: IiI11Ii111 - OooOoo * I1Ii1I1 / Ooo0Ooo / Iii1i
 if 23 - 23: Ooo0Ooo + i1 * I1Ii1I1 + Oo * Ii - IIiIIiIi11I1
 if 29 - 29: IiIIii11Ii - oOo0O00
 if 30 - 30: I1I . ooo000
 if 43 - 43: ooOOO . I11iiIi11i1I + ooo000
 if 87 - 87: Iii1i + ooOOO . i1I / Ii + Oo
 if 77 - 77: i1iiIII111 + IiI11Ii111 - Oo % ooo000
 if 74 - 74: Ii + Ooo0Ooo
 if 1 - 1: I1I % Ooo0Ooo + i1iiIII111 . i1iiIII111 % Oo
 if 93 - 93: oOo0O00 % Ooo0Ooo * i1iiIII111
 if 52 - 52: oOO + I1I / ooo000 - I1Ii1I1 * i1I % oOo0O00
 if 52 - 52: oOo0O00 . I1I + i1I - i1iiIII111 % iI1iII1I1I1i
 if 57 - 57: I1I * IIiIIiIi11I1 % I1Ii1I1 * i1i1i1111I
 if 37 - 37: IiI11Ii111 * i1i1i1111I + oOo0O00 / I1I / OooOoo
 if 4 - 4: i1
 if 61 - 61: iI1iII1I1I1i . i1I - ooo000 / ooo000 - i1
 if 19 - 19: Iii1i * Ooo0Ooo . I1Ii1I1 / I11iiIi11i1I * Ii - oOO
 if 32 - 32: iI1iII1I1I1i
 if 18 - 18: I11iiIi11i1I * IiI11Ii111 % iI1iII1I1I1i + IiI11Ii111
 if 93 - 93: oOO - I1Ii1I1 - IIiIIiIi11I1 * ooOOO - i1
 if 82 - 82: IIiIIiIi11I1 % i1 * ooOOO
 if 57 - 57: oOo0O00
 if 31 - 31: i1iiIII111 + i1i1i1111I % OooOoo
 if 20 - 20: OooOoo - I1I
 if 9 - 9: i1iiIII111 - iI1iII1I1I1i % Ii - I1I
 if 54 - 54: Iii1i % ooo000 % Iii1i - IiIIii11Ii
 if 39 - 39: oOO - oOO * i1 % IIiIIiIi11I1
 if 29 - 29: IIiIIiIi11I1 - ooo000 . i1iiIII111
 if 86 - 86: I1Ii1I1 - OooOoo - oOO % ooo000 . i1I % Iii1i
 if 11 - 11: OooOoo - I1Ii1I1 - ooOOO . i1iiIII111 - iI1iII1I1I1i / i1iiIII111
 if 44 - 44: Ooo0Ooo + i1i1i1111I + Iii1i - oOO
 if 7 - 7: i1i1i1111I / Ii * Iii1i
 if 32 - 32: IiI11Ii111 . OooOoo
 if 31 - 31: Oo - i1I
 if 28 - 28: ooOOO * I1Ii1I1 + IiI11Ii111 % Oo
 if 100 - 100: Oo + i1I
 if 4 - 4: ooo000 % I1I - i1i1i1111I
 if 76 - 76: i1 * oOo0O00 . IiI11Ii111 * i1I . IiIIii11Ii . oOO
 if 55 - 55: i1i1i1111I + i1iiIII111 % Ooo0Ooo . Oo - IiIIii11Ii - iI1iII1I1I1i
 if 91 - 91: I1Ii1I1 - I11iiIi11i1I
 if 84 - 84: oOO % iI1iII1I1I1i - Ooo0Ooo
 if 94 - 94: i1iiIII111 + i1i1i1111I / iI1iII1I1I1i + iI1iII1I1I1i / i1I
 if 79 - 79: i1iiIII111 - IIiIIiIi11I1 . I1Ii1I1 + I1I - ooOOO + i1iiIII111
 if 36 - 36: ooOOO * Iii1i % I1I % i1 . Ooo0Ooo
 if 63 - 63: IIiIIiIi11I1 / IIiIIiIi11I1 * Iii1i - oOo0O00 . i1
 if 52 - 52: oOo0O00 / i1I * IIiIIiIi11I1 + I11iiIi11i1I % Ooo0Ooo + oOO
 if 43 - 43: iI1iII1I1I1i * oOo0O00 + ooOOO
 if 30 - 30: I1I
 if 41 - 41: oOO
 if 98 - 98: I1I / IIiIIiIi11I1 / i1I + IiI11Ii111 % Oo + I1I
 if 38 - 38: I1Ii1I1 + oOo0O00
 if 2 - 2: OooOoo % Ii + oOO . OooOoo + IIiIIiIi11I1 * Oo
 if 2 - 2: IIiIIiIi11I1 + iI1iII1I1I1i - I1Ii1I1 + ooOOO . IIiIIiIi11I1
 if 15 - 15: ooo000
 if 63 - 63: i1I
 if 81 - 81: OooOoo . i1I / i1i1i1111I + Oo / Ooo0Ooo % IiI11Ii111
 if 77 - 77: I11iiIi11i1I / iI1iII1I1I1i - oOo0O00 - Ooo0Ooo % oOo0O00
 if 73 - 73: IiI11Ii111 . Oo * I1I / i1i1i1111I + I1Ii1I1
 if 31 - 31: i1i1i1111I % I1Ii1I1
 if 1 - 1: IiI11Ii111 - oOo0O00 - i1 . oOo0O00
 if 91 - 91: iI1iII1I1I1i * i1 . ooOOO
 if 81 - 81: I1I * Oo - i1 % OooOoo * ooOOO
 if 19 - 19: Ii
 if 22 - 22: i1I % iI1iII1I1I1i + Oo
 if 60 - 60: ooo000 + I11iiIi11i1I + IIiIIiIi11I1 % i1i1i1111I - Ii % Ooo0Ooo
 if 95 - 95: ooOOO % i1i1i1111I . i1
 if 87 - 87: Iii1i % ooOOO * Ii % IIiIIiIi11I1 / I11iiIi11i1I
 if 84 - 84: I1Ii1I1 + Ooo0Ooo % IIiIIiIi11I1 * i1i1i1111I
 if 61 - 61: i1iiIII111 - Oo + I1Ii1I1
 if 43 - 43: IIiIIiIi11I1 * ooo000 + Ii % iI1iII1I1I1i
 if 12 - 12: i1iiIII111 + ooo000 . I11iiIi11i1I
 if 1 - 1: iI1iII1I1I1i % Ii - I11iiIi11i1I / IiI11Ii111 + iI1iII1I1I1i - Ii
 if 27 - 27: OooOoo % iI1iII1I1I1i + IIiIIiIi11I1
 if 16 - 16: IiI11Ii111
 if 31 - 31: oOo0O00 / Iii1i % Ooo0Ooo % i1 . iI1iII1I1I1i . Oo
 if 83 - 83: oOo0O00 - I11iiIi11i1I
 if 91 - 91: IIiIIiIi11I1 - i1 - iI1iII1I1I1i
 if 71 - 71: I1I - IiI11Ii111
 if 66 - 66: i1i1i1111I / Ooo0Ooo + I11iiIi11i1I + Iii1i + oOo0O00 + i1I
 if 75 - 75: OooOoo - oOO - IiIIii11Ii - oOO + ooo000 % iI1iII1I1I1i
 if 42 - 42: i1 * i1I
 if 50 - 50: Ii - i1iiIII111
 if 96 - 96: ooo000 * OooOoo - Ii - OooOoo
 if 65 - 65: Oo + Oo - iI1iII1I1I1i % OooOoo . Ooo0Ooo
 if 84 - 84: IIiIIiIi11I1 . ooOOO
 if 44 - 44: ooo000 * i1i1i1111I * oOO + i1iiIII111 - IIiIIiIi11I1
 if 70 - 70: IiI11Ii111
 if 9 - 9: oOo0O00 * i1
 if 96 - 96: Ooo0Ooo
 if 13 - 13: Oo * I1Ii1I1 - oOo0O00 * Ii . Ii + oOo0O00
 if 46 - 46: OooOoo - I11iiIi11i1I / Ooo0Ooo
if 1 > 0 :
 mMonitorInfo . printCHS ( "1001CloudServer V{0:s}" . format ( wgGlobal . softwareVersion ) )
 if 73 - 73: I1Ii1I1 / i1i1i1111I / ooo000 % i1 % i1I - OooOoo
 if 30 - 30: ooOOO * ooOOO - Iii1i * iI1iII1I1I1i
 if 37 - 37: I1Ii1I1 % iI1iII1I1I1i . i1I + Ooo0Ooo + ooOOO * iI1iII1I1I1i
 if 39 - 39: IIiIIiIi11I1 - Oo
 if 31 - 31: IiIIii11Ii % oOo0O00 % oOo0O00 * Iii1i
 try :
  if 85 - 85: Iii1i + Ii % IIiIIiIi11I1 % oOo0O00
  if 100 - 100: IiIIii11Ii % i1
  if 82 - 82: ooOOO % OooOoo
  if 81 - 81: Ii
  if sys . platform == 'win32' :
   if sys . maxsize > 2 ** 32 :
    mMonitorInfo . printCHS ( "Software: {0:s}" . format ( "win64" ) )
   else :
    mMonitorInfo . printCHS ( "Software: {0:s}" . format ( "win32" ) )
  else :
   mMonitorInfo . printCHS ( "OS: {0:s}" . format ( sys . platform ) )
  mMonitorInfo . printCHS ( "Starting..." )
 except Exception as e :
  try :
   pass
   print ( e )
   print ( "the System don't support Chinese print...?" )
  finally :
   pass
  wgGlobal . printSupportChinese = False
 wgGlobal . testModeDebugPrint = 0
 if 40 - 40: i1I . OooOoo + oOo0O00 . i1iiIII111
 if 96 - 96: I1I / oOO / I11iiIi11i1I + I11iiIi11i1I
 if 35 - 35: IIiIIiIi11I1 + oOo0O00
 if 96 - 96: iI1iII1I1I1i . OooOoo . i1
 cp = configparser . ConfigParser ( allow_no_value = True )
 cp . read ( "wgconfig.ini" , encoding = "utf-8-sig" )
 if cp . has_section ( 'wgconf' ) :
  config = cp . items ( "wgconf" )
  if 87 - 87: ooo000 * IiIIii11Ii % ooo000 . ooOOO . Oo % iI1iII1I1I1i
  if cp . has_option ( 'wgconf' , 'cloudserverIP' ) :
   wgGlobal . dataserverIP = cp [ 'wgconf' ] [ 'cloudserverIP' ]
  if cp . has_option ( 'wgconf' , 'cloudserverPort' ) :
   wgGlobal . dataserverPort = int ( cp [ 'wgconf' ] [ 'cloudserverPort' ] )
   if 48 - 48: ooOOO * ooo000 % IiIIii11Ii * i1 . Iii1i - IiI11Ii111
   if 72 - 72: i1 % i1i1i1111I * iI1iII1I1I1i
   if 90 - 90: Ooo0Ooo * OooOoo . Ii
   if 5 - 5: Oo - i1 . oOO
   if 18 - 18: IiIIii11Ii - oOO * i1I - OooOoo
   if 54 - 54: IIiIIiIi11I1 . Ooo0Ooo % Ii + IiIIii11Ii * iI1iII1I1I1i / iI1iII1I1I1i
   if 31 - 31: IiIIii11Ii . IiIIii11Ii % Ii
   if 51 - 51: Oo / i1i1i1111I - I1I
   if 83 - 83: Iii1i % i1iiIII111 . OooOoo / I1I % oOO . I1I
   if 76 - 76: i1iiIII111 / OooOoo
   if 77 - 77: ooOOO
   if 19 - 19: ooOOO % I1Ii1I1
   if 15 - 15: OooOoo . IiIIii11Ii . i1I / Iii1i + ooOOO / Ii
   if 17 - 17: I11iiIi11i1I - i1i1i1111I . iI1iII1I1I1i - I11iiIi11i1I + Oo % iI1iII1I1I1i
  if cp . has_option ( 'wgconf' , 'testModeAllowAutoRemoteOpenDoor' ) :
   if 65 - 65: Ii % I11iiIi11i1I
   WGControllerCenter . setTestMode ( int ( cp [ 'wgconf' ] [ 'testModeAllowAutoRemoteOpenDoor' ] ) )
   if int ( cp [ 'wgconf' ] [ 'testModeAllowAutoRemoteOpenDoor' ] ) > 0 :
    mMonitorInfo . printCHS ( "testModeAllowAutoRemoteOpenDoor:  Swipe OpenDoor...\r\n[wgconfig.ini: testModeAllowAutoRemoteOpenDoor =0 disable]" )
    mMonitorInfo . wglog ( "testModeAllowAutoRemoteOpenDoor:  Swipe OpenDoor...\r\n[wgconfig.ini: testModeAllowAutoRemoteOpenDoor =0 disable]" )
    if 39 - 39: Iii1i * IIiIIiIi11I1 . Ooo0Ooo - Oo
  if cp . has_option ( 'wgconf' , 'testModeDebugPrint' ) :
   WGControllerCenter . setModeDebugPrint ( int ( cp [ 'wgconf' ] [ 'testModeDebugPrint' ] ) )
  if cp . has_option ( 'wgconf' , 'commPID' ) :
   if 63 - 63: i1i1i1111I - i1iiIII111 . OooOoo % OooOoo . IiI11Ii111 + i1I
   WGControllerCenter . setCommPID ( ( cp [ 'wgconf' ] [ 'commPID' ] ) )
   if 71 - 71: ooo000 + I11iiIi11i1I % iI1iII1I1I1i + IiI11Ii111 % Oo - Oo
  WGControllerCenter . commTimeControl = getConfigInt ( WGControllerCenter . commTimeControl , "commTimeControl" )
  mMonitorInfo . websocketHeartCycle = getConfigInt ( mMonitorInfo . websocketHeartCycle , "websocketHeartCycle" )
  if 84 - 84: I1I % iI1iII1I1I1i - Ooo0Ooo / iI1iII1I1I1i + Ooo0Ooo - Oo
  mMonitorInfo . backupLogfile = getConfigInt ( mMonitorInfo . backupLogfile , "backupLogfile" )
  if 41 - 41: ooOOO + OooOoo + IIiIIiIi11I1 * i1i1i1111I
  if cp . has_option ( 'wgconf' , 'commSM4' ) :
   strinfo = cp [ 'wgconf' ] [ 'commSM4' ]
   WGControllerCenter . setCommSM4 ( strinfo )
   mMonitorInfo . printCHS ( "commSM4...\r\n[ wgconfig.ini  commSM4 =0 disable]" )
   mMonitorInfo . wglog ( "commSM4...\r\n[ wgconfig.ini  commSM4 =0 disable]" )
  if cp . has_option ( 'wgconf' , 'allowpcip' ) :
   wgGlobal . allowpcip = ( cp [ 'wgconf' ] [ 'allowpcip' ] )
  if cp . has_option ( 'wgconf' , 'whitelist' ) :
   wgGlobal . whitelist = ( cp [ 'wgconf' ] [ 'whitelist' ] ) . split ( ',' )
   mMonitorInfo . printCHS ( "IP whitelist Enabled..." )
   mMonitorInfo . wglog ( "IP whitelist Enabled..." )
  if cp . has_option ( 'wgconf' , 'controllersWhiteList' ) :
   try :
    val = ( cp [ 'wgconf' ] [ 'controllersWhiteList' ] ) . split ( ',' )
    wgGlobal . controllersWhiteList = [ ]
    for itm in val :
     wgGlobal . controllersWhiteList . append ( int ( itm ) )
    mMonitorInfo . printCHS ( "Controllers whitelist Enabled..." )
    mMonitorInfo . wglog ( "Controllers whitelist Enabled..." )
   except Exception as ex :
    wgGlobal . controllersWhiteList = None
    pass
  if cp . has_option ( 'wgconf' , 'supportNXP4G' ) :
   try :
    wgGlobal . supportNXP4G = int ( cp [ 'wgconf' ] [ 'supportNXP4G' ] )
    if wgGlobal . supportNXP4G :
     mMonitorInfo . printCHS ( "NXP 4G Enabled..." )
     mMonitorInfo . wglog ( "NXP 4G Enabled..." )
   except Exception as ex :
    pass
    if 12 - 12: i1i1i1111I
 if len ( wgGlobal . dataserverIP ) < 1 :
  mMonitorInfo . printCHS ( "??? wgconfig.ini..." )
  mMonitorInfo . wglog ( "??? wgconfig.ini ..." )
  if wgGlobal . printSupportChinese :
   input ( "press Enter exit 111..." )
  else :
   input ( "press Enter exit 111" )
  sys . exit ( 0 )
  if 56 - 56: IiIIii11Ii
  if 17 - 17: i1I . oOO % Oo + IiIIii11Ii - Ooo0Ooo
  if 93 - 93: oOo0O00
  if 77 - 77: Oo + I11iiIi11i1I % I1I
  if 20 - 20: i1 - IiIIii11Ii . IiIIii11Ii % ooOOO . i1 % Ooo0Ooo
  if 72 - 72: oOO % IiI11Ii111 . ooOOO * I1Ii1I1 . ooOOO
  if 90 - 90: IiIIii11Ii + I1Ii1I1 . OooOoo
  if 73 - 73: i1i1i1111I - Iii1i / I11iiIi11i1I . ooo000 / iI1iII1I1I1i - i1iiIII111
 mMonitorInfo . printCHS (
 "2021-02-04  start 1001CloudServer IP: [{0:s}:{1:d}  udp]" . format ( wgGlobal . dataserverIP ,
 wgGlobal . dataserverPort ) )
 mMonitorInfo . wglog (
 "1001CloudServer V{2:s} 2021-02-04 start 1001CloudServerEnglish IP: [{0:s}:{1:d}  udp]" . format (
 wgGlobal . dataserverIP , wgGlobal . dataserverPort , wgGlobal . softwareVersion ) )
 if 21 - 21: i1iiIII111 + IiI11Ii111 % i1i1i1111I
 if 7 - 7: IiI11Ii111 / Ii
 if 87 - 87: ooOOO
 if 57 - 57: IIiIIiIi11I1 - iI1iII1I1I1i % ooOOO - I11iiIi11i1I / IiIIii11Ii . Ooo0Ooo
 if 15 - 15: i1I * I11iiIi11i1I - oOo0O00
 if 6 - 6: IiI11Ii111 - Ii
 if 1 - 1: I1I + OooOoo
 portSocket = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM )
 if 98 - 98: i1iiIII111 + Iii1i . IIiIIiIi11I1
 if 96 - 96: OooOoo / oOO - i1 * I11iiIi11i1I
 portSocket . setblocking ( False )
 try :
  portSocket . bind ( ( wgGlobal . dataserverIP , wgGlobal . dataserverPort ) )
 except Exception as e :
  pass
  if 72 - 72: i1i1i1111I + Ii - Iii1i - i1i1i1111I - i1I + Ooo0Ooo
  mMonitorInfo . printCHS ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wgGlobal . dataserverPort , e ) )
  if 74 - 74: Ooo0Ooo * Oo + Iii1i - i1iiIII111
  mMonitorInfo . printCHS ( "Check if already started 1001CloudServer..." )
  mMonitorInfo . wglog ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wgGlobal . dataserverPort , e ) )
  mMonitorInfo . wglog ( "check communication port not occupied..." )
  if 22 - 22: IiIIii11Ii - Ooo0Ooo . i1 . i1I - ooo000
  if 68 - 68: ooo000
  if 40 - 40: i1 + I1Ii1I1 + I11iiIi11i1I . Oo * I11iiIi11i1I % I1I
  input ( "press Enter exit (IP Port Already in use.  occupied udpport)..." )
  sys . exit ( 0 )
  if 100 - 100: OooOoo + Oo / OooOoo
  if 33 - 33: IiI11Ii111 / OooOoo
  if 98 - 98: I1Ii1I1 . IIiIIiIi11I1 * i1I - iI1iII1I1I1i % i1I * IiI11Ii111
  if 42 - 42: OooOoo + i1i1i1111I - iI1iII1I1I1i - oOo0O00 * i1I + Ii
 wgControllerCenter = WGControllerCenter ( )
 port = reactor . adoptDatagramPort (
 portSocket . fileno ( ) , socket . AF_INET , wgControllerCenter )
 if 46 - 46: oOo0O00 . iI1iII1I1I1i - Ii . oOo0O00 + i1i1i1111I
 if 83 - 83: IiI11Ii111
 portSocket . close ( )
 mMonitorInfo . wgControllerCenter = wgControllerCenter
 if 77 - 77: iI1iII1I1I1i - oOO % Ii * i1I - I1I
 if 42 - 42: I11iiIi11i1I - Ii / Oo - i1i1i1111I + I11iiIi11i1I
 portSocketUDPWS = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM )
 if 83 - 83: i1 . iI1iII1I1I1i
 portSocketUDPWS . setblocking ( False )
 try :
  portSocketUDPWS . bind ( ( wgGlobal . dataserverIP , wgGlobal . dataserverPort + 2 ) )
  wgControllerCenterUDPWS = WGControllerCenterUDPWS ( )
  port = reactor . adoptDatagramPort (
 portSocketUDPWS . fileno ( ) , socket . AF_INET , wgControllerCenterUDPWS )
  if 57 - 57: IiI11Ii111 % IiIIii11Ii / oOo0O00 + Ooo0Ooo - i1iiIII111
  if 87 - 87: i1iiIII111 . i1iiIII111 . oOO . ooo000 * oOo0O00
  portSocketUDPWS . close ( )
  mMonitorInfo . wsudp = wgControllerCenterUDPWS
  mMonitorInfo . bSendBywsudp = 0
  if 33 - 33: IiI11Ii111 * i1iiIII111 / i1I . OooOoo * oOo0O00 + ooo000
 except Exception as e :
  pass
  if 17 - 17: i1i1i1111I * oOO + i1iiIII111 - I11iiIi11i1I / i1i1i1111I
  mMonitorInfo . printCHS ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wgGlobal . dataserverPort + 2 , e ) )
  if 83 - 83: I11iiIi11i1I - Iii1i + oOo0O00 + I1I / IIiIIiIi11I1 + I1I
  if 29 - 29: i1i1i1111I / oOo0O00
  mMonitorInfo . printCHS ( "Check if already started 1001CloudServer..." )
  mMonitorInfo . wglog ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wgGlobal . dataserverPort + 2 , e ) )
  mMonitorInfo . wglog ( "Check if already started 1001CloudServer--2..." )
  if 13 - 13: I11iiIi11i1I % i1iiIII111 . OooOoo % ooo000 % OooOoo
  if 21 - 21: IiI11Ii111 * I1Ii1I1
  if 93 - 93: Ooo0Ooo . i1 + IiI11Ii111 - oOo0O00
  input ( "press Enter exit (IP Port Already in use.  occupied udpport)..." )
  sys . exit ( 0 )
  if 97 - 97: i1 - i1 % IIiIIiIi11I1 + IiIIii11Ii / i1I * iI1iII1I1I1i
 tcpport = getConfigInt ( wgGlobal . dataserverPort , "tcpport" )
 if 60 - 60: I11iiIi11i1I - Ooo0Ooo % I1Ii1I1
 try :
  if tcpport > 0 :
   if 26 - 26: ooOOO / IIiIIiIi11I1 . oOO + I11iiIi11i1I . Oo
   if 37 - 37: I1Ii1I1
   if 35 - 35: OooOoo % i1i1i1111I - iI1iII1I1I1i / IiIIii11Ii
   endpoints . serverFromString ( reactor , "tcp:{0}:interface={1}" . format ( tcpport , wgGlobal . dataserverIP ) ) . listen ( WGControllerCenterTCP ( ) )
   if 4 - 4: ooo000 . IiIIii11Ii % ooo000 / i1i1i1111I
   if 48 - 48: i1iiIII111 . Oo
   mMonitorInfo . printCHS ( "2021-09-19  start 1001CloudServer IP: [{0:s}:{1:d}  tcp]" . format ( wgGlobal . dataserverIP , tcpport ) )
   mMonitorInfo . wglog ( "2021-09-19  start 1001CloudServer IP: [{0:s}:{1:d}  tcp]" . format ( wgGlobal . dataserverIP , tcpport ) )
   if 92 - 92: OooOoo + Ii / IIiIIiIi11I1 + OooOoo * IIiIIiIi11I1 * iI1iII1I1I1i
   if 79 - 79: i1i1i1111I
   if 3 - 3: OooOoo / IiI11Ii111 % I11iiIi11i1I
   if 55 - 55: oOo0O00
   if 31 - 31: Ii . Ooo0Ooo / IiI11Ii111
   if 59 - 59: Oo
   if 64 - 64: Iii1i % I11iiIi11i1I * i1 % OooOoo * oOo0O00
   if 55 - 55: IiI11Ii111
   if 46 - 46: Ooo0Ooo % I1Ii1I1
   if 86 - 86: I11iiIi11i1I . i1i1i1111I + oOO % I11iiIi11i1I % Iii1i % ooo000
   if 61 - 61: ooo000
   if 48 - 48: Iii1i * i1i1i1111I + IiIIii11Ii
   if 31 - 31: Oo * i1iiIII111 % Ii / oOO + I1Ii1I1 + iI1iII1I1I1i
   if 90 - 90: I1Ii1I1 * i1i1i1111I / iI1iII1I1I1i * Ii
   if 38 - 38: I1I . Ii
   if 41 - 41: ooo000 % IIiIIiIi11I1 % ooOOO
   if 5 - 5: oOo0O00 / Ii + i1iiIII111 * Oo + Ooo0Ooo + ooo000
   if 96 - 96: i1iiIII111 - IIiIIiIi11I1 / IIiIIiIi11I1 * IiIIii11Ii
   if 67 - 67: Ooo0Ooo . Ooo0Ooo . IiI11Ii111
   if 24 - 24: i1iiIII111 + i1i1i1111I . oOo0O00 + iI1iII1I1I1i + IiI11Ii111
   if 92 - 92: iI1iII1I1I1i / iI1iII1I1I1i + IiIIii11Ii . IiI11Ii111
   if 56 - 56: Ii * ooo000 . IiIIii11Ii
   if 66 - 66: I1Ii1I1 * OooOoo . iI1iII1I1I1i % OooOoo . i1 . IiIIii11Ii
   if 47 - 47: Ii % OooOoo % iI1iII1I1I1i * IiIIii11Ii
   if 48 - 48: i1I . I11iiIi11i1I / ooo000 + i1iiIII111
   if 84 - 84: Oo / I1Ii1I1 . IIiIIiIi11I1
 except Exception as e :
  pass
  if 67 - 67: Oo % ooOOO + iI1iII1I1I1i * I1I
  if 79 - 79: IIiIIiIi11I1 * Oo / OooOoo
  if 10 - 10: iI1iII1I1I1i / i1iiIII111 . IiIIii11Ii * i1i1i1111I
  if 71 - 71: oOo0O00 + I1Ii1I1 / I11iiIi11i1I + Oo / I1I
  if 18 - 18: Iii1i - IiIIii11Ii
  mMonitorInfo . printCHS ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , tcpport , e ) )
  if 71 - 71: iI1iII1I1I1i + OooOoo % i1i1i1111I % oOo0O00 . ooo000
  if 92 - 92: I11iiIi11i1I - Ooo0Ooo - i1i1i1111I % i1iiIII111 / i1i1i1111I * iI1iII1I1I1i
  mMonitorInfo . printCHS ( "Check if already started 1001CloudServer..." )
  mMonitorInfo . wglog ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , tcpport , e ) )
  if 60 - 60: IiIIii11Ii % oOO / i1I * OooOoo / I11iiIi11i1I - Ii
  mMonitorInfo . wglog ( "Check if already started 1001CloudServer--2..." )
  if 16 - 16: oOo0O00 / I1Ii1I1 / i1 + I11iiIi11i1I + oOo0O00
  if 11 - 11: oOO / OooOoo + oOo0O00
  if 79 - 79: I11iiIi11i1I . I1Ii1I1 * i1I % I1Ii1I1 / IiI11Ii111
  input ( "press Enter exit (IP Port Already in use.  occupied tcpport)..." )
  sys . exit ( 0 )
  if 93 - 93: i1I + Iii1i . Ii . i1I * ooOOO
  if 84 - 84: Ooo0Ooo % IiI11Ii111
  if 82 - 82: IIiIIiIi11I1
 wgGlobal . webServerPort = getConfigInt ( wgGlobal . webServerPort , "webServerPort" )
 if wgGlobal . webServerPort > 0 :
  root = wgDoorControllerWEBApi ( )
  factory = Site ( root )
  try :
   if ( httpsCert == "" ) or ( httpsKey == "" ) :
    if 81 - 81: oOo0O00 + i1 - ooo000 * iI1iII1I1I1i + i1i1i1111I
    mMonitorInfo . printCHS ( "2021-02-22 support json-rpc HTTP: [{0:s}:{1:d}]" . format ( wgGlobal . dataserverIP , wgGlobal . webServerPort ) )
    mMonitorInfo . wglog ( "2021-02-22 support json-rpc HTTP: [{0:s}:{1:d}]" . format ( wgGlobal . dataserverIP , wgGlobal . webServerPort ) )
    if 89 - 89: I1Ii1I1
    endpoint = endpoints . TCP4ServerEndpoint ( reactor , wgGlobal . webServerPort , interface = wgGlobal . dataserverIP )
    endpoint . listen ( factory )
   else :
    mMonitorInfo . printCHS ( "2023-11-20 18:09:04 don't support HTTPS: [{0:s}:{1:d}]" . format ( wgGlobal . dataserverIP , wgGlobal . webServerPort ) )
    mMonitorInfo . wglog ( "2023-11-20 18:09:04 don't support  HTTPS: [{0:s}:{1:d}]" . format ( wgGlobal . dataserverIP , wgGlobal . webServerPort ) )
    if 57 - 57: iI1iII1I1I1i - i1iiIII111 / OooOoo % i1iiIII111
    if 92 - 92: IiIIii11Ii * OooOoo - IiIIii11Ii
    if 66 - 66: i1iiIII111 . iI1iII1I1I1i / ooOOO . i1 - OooOoo
    if 13 - 13: oOo0O00
    if 50 - 50: i1 - i1iiIII111 / i1iiIII111 % I1Ii1I1 / IIiIIiIi11I1
    input ( "press Enter exit (don't support HTTPS Server)..." )
    sys . exit ( 0 )
    if 66 - 66: oOo0O00 - Iii1i - ooo000 . I11iiIi11i1I
    if 59 - 59: i1I / IiIIii11Ii
    if 7 - 7: oOo0O00
    if 64 - 64: IIiIIiIi11I1 * oOO + Oo . OooOoo - ooOOO
    if 94 - 94: IiIIii11Ii - ooo000 . Ii
    if 73 - 73: IiIIii11Ii / oOo0O00 % ooo000 . iI1iII1I1I1i % oOO
    if 36 - 36: IiI11Ii111 * OooOoo . ooo000 . i1iiIII111 + oOO
    if 47 - 47: IiI11Ii111 / I11iiIi11i1I
    if 52 - 52: Ii . OooOoo . i1iiIII111 * I11iiIi11i1I - iI1iII1I1I1i
    if 20 - 20: OooOoo % IiI11Ii111 + I1Ii1I1 + IiI11Ii111 - oOo0O00
    if 76 - 76: I11iiIi11i1I % IIiIIiIi11I1 % i1I
    if 39 - 39: IiIIii11Ii . Oo + i1I - oOo0O00
    if 93 - 93: Iii1i * IIiIIiIi11I1 % i1I + i1 % Ii * i1I
    if 62 - 62: IiI11Ii111 % ooo000
    if 19 - 19: Ii / Oo % Iii1i / i1iiIII111 - OooOoo - Ooo0Ooo
    if 89 - 89: I11iiIi11i1I - IiI11Ii111
  except Exception as e :
   pass
   if 61 - 61: Ii * OooOoo * I1I % i1iiIII111 % IIiIIiIi11I1 * I11iiIi11i1I
   mMonitorInfo . printCHS ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wgGlobal . webServerPort , e ) )
   mMonitorInfo . printCHS ( "Check if already started 1001CloudServer..." )
   mMonitorInfo . wglog (
 "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , tcpport ,
 e ) )
   mMonitorInfo . wglog ( "Check if already started 1001CloudServer--2..." )
   input ( "press Enter exit (IP Port Already in use.  occupied tcpport)..." )
   sys . exit ( 0 )
   if 49 - 49: iI1iII1I1I1i / i1iiIII111 % oOO
   if 46 - 46: ooOOO * IIiIIiIi11I1 % i1 / oOO + i1 + oOo0O00
   if 99 - 99: I1I * IIiIIiIi11I1 * i1iiIII111
 wsport = 61081
 wsport = getConfigInt ( wsport , "wsport" )
 if 62 - 62: ooOOO % Oo + i1I
 if wsport > 1 :
  try :
   factory = WebSocketServerFactory ( "ws://{0:s}:{1:d}" . format ( wgGlobal . dataserverIP , wsport ) )
   factory . protocol = WGWSServerProtocol
   if 87 - 87: ooo000 - OooOoo + Ii + i1i1i1111I + IiIIii11Ii
   factory . doStart ( )
   reactor . listenTCP ( wsport , factory )
   if 57 - 57: IIiIIiIi11I1 + I1I / ooOOO % ooOOO % Oo / IiI11Ii111
   mMonitorInfo . printCHS ( "2022-06-11 websocket: {0}" . format ( "ws://{0:s}:{1:d}" . format ( wgGlobal . dataserverIP , wsport ) ) )
  except Exception as e :
   pass
   if 95 - 95: i1 / I11iiIi11i1I . i1 / Oo . Ooo0Ooo
   if 43 - 43: Oo - OooOoo * oOO . Ooo0Ooo / IIiIIiIi11I1 * IIiIIiIi11I1
   mMonitorInfo . printCHS ( "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , wsport , e ) )
   mMonitorInfo . printCHS ( "Check if already started 1001CloudServer..." )
   mMonitorInfo . wglog (
 "{0}: {1} {2} {3}\r\n" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , wgGlobal . dataserverIP , tcpport ,
 e ) )
   mMonitorInfo . wglog ( "Check if already started 1001CloudServer--2..." )
   input ( "press Enter exit (IP Port Already in use.  occupied tcpport)..." )
   sys . exit ( 0 )
   if 84 - 84: i1iiIII111 + oOo0O00
   if 83 - 83: i1i1i1111I
 wgGlobal . mqttHostName = getConfigString ( wgGlobal . mqttHostName , "mqttHostName" )
 if 84 - 84: oOO / Ii * Ooo0Ooo / Ii / ooo000
 wgGlobal . mqttHostPort = getConfigInt ( wgGlobal . mqttHostPort , "mqttHostPort" )
 if len ( wgGlobal . mqttHostName ) > 1 :
  try :
   mqttUserName = getConfigString ( "" , "mqttUserName" )
   mqttPassword = getConfigString ( "" , "mqttPassword" )
   if len ( mqttUserName ) > 0 :
    client = mqtt . Client ( )
    if len ( mqttPassword ) > 0 :
     client . username_pw_set ( mqttUserName , mqttPassword )
    else :
     client . username_pw_set ( mqttUserName )
   else :
    client_id = time . strftime ( '1001CloudServer%Y%m%d%H%M%S' , time . localtime ( time . time ( ) ) )
    client = mqtt . Client ( client_id )
    if 64 - 64: oOo0O00 * Ii
    if 2 - 2: IiI11Ii111 % i1iiIII111 . oOo0O00
   client . on_connect = mMonitorInfo . mqtt_on_connect
   client . on_message = mMonitorInfo . mqtt_on_message
   if 59 - 59: I11iiIi11i1I % OooOoo - iI1iII1I1I1i % I1I + i1iiIII111 . I1Ii1I1
   client . on_disconnect = mMonitorInfo . mqtt_on_disconnect
   if 94 - 94: ooOOO * I1Ii1I1 * i1iiIII111 . oOo0O00
   if 73 - 73: I1Ii1I1 / ooo000 % I11iiIi11i1I - i1i1i1111I + Oo - I1Ii1I1
   mMonitorInfo . wgConRPC4MQTT = wgConRPCLongTime ( )
   reactor . listenUDP ( 0 , mMonitorInfo . wgConRPC4MQTT )
   if 18 - 18: i1 + ooOOO . i1 - iI1iII1I1I1i
   client . connect ( wgGlobal . mqttHostName , wgGlobal . mqttHostPort , 5 )
   client . loop_start ( )
   client . subscribe ( 'OpenDoorCommand' , qos = 0 )
   client . subscribe ( 'kaimenzhiling' , qos = 0 )
   mMonitorInfo . mqttclient = client
   mMonitorInfo . bSendByMQTT = True
   if 97 - 97: oOo0O00 + i1I % Iii1i
   if 34 - 34: i1 + Oo . oOo0O00 - ooo000 / I11iiIi11i1I * oOo0O00
   if 89 - 89: oOo0O00
   if 48 - 48: i1 / IIiIIiIi11I1 / iI1iII1I1I1i / IiI11Ii111 * IiIIii11Ii
   if 54 - 54: IIiIIiIi11I1 % I1I % IiI11Ii111 / I11iiIi11i1I . I11iiIi11i1I - IiIIii11Ii
   if 10 - 10: Ii . I11iiIi11i1I % i1I / OooOoo % I1Ii1I1
   if 42 - 42: Oo - I1I * i1I * i1i1i1111I - I11iiIi11i1I
   if 58 - 58: iI1iII1I1I1i
   if 17 - 17: iI1iII1I1I1i - Ii % iI1iII1I1I1i % oOo0O00 * Iii1i
   if 51 - 51: I1I . i1i1i1111I % Ii
   if 1 > 0 :
    mMonitorInfo . printCHS ( "2021-10-13 mqtt server: [{0:s}:{1:d}] (title: DoorStatus, Swipe, QRCode, HeartBeat, Warn, RemoteOpenRecord, OtherRecord)[DoorStatus: 1=Open,0=Closed]" . format ( wgGlobal . mqttHostName , wgGlobal . mqttHostPort ) )
    mMonitorInfo . printCHS ( "2021-10-22          add title: OpenDoorCommand, msg: 4510000002,1 (description: controllerSN,DoorNO  --check if success by RemoteOpenRecord)" )
    mMonitorInfo . wglog ( "2021-10-13 mqtt server: [{0:s}:{1:d}] (Title: DoorStatus, Swipe, QRCode, HeartBeat, Warn, RemoteOpenRecord, OtherRecord)[DoorStatus: 1=Open,0=Closed]" . format ( wgGlobal . mqttHostName , wgGlobal . mqttHostPort ) )
    mMonitorInfo . wglog ( "2021-10-22          add title: OpenDoorCommand, msg: 4510000002,1 (description: controllerSN,DoorNO  --check if success by RemoteOpenRecord)" )
  except Exception as e :
   pass
   if 55 - 55: i1i1i1111I * Ii % i1i1i1111I
   if 61 - 61: oOo0O00
   if 53 - 53: Ooo0Ooo / IiIIii11Ii
   if not ( wgGlobal . mqttHostName == "127.0.0.1" ) :
    mMonitorInfo . printCHS ( "           mqtt not connected: [{0:s}:{1:d}..." . format ( wgGlobal . mqttHostName , wgGlobal . mqttHostPort ) )
    mMonitorInfo . wglog ( "           mqtt not connected: [{0:s}:{1:d}..." . format ( wgGlobal . mqttHostName , wgGlobal . mqttHostPort ) )
   pass
 wgAppConfig . timeStampEnable = getConfigInt ( wgAppConfig . timeStampEnable , "timeStampEnable" )
 try :
  mMonitorInfo . loadhttpconifg ( "" )
 except Exception as e :
  pass
  if 49 - 49: ooo000 - oOO . IiIIii11Ii / Oo
 finally :
  pass
  if 23 - 23: I11iiIi11i1I - i1 / Iii1i . iI1iII1I1I1i + oOO
 try :
  mMonitorInfo . wgConRPCCommonWebapi = wgConRPCCommon ( )
  reactor . listenUDP ( 0 , mMonitorInfo . wgConRPCCommonWebapi )
 except Exception as e :
  pass
  mMonitorInfo . printCHS ( " wgConRPCCommonWebapi Create Failed" )
 finally :
  pass
  if 55 - 55: i1 - iI1iII1I1I1i / OooOoo + I1I + Oo
 try :
  f = open ( 'favicon.ico' , 'rb' )
  info = f . read ( )
  if len ( info ) > 0 :
   wgAppConfig . htmlIconExisted = True
 except Exception as e2 :
  if 5 - 5: IiI11Ii111 - i1 . i1i1i1111I / IiI11Ii111 . iI1iII1I1I1i . IiI11Ii111
  if 87 - 87: i1 . Ii * iI1iII1I1I1i - oOO / Ii / OooOoo
  if 65 - 65: i1I / i1I + IiI11Ii111
  pass
  pass
  if 99 - 99: i1 + OooOoo + I11iiIi11i1I * Ooo0Ooo / ooOOO + Ii
  if 72 - 72: I1Ii1I1 * Ooo0Ooo * IIiIIiIi11I1 % IiIIii11Ii . ooo000
  if 68 - 68: Ooo0Ooo * OooOoo - oOo0O00
  if 49 - 49: IIiIIiIi11I1 % i1
  if 29 - 29: OooOoo * Ii - oOO
  if 53 - 53: I11iiIi11i1I % ooo000 / ooOOO / I1I
  if 43 - 43: iI1iII1I1I1i . i1i1i1111I + I1I % ooOOO . IiI11Ii111 - IiI11Ii111
  if 6 - 6: I1I
  if 98 - 98: oOO * IIiIIiIi11I1 / i1iiIII111 / Iii1i + I1I
  if 25 - 25: IIiIIiIi11I1 . IiI11Ii111 / I1I * i1 - i1iiIII111 % oOo0O00
  if 49 - 49: IiIIii11Ii % ooOOO + I11iiIi11i1I + IIiIIiIi11I1
 if getConfigInt ( 0 , "printAll" ) > 0 or 'Debug' in wgGlobal . softwareVersion :
  wgGlobal . testModeDebugPrint = 1
  wgGlobal . allowprint = True
  if 60 - 60: IIiIIiIi11I1
 try :
  f = open ( './vistors.json' , 'rb' )
  info = f . read ( )
  if len ( info ) > 0 :
   if wgGlobal . visitorDB is None :
    wgGlobal . visitorDB = TinyDB ( 'vistors.json' )
   if not wgGlobal . visitorDBIsEnabled :
    wgGlobal . visitorDBIsEnabled = True
   if 1 > 0 :
    mMonitorInfo . printCHS ( "2023-02-23 Visitor Enabled" )
   wgGlobal . visitorDBConfigOnlyOnce = 0
   db = wgGlobal . visitorDB
   vistor = Query ( )
   foundvistor = db . search ( vistor [ "Description" ] == "VisitorConfiguration" )
   if foundvistor :
    if 'SwipeValidOnlyOnce' in foundvistor [ 0 ] :
     wgGlobal . visitorDBConfigOnlyOnce = foundvistor [ 0 ] [ "SwipeValidOnlyOnce" ]
 except Exception as e2 :
  pass
  pass
  if 98 - 98: IiIIii11Ii / Ooo0Ooo + Ii
 mMonitorInfo . memAllocMaxMB = getConfigInt ( mMonitorInfo . memAllocMaxMB ,
 "memAllocMaxMB" )
 mMonitorInfo . mqtt_timesMaxInOneSecond = getConfigInt ( mMonitorInfo . mqtt_timesMaxInOneSecond ,
 "mqtt_timesMaxInOneSecond" )
 mMonitorInfo . mqtt_englishTopic = getConfigInt ( mMonitorInfo . mqtt_englishTopic ,
 "mqtt_englishTopic" )
 if 73 - 73: OooOoo * Iii1i
 mMonitorInfo . mqtt_cycle_seconds = getConfigInt ( mMonitorInfo . mqtt_cycle_seconds ,
 "mqtt_cycle_seconds" )
 if 34 - 34: i1I % Ooo0Ooo * OooOoo + i1iiIII111 / i1
 try :
  rsa1 = WGRsa ( )
  if 49 - 49: IIiIIiIi11I1 / i1iiIII111 % IIiIIiIi11I1 + IIiIIiIi11I1 * iI1iII1I1I1i
  deferToThread ( DealRSAData )
 except Exception as e :
  pass
  mMonitorInfo . printCHS ( " mWGRsa Create Failed" )
  mMonitorInfo . printCHS ( e )
 finally :
  pass
 mMonitorInfo . OnlyVirtualCardOpenDoor = getConfigInt ( mMonitorInfo . OnlyVirtualCardOpenDoor ,
 "OnlyVirtualCardOpenDoor" )
 if 22 - 22: I1Ii1I1 + oOO / I1Ii1I1 - Ii % Ii % i1i1i1111I
 try :
  enablebroadcastCon = 1
  enablebroadcastCon = getConfigInt ( enablebroadcastCon , "enablebroadcastCon" )
  if enablebroadcastCon > 0 and wgGlobal . dataserverIP == "0.0.0.0" :
   broadcastCon = FrmADCT3000 ( )
   broadcastCon . start1001server ( )
 except Exception as e :
  pass
  mMonitorInfo . printCHS ( "Broadcast Create Failed??" )
  mMonitorInfo . printCHS ( e )
 finally :
  pass
  if 86 - 86: Iii1i
  if 53 - 53: i1 * i1i1i1111I
  if 91 - 91: I1I . I11iiIi11i1I
  if 59 - 59: IiI11Ii111 . IiI11Ii111 * IIiIIiIi11I1
  if 85 - 85: Iii1i . oOO % Iii1i - Iii1i
  if 68 - 68: oOO + Iii1i + Ooo0Ooo % Oo / I11iiIi11i1I . OooOoo
  if 31 - 31: I11iiIi11i1I % ooOOO
  if 46 - 46: i1i1i1111I - ooo000 + iI1iII1I1I1i
  if 73 - 73: i1 * oOo0O00
  if 88 - 88: Ii
  if 12 - 12: ooo000 - IIiIIiIi11I1 % Iii1i . I1Ii1I1
  if 11 - 11: i1iiIII111 - Oo % Ii % i1
  if 28 - 28: IIiIIiIi11I1 % Ii + ooOOO . i1I % Ii * I1Ii1I1
  if 41 - 41: I1I
  if 76 - 76: ooo000 * i1i1i1111I
  if 39 - 39: i1 % i1I
  if 50 - 50: i1iiIII111 % OooOoo - i1i1i1111I * IiIIii11Ii % Oo . Ooo0Ooo
  if 30 - 30: i1iiIII111
  if 78 - 78: ooo000 % Iii1i + ooOOO * IIiIIiIi11I1 - i1
  if 46 - 46: Ooo0Ooo - i1I / ooo000 * IiI11Ii111 . oOo0O00
  if 32 - 32: i1i1i1111I . OooOoo + OooOoo - ooo000 * IiIIii11Ii + Oo
  if 12 - 12: oOo0O00
  if 57 - 57: Oo + i1i1i1111I / I1Ii1I1
  if 56 - 56: oOO % Ooo0Ooo % Iii1i . i1i1i1111I
  if 46 - 46: IiI11Ii111 . i1iiIII111 % Iii1i - Ooo0Ooo + ooo000
  if 100 - 100: oOO
  if 32 - 32: I1Ii1I1 % ooo000 * OooOoo / oOo0O00 + ooOOO
  if 64 - 64: I1Ii1I1 . Ooo0Ooo
  if 36 - 36: IIiIIiIi11I1 + IiIIii11Ii . i1 + IIiIIiIi11I1
  if 77 - 77: iI1iII1I1I1i / OooOoo . Iii1i + i1iiIII111 - IiI11Ii111
  if 49 - 49: i1iiIII111 - IiI11Ii111 - OooOoo
  if 39 - 39: I1I % i1iiIII111 - I1Ii1I1
  if 51 - 51: IIiIIiIi11I1 + i1 % i1iiIII111
  if 49 - 49: IiIIii11Ii - i1I . I1I
  if 76 - 76: oOO / iI1iII1I1I1i . I1I * oOo0O00 - i1i1i1111I
  if 53 - 53: OooOoo - oOo0O00 * ooOOO / OooOoo * Ooo0Ooo * ooo000
  if 10 - 10: IIiIIiIi11I1 % ooo000 % I11iiIi11i1I % Ooo0Ooo
  if 70 - 70: IiIIii11Ii
  if 90 - 90: i1i1i1111I % i1 . IiIIii11Ii * IiI11Ii111 / Ii
  if 73 - 73: ooo000 * Ooo0Ooo + Iii1i . ooOOO . I11iiIi11i1I / I11iiIi11i1I
  if 72 - 72: i1I * iI1iII1I1I1i / ooo000 + i1I - I11iiIi11i1I
  if 20 - 20: IIiIIiIi11I1 . oOo0O00 . Ooo0Ooo
  if 11 - 11: OooOoo
  if 45 - 45: iI1iII1I1I1i + I11iiIi11i1I / IIiIIiIi11I1
  if 45 - 45: iI1iII1I1I1i . iI1iII1I1I1i * i1i1i1111I + oOo0O00
  if 6 - 6: Iii1i . Oo + I1Ii1I1 * i1 * I1Ii1I1 % oOO
  if 21 - 21: Ooo0Ooo % i1 - ooo000
  if 81 - 81: Ooo0Ooo / ooo000
  if 4 - 4: I1I % i1I - ooo000 - I1I . ooOOO / i1i1i1111I
  if 74 - 74: oOO
  if 24 - 24: I1I + Oo - ooOOO
  if 86 - 86: i1iiIII111 % ooo000 % ooo000 % i1I
  if 15 - 15: iI1iII1I1I1i + I1Ii1I1 % oOo0O00
  if 79 - 79: OooOoo . Oo + oOo0O00 / I1Ii1I1 . IiIIii11Ii
  if 89 - 89: ooo000 % Ooo0Ooo
  if 77 - 77: ooo000 % Ooo0Ooo
  if 24 - 24: oOO * I1Ii1I1 * I1Ii1I1 % IIiIIiIi11I1
  if 37 - 37: i1iiIII111 / iI1iII1I1I1i
  if 80 - 80: IiIIii11Ii
  if 2 - 2: I1I / oOO - IIiIIiIi11I1 % Ooo0Ooo
  if 88 - 88: iI1iII1I1I1i - I1Ii1I1 - i1I . Iii1i
  if 98 - 98: Ii + ooOOO
  if 29 - 29: I1Ii1I1 + i1I - IIiIIiIi11I1 * I11iiIi11i1I % Oo
  if 74 - 74: ooOOO
  if 100 - 100: oOO + iI1iII1I1I1i . I1I % Oo - i1
  if 39 - 39: iI1iII1I1I1i
  if 34 - 34: iI1iII1I1I1i . i1 . I1I
  if 95 - 95: IiIIii11Ii * IiI11Ii111 * Ooo0Ooo * IiI11Ii111 / OooOoo
  if 27 - 27: i1I . IiIIii11Ii
  if 69 - 69: oOO % i1iiIII111 / oOo0O00
  if 38 - 38: I11iiIi11i1I + Oo * Ooo0Ooo / ooOOO . OooOoo
  if 90 - 90: OooOoo / i1iiIII111
  if 32 - 32: IIiIIiIi11I1 - i1I / ooOOO * Ooo0Ooo * iI1iII1I1I1i - i1i1i1111I
  if 82 - 82: ooo000
  if 66 - 66: IiIIii11Ii + IIiIIiIi11I1 - i1I + i1i1i1111I . iI1iII1I1I1i * IiIIii11Ii
 mMonitorInfo . printCHS ( "2024-06-24 Add: auto reboot this application if all controllers' communication failed" )
 mMonitorInfo . printCHS ( "2024-07-17 Edit: support remote open for Elevator" )
 mMonitorInfo . printCHS ( "2024-07-20 Edit: Support 4G Controller(by setting supportNXP4G = 1)" )
 mMonitorInfo . printCHS ( "2024-07-27 Edit: 4G/WIFI supportNXP4G=1" )
 mMonitorInfo . printCHS ( "2024-07-27 Edit: Display 4G or WIFI mode" )
 mMonitorInfo . printCHS ( "2024-07-27 Edit: Download Swipes" )
 if 9 - 9: I1I - I1I - ooOOO - oOo0O00 + i1iiIII111
 if 71 - 71: i1I / i1iiIII111 - Ii * Oo . iI1iII1I1I1i
 if 3 - 3: I1Ii1I1
 if 57 - 57: Ooo0Ooo . OooOoo / oOo0O00 * I1Ii1I1
 if 36 - 36: IiIIii11Ii
 if 33 - 33: IiIIii11Ii
 if 86 - 86: Ii / oOo0O00 - i1 * i1i1i1111I - Oo * Iii1i
 if 28 - 28: OooOoo . i1 % iI1iII1I1I1i % Iii1i
 mMonitorInfo . printCHS ( "2024-08-26 Add: linux Service Support" )
 if 2 - 2: Oo + OooOoo - i1i1i1111I - ooo000 / Oo . Oo
 mMonitorInfo . printCHS ( """
!!!!!!!!!                    Notice                  !!!!!!!!!
  Allow the followed port 
################################################################
#     UDP: 61005                                               #   
#     TCP: 61005, 61080, 61081, 61085, 1883                    #
################################################################
""" )
 if 41 - 41: OooOoo + OooOoo - OooOoo
 if 9 - 9: Iii1i % I1Ii1I1 % IiIIii11Ii - I1I * OooOoo
 wgGlobal . startuptime = time . strftime ( '%Y-%m-%d %H:%M:%S' )
 mMonitorInfo . printCHS ( "{0} {1}" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , sys . modules [ 'twisted.internet.reactor' ] ) )
 mMonitorInfo . wglog ( "{0} {1}" . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) , sys . modules [ 'twisted.internet.reactor' ] ) )
 if 53 - 53: iI1iII1I1I1i * i1i1i1111I / OooOoo . i1I . ooo000
 mMonitorInfo . printCHS ( "{0} Monitoring..." . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) ) )
 if 45 - 45: OooOoo + ooOOO / i1i1i1111I * i1
 mMonitorInfo . wglog ( "{0} Monitoring..." . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) ) )
 if 71 - 71: IiI11Ii111 % Iii1i + oOo0O00 * I11iiIi11i1I / IiI11Ii111
 if 66 - 66: ooo000 * oOo0O00
 reactor . run ( )
 if 83 - 83: i1
 if 64 - 64: i1 . IiI11Ii111 - I11iiIi11i1I . Iii1i
 if 47 - 47: ooo000 / Ooo0Ooo % IiIIii11Ii
 if 70 - 70: IIiIIiIi11I1 / Iii1i . i1i1i1111I % ooOOO . Ii / Ii
 if 51 - 51: I11iiIi11i1I + Ooo0Ooo - ooo000 * oOO . oOO
 if 79 - 79: i1i1i1111I + oOo0O00
 if 11 - 11: OooOoo / i1iiIII111 % i1I - i1i1i1111I * oOo0O00
 if 90 - 90: i1 * i1 . Ooo0Ooo . Oo
 if 59 - 59: Ii % I1Ii1I1 + Iii1i . OooOoo * Iii1i
 if 21 - 21: I11iiIi11i1I + ooOOO % IiIIii11Ii / OooOoo
 if 96 - 96: Oo * i1iiIII111 . Ooo0Ooo
 if 35 - 35: ooOOO . i1I * i1i1i1111I * iI1iII1I1I1i - I11iiIi11i1I
 if 47 - 47: IIiIIiIi11I1
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
