Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration file issue #1

Open
durvesh09 opened this issue May 19, 2017 · 3 comments
Open

configuration file issue #1

durvesh09 opened this issue May 19, 2017 · 3 comments

Comments

@durvesh09
Copy link

After trying to execute run cmd: sudo modbus_simulator -c str

getting following error:

Invalid Monitor configuration file

@dhoomakethu
Copy link
Owner

sounds like you are passing an invalid configuration file, could you paste the configuration here ?

@durvesh09
Copy link
Author

durvesh09 commented May 19, 2017

here is the configuration file :

`# serial settings to be used for modbus rtu

applicable to all simulated modbus rtu devices

serial_settings:
baudrate: 9600
bytesize: 8
parity: N
stopbits: 1
xonxoff: 0
rtscts: 0
dsrdtr: 0
writetimeout: 2
timeout: 2

tcp settings for modbus tcp simulated device

standard modbus port 502 requires root permission

tcp_settings:
address: 127.0.0.1
port: 5440

generic modbus simulation settings for each slave

overridden by individual device settings under 'modbus_devices' if present

modbus_settings:
bin_min: 0 # min value for coils and discrete inputs
bin_max: 1 # max value for coils and discrete inputs)
reg_min: 0 # min value for registers
reg_max: 65535 # max value for registers
discrete_inputs:
block_start: 0 # Data block starting offset
block_size: 100 # Data block size
default: 0 # default value
coils:
block_start: 0 # Data block starting offset
block_size: 100 # Data block size
default: 0 # default value
holding_registers:
block_start: 0 # Data block starting offset
block_size: 2000 # Data block size
default: 1 # default value
input_registers:
block_start: 0 # Data block starting offset
block_size: 100 # Data block size
default: 0 # default value

to be simulated modbus devices

modbus_devices:

protocol: "rtu"
interface: /dev/ptyp0
slaves: 1..12 # slaves in the range of 1 to 12
  • protocol: "rtu"
    interface: /dev/ptyp1
    slaves: 1..5, 254 # slaves in the range of 1 to 5 and 254

  • protocol: "rtu"
    interface: /dev/ptyp2
    slaves: 100
    holding_registers:

    this block overides values from modbus_settings above

block_start: 0 # Data block starting offset

block_size: 200 # Data block size

  default: 1       # default value

-

protocol: "tcp"

slaves: 1

logging:
simulation:
console_logging: true
console_log_level: info
file_logging: true
file_log_level: info
file_log_path: "/modbus_sim/simu_logs/simu.log"
modbus_tk:
console_logging: true
console_log_level: warning
file_logging: true
file_log_level: info
file_log_path: "
/modbus_sim/simu_logs/modbus_tk.log"
`

@dhoomakethu
Copy link
Owner

it works fine for me, what OS are you running this ? Just for your info, I have attached the config file you have pasted above here , just change the extension to .yml and use.
error.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants