1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Default configuration for modbus-relay
tcp:
# TCP server bind address
bind_addr: "127.0.0.1"
# TCP server port
bind_port: 502
# TCP keepalive probe interval (e.g. "60s", "2m")
# This is how often the server will check if client connections are still alive
keep_alive: "60s"
rtu:
# Serial device path
device: "/dev/ttyAMA0"
# Baud rate
baud_rate: 9600
# Data bits (5-8)
data_bits: 8
# Parity (none, odd, even)
parity: "none"
# Stop bits ("one", "two")
stop_bits: "one"
# Whether to flush after write
flush_after_write: true
# Optional RTS configuration ("up", "down", "none")
rts_type: "down"
rts_delay_us: 3500
# Transaction timeout
transaction_timeout: "5s"
# Serial port timeout
serial_timeout: "1s"
# Maximum frame size
max_frame_size: 256
http:
# Enabled
enabled: true
# HTTP API bind address
bind_addr: "127.0.0.1"
# HTTP API port
bind_port: 8080
# Metrics enabled
metrics_enabled: true
logging:
# Directory to store log files
log_dir: "logs"
# Trace modbus frames
trace_frames: false
# Log level (trace, debug, info, warn, error)
level: "trace"
# Log format (pretty, json)
format: "pretty"
# Use file:line
include_location: false
# Log thread ids
thread_ids: false
# Log thread names
thread_names: true
connection:
# Maximum number of concurrent connections
max_connections: 100
# Time after which an idle connection will be closed
idle_timeout: "60s"
# Time after which a connection with errors will be closed
error_timeout: "300s"
# Timeout for establishing a connection
connect_timeout: "5s"
# Optional per IP limits
per_ip_limits: 10
# Parameters for backoff strategy
backoff:
# Initial wait time
initial_interval: "100ms"
# Maximum wait time
max_interval: "30s"
# Multiplier for each subsequent attempt
multiplier: 2.0
# Maximum number of attempts
max_retries: 5