modbus-cli icon indicating copy to clipboard operation
modbus-cli copied to clipboard

modbus rtu slave on linux

Open kush930 opened this issue 1 year ago • 3 comments

Hi all ,

I have successfully installed master branch of modbus-cli on my ubuntu-20.04.3 os, from given link- https://github.com/favalex/modbus-cli

I want to use modbus rtu slave stack, i am taking my ubuntu machine as a master.

kush@kush-Latitude-3520:~/Music/14-dec$ modbus

usage: modbus [-h] [-r REGISTERS] [-s SLAVE_ID] [-b BAUD] [-p STOP_BITS] [-P {e,o,n}] [-v] [-S] [-t TIMEOUT] [-B {le,be,mixed}] device access [access ...]
modbus: error: the following arguments are required: device, access

I have energy meter, which having slave address 1 and register address 3027 and baudrate 9600 and device access /dev/ttyUSB0 and i want to read 16-bit data , i am new in this, first time i am trying.

when i am running the command,I am facing this issue-

kush@kush-Latitude-3520:~/Music/14-dec$ modbus -r 3027 -s 1 -b 9600 -p 1 -P n -v /dev/ttyUSB0

usage: modbus [-h] [-r REGISTERS] [-s SLAVE_ID] [-b BAUD] [-p STOP_BITS]
              [-P {e,o,n}] [-v] [-S] [-t TIMEOUT] [-B {le,be,mixed}]
              device access [access ...]

modbus: error: the following arguments are required: access

if anyone knows where i am doing mistake, please guide me.

T&R Kush Kumar

kush930 avatar Dec 18 '23 14:12 kush930

Try modbus -s 1 -b 9600 -p 1 -P n -v /dev/ttyUSB0 3027

-r is for loading a file that gives registers a name, it's optional and explained in the documentation.

favalex avatar Dec 18 '23 15:12 favalex

Try modbus -s 1 -b 9600 -p 1 -P n -v /dev/ttyUSB0 3027

-r is for loading a file that gives registers a name, it's optional and explained in the documentation.

Thank you favalex.its working now.

kush930 avatar Dec 18 '23 16:12 kush930

Hi all,

I want to use my PC (Linux OS) as a slave, what should i do that my PC behave as a slave, if anyone having any idea please share with me or guide me how to do.

T&R Kush kumar

kush930 avatar Dec 19 '23 06:12 kush930