The newer firmware versions have changed the Modbus client CLI interface.
Change your command to use modbus_client.rpc serial.test instead of modbus_client serial.test.
Make sure parameters like serial_type start with a slash: "/dev/rs485".
Use integer values for numeric parameters like baudrate, databits, stopbits, timeout, etc., not strings.
Thanks for your fast response. I have done the changes you wrote: ubus call modbus_client.rpc serial.test '{"id":1,"timeout":1,"function":4,"first_reg":1,"reg_count":1,"data_type":"16bit_int_hi_first","no_brackets":1,"serial_type":"/dev/rs485","baudrate":19200,"databits":8,"stopbits":1,"parity":"none","flowcontrol":"none"}'
Now I get:
{
"error": 1,
"result": "failed to parse arguments: Argument ('reg_count') is missing."
}
Your error is caused by the reg_count parameter being sent as a number instead of a string. Changing "reg_count": 1 to "reg_count": "1" should resolve the issue.
Confirm your device path /dev/rs485 is correct and accessible.
thanks, this now works: ubus call modbus_client.rpc serial.test '{"id":1,"timeout":1,"function":4,"first_reg":2,"reg_count":"2","data_type":"16bit_int_hi_first","no_brackets":1,"serial_type":"/dev/rs485","baudrate":19200,"databits":8,"stopbits":1,"parity":"none","flowcontrol":"none"}'