Files
iAOP/core/edge-gateway/config/gateway.example.yaml

79 lines
3.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# iAOP 边缘采集网关 —— 模板配置示例(Template-Ti 一期:氯化车间/海绵钛)
# 换行业模板时只需修改本文件 + 点位字典 CSV,网关代码零改动。
collector:
# 采集周期(毫秒)基准 tick:600 点位 1Hz 即 1000。
# 点位级采样率由点位字典 CSV 的 sampleRate 列驱动(issue #23):
# sampleRate ≤ interval_ms 的点位每 tick 采集;> interval_ms 的点位按比例降频
# (如 sampleRate=5000 且 interval_ms=1000 → 每 5 tick 采一次),去硬编码。
interval_ms: 1000
# 背压保护:spool 待上行记录上限,超过则丢弃新样本并计入丢失率
max_pending: 100000
# 本地缓存目录(断点续传落盘位置)
spool_dir: "./spool"
cache_limit_bytes: 536870912 # 512MB
# 协议可插拔驱动插槽(protocol 注册表见 drivers/__init__.py)
drivers:
# 和利时 DCS —— OPC UA 只读(推荐;支持用户认证参数化,issue #25)
- protocol: hollysys
device_prefixes: ["CLF"] # 设备编号前缀路由(CLF-01, CLF-02, ...)
config:
mode: ua # ua(OPC UA)| da(OPC DA COM 接口)
endpoint: "opc.tcp://10.20.1.10:4840"
security: "Basic256Sha256" # None | Basic256Sha256 等安全策略
username: "iaop_read" # 和利时 UA 服务用户认证(只读账号)
password: "******"
timeout: 10
# 和利时 DCS —— OPC DA 传统接口(无 UA 服务时使用;opcNode 列写 OPC Item)
# - protocol: hollysys
# device_prefixes: ["CLF"]
# config:
# mode: da
# host: "10.20.1.10" # DCOM 主机(需 Windows + OpenOPC)
# prog_id: "Hollysys.OPCServer" # 或 cls_id 指定 CLSID
# timeout: 10
# 西门子 S7-1200 —— PLC 只读(点位 opcNode 列写 DB 地址,如 DB100.0.0)
- protocol: s7
device_prefixes: ["S7"]
config:
ip: "10.20.1.20"
rack: 0
slot: 1
# 称重仪表(Modbus RTU)
- protocol: weighing
device_prefixes: ["W"]
config:
mode: modbus
mode_tcp: false
port: "COM3"
baudrate: 9600
slave_id: 1
# 能源表(Modbus TCP)
- protocol: energy
device_prefixes: ["E"]
config:
mode: modbus
host: "10.20.1.30"
port: 502
slave_id: 1
# 兜底:未匹配任何前缀的点位(本地联调用 simulator;现场部署删除此项)
- protocol: simulator
device_prefixes: []
config:
seed: 2026
kafka:
bootstrap_servers: "10.20.0.10:9092"
topic_prefix: "iaop.ti-cl4" # 模板化 topic:{prefix}.{device_id}.points
batch_size: 500
# 传输安全(NFR 9 章:服务间 mTLS,边缘网关↔总线双向认证)。
# 现场部署必须开启;本地联调可保持 PLAINTEXT。
security:
protocol: SSL # PLAINTEXT | SSL | SASL_SSL
ca_location: "/etc/iaop/certs/ca.crt"
cert_location: "/etc/iaop/certs/gateway.crt"
key_location: "/etc/iaop/certs/gateway.key"
# protocol: SASL_SSL 时追加:
# sasl_mechanism: "PLAIN"
# sasl_username: "edge-gateway"
# sasl_password: "..."