Here is the script I use to read out the registers:
#!/usr/bin/env python3
# Mikkel Holm Olsen, 2020
from pyModbusTCP.client import ModbusClient
import time
modbus = ModbusClient(host="10.0.0.107", port=502, unit_id=1, auto_open=True)
# Use the admin password "6699" for authentication.
if not modbus.write_multiple_registers(7777, [0x3636, 0x3939, 0, 0, 0, 0, 0, 0]):
print("Error auth");
exit(0)
# I guess we already know this...
admin_pwd = modbus.read_holding_registers(1352, 8)
print("admin "+(" ".join(map("{:02X}".format, admin_pwd))))
install_pwd =modbus.read_holding_registers(1360, 8)
print("install "+(" ".join(map("{:02X}".format, install_pwd))))
superusr_pwd =modbus.read_holding_registers(1368, 8)
print("super "+(" ".join(map("{:02X}".format, superusr_pwd))))
for reg in range(1, 10500):
vals = modbus.read_holding_registers(reg, 1)
if vals:
val = vals[0]
print('{0:5d} 0x{1:04X} {1:5d}'.format(reg,val))
else:
print('{0:5d} err'.format(reg))
time.sleep(0.02)
Notice that some registers need to be read in one go, and will otherwise return an error (this is the case for the authentication registers).
I think I need to get in touch with Nilan regarding the network problems