any idea about the function 6 and 16 write register syntax for modbus_tcp_test
which as of 7.03.02 has been supplanted with a hyper-verbose rendition like this:
ubus call modbus_master tcp.test '{"ip":"192.168.1.11", "port":502, "id":1, "timeout":1, "function":3, "first_reg":10006, "reg_count":"6", "data_type":"16bit_uint_hi_first", "no_brackets":1}'
It appears that in the new "self-documenting" variant, the parameters are no longer positional
they can appear in any order - and can even be repeated/duplicated without ill effect
To do the write I attempted this:
ubus call modbus_master tcp.test '{"ip":"192.168.1.11", "port":502, "id":1, "timeout":1, "function":16, "first_reg":10007, "reg_count":"7", "data_type":"16bit_uint_hi_first", "modbus_write_registers":3,4,5,6,7 "no_brackets":1}'
Bzzzzt
For a minute I thought I had something because the "failed to parse message data" error went away
ubus call modbus_master tcp.test '{"ip":"192.168.1.11", "port":502, "id":1, "timeout":1, "function":16, "first_reg":10007, "reg_count": "7", "data_type":"16bit_uint_hi_first", "no_brackets":1, "garbage":1}'
other weirdnesses: some numerics such as port id timeout function are naked - no " around them
while "reg_count" requires " quoting
IDK... where to get docs for undoc-ed code ?
OK... I figured out that modbus_write_register and modbus_write_regsters are libmodbus library functions