示例#1
0
                     help="Email address used during the registration.",
                     required=True)
 parser.add_argument("-p",
                     "--password",
                     help="Password used during the registration",
                     required=True)
 args = parser.parse_args()
 if args.login:
     login = args.login
 else:
     sys.exit(1)
 if args.password:
     password = args.password
 else:
     sys.exit(1)
 server = configReader.GetSectionMap('SERVER')
 clienthtp = Client(server['ip'], server['port'])
 try:
     clienthtp.LogIn(login, password)
 except Exception as e:
     print(str(e))
     sys.exit(1)
 # ---------------------------------------------------------------------------#
 # Init modbus
 # ---------------------------------------------------------------------------#
 serial = configReader.GetSectionMap("SERIAL")
 client = ModbusClient(method='rtu',
                       port=serial["port"],
                       timeout=1,
                       baudrate=int(serial["baud"]),
                       bytesize=int(serial["databits"]),