Command line¶
modsim runs one simulated device from flags. The managed commands (up, down, ps, logs, export,
reset) run a deployment of several devices on one listener.
Modsim v2.0.0a17 - A Simple Modbus TCP Device Simulator used for modpoll tool
usage: modsim [-h] [-v] [--config CONFIG] [--data DATA] [--script SCRIPT]
[--allow-scripts] [--unit-id UNIT_ID] [--bind BIND]
[--param NAME=JSON] [--initial PROPERTY=JSON]
[--comm {tcp,udp,serial,tls}] [--serial PORT]
[--serial-baud SERIAL_BAUD] [--serial-parity {none,even,odd}]
[--serial-link PATH] [--framer {ascii,rtu,socket,tls}]
[--log {critical,error,warning,info,debug}] [--port PORT]
[--store {sequential,sparse,factory,none}]
[--slaves SLAVES [SLAVES ...]] [--context CONTEXT]
Named Arguments¶
- -v, --version
show program's version number and exit
- --config
Profile 0.2 TM/TD local path, HTTPS URL, or modiohub:<id>@<version> for a custom Thing Model in your ModioHub Workspace
- --data
Simulation data for --config: a local path or HTTPS URL of a data document or a modpoll --export snapshot
- --script
Local Python behavior for --config
- --allow-scripts
Allow local Python behavior execution
Default:
False- --unit-id
Instance Unit ID for --config
- --bind
Listener address; configured TCP devices default to 127.0.0.1
- --param
Default:
[]- --initial
Default:
[]- --comm
Possible choices: tcp, udp, serial, tls
set communication, default is tcp
- --serial
listen for Modbus RTU on a serial port; 'pty' creates a virtual serial port (Linux, macOS) and prints the port for the client
- --serial-baud
serial baud rate, default is 9600
- --serial-parity
Possible choices: none, even, odd
serial parity, default is none
- --serial-link
with --serial pty, also create this symbolic link to the client port
- --framer
Possible choices: ascii, rtu, socket, tls
set framer, default depends on --comm
- --log
Possible choices: critical, error, warning, info, debug
set log level, default is info
Default:
'info'- --port
set port; defaults to 5020, which needs no administrator rights
- --store
Possible choices: sequential, sparse, factory, none
set type of datastore
Default:
'sequential'- --slaves
set number of slaves, default is 0 (any)
Default:
0- --context
ADVANCED USAGE: set datastore context object
Managed commands: up, down, ps, logs, export, reset. Use modsim COMMAND --help. Sign in to ModioHub with modsim login.
Managed commands¶
Manage a local Modsim deployment
usage: modsim [-h] {down,export,logs,ps,reset,up} ...
Positional Arguments¶
- action
Possible choices: down, export, logs, ps, reset, up
Sub-commands¶
down¶
Undocumented
modsim down [-h] [-f FILE]
Named Arguments¶
- -f, --file
Default:
'examples/deployment.yaml'
export¶
Undocumented
modsim export [-h] [-f FILE] [--device DEVICE] [-o OUTPUT |
--output-dir OUTPUT_DIR] [--running]
Named Arguments¶
- -f, --file
Default:
'examples/deployment.yaml'- --device
- -o, --output
- --output-dir
Default:
'/home/runner/work/modpoll/modpoll/packages/modsim/output'- --running
Default:
False
logs¶
Undocumented
modsim logs [-h] [--file FILE] [-f]
Named Arguments¶
- --file
Default:
'examples/deployment.yaml'- -f, --follow
Default:
False
ps¶
Undocumented
modsim ps [-h] [-f FILE]
Named Arguments¶
- -f, --file
Default:
'examples/deployment.yaml'
reset¶
Undocumented
modsim reset [-h] [-f FILE] --device DEVICE
Named Arguments¶
- -f, --file
Default:
'examples/deployment.yaml'- --device
up¶
Undocumented
modsim up [-h] [-f FILE] [-d] [--dry-run] [--allow-scripts]
Named Arguments¶
- -f, --file
Default:
'examples/deployment.yaml'- -d, --detach
Default:
False- --dry-run
Default:
False- --allow-scripts
Default:
False