TRB140 modbus communication

HI everyone
I recently upgraded the firmware of a TRB140 to TRB1_R_00.07.13.4 version and since then i couldn’t read data over modbus using this script:

val1=$(ubus call modbus_client.rpc tcp.test '{"id":1,"timeout":10,"function":3,"first_reg":321,"reg_count":"1","data_type":"32bit_float1234","no_brackets":1,"ip":"192.168.1.5","port":"502","delay":0}' | jsonfilter -e '@.result')


val2=$(ubus call modbus_client.rpc tcp.test '{"id":1,"timeout":10,"function":3,"first_reg":323,"reg_count":"1","data_type":"32bit_float1234","no_brackets":1,"ip":"192.168.1.5","port":"502","delay":0}' | jsonfilter -e '@.result')


val3=$(ubus call modbus_client.rpc tcp.test '{"id":1,"timeout":10,"function":3,"first_reg":325,"reg_count":"1","data_type":"32bit_float1234","no_brackets":1,"ip":"192.168.1.5","port":"502","delay":0}' | jsonfilter -e '@.result')


val4=$(ubus call modbus_client.rpc tcp.test '{"id":1,"timeout":10,"function":3,"first_reg":327,"reg_count":"1","data_type":"32bit_float1234","no_brackets":1,"ip":"192.168.1.5","port":"502","delay":0}' | jsonfilter -e '@.result')

and i get a suite of incremental numbers instead
thanks for helping with this problem

Hello,

Starting from recent firmware versions (>7.13), there was a change in the usage of the ubus modbus command, and it’s now recommended to use the API calls for reading Modbus register data.

However, there’s a known workaround method involving two ubus calls that you can use to achieve similar functionality. This workaround has been outlined in the topics here:

Update:
It seems that on the latest firmware this ubus call command works properly, as like on previous releases (<7.13); hence, if there’s a need for its usage, please update your device’s RutOS firmware to 7.14.

Best regards,

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.