26个版本 (稳定版)
1.5.4 | 2022年8月18日 |
---|---|
1.4.1 | 2022年7月15日 |
1.2.5 | 2022年3月30日 |
0.5.0 | 2022年2月21日 |
0.2.1 | 2021年10月30日 |
#202 in Web编程
每月52次下载
19MB
31K SLoC
ATS Monitoring
用于监控和报告工程系统,通过Telegram-bot发送通知,API SMS网关
docker之外的先决条件
- 安装Rust for Linux或macOS
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
对于Windows,请访问这个页面
- 安装依赖项
# Ubuntu
$ sudo apt-get install libssl-dev
# Fedora
$ sudo dnf openssl-devel
初始设置
- 克隆仓库
$ git clone https://github.com/stepanov-denis/ats-monitoring.git
- 在 .cargo/config.toml 中编辑您的sms网关设置
# For example:
GATEWAY_STR_CONNECTION= "URL with your token"
- 在 .cargo/config.toml 中编辑您的Telegram-bot设置
# For example:
TG_BOT_TOKEN = "your token"
- 在 .cargo/config.toml 中编辑PostgreSQL设置
# For example:
POSTGRES_USERNAME = "postgres"
POSTGRES_PASSWORD = "mysecretpassword"
POSTGRES_DB = "postgres"
POSTGRES_HOSTNAME = "postgresql"
POSTGRES_PORT = "5432"
- 在 .cargo/config.toml 中编辑PLC设置
# For example:
# IP adress PLC TRIM5
IP_TRIM5 = "ip_adress:port"
# generator_work modbus adress
TRANSMITTED_WORK = "6"
# connection modbus adress
CONNECTION = "19"
设置环境
- 安装SMLogix
- 将PLC Pixel文件 "ats control.psl" 上传到PLC
- 将PLC Trim5文件 "winter garden.psl" 上传到PLC
- 安装Orange Data Mining
- 配置从SQL数据库读取数据
- 在ClickSend上创建账户并充值
- 创建Telegram-bot
- 运行PLC Pixel
- 运行PLC Trim5
本地运行应用
- 运行ATS Monitoring
$ cd ats-monitoring && cargo run --release
- 使用env_logger运行ATS Monitoring
# For example:
$ RUST_LOG=debug cargo run --release
- 将日志写入文件
$ RUST_LOG=debug cargo run --release > log.txt
本地使用docker运行应用
- 在后台运行应用和postgresql
$ docker compose up -d
- 全部拆除
$ docker compose down
- 拆除并删除卷
$ docker compose down --volumes
使用
Orange Data Mining
在Orange Data Mining中以所需的形式创建和保存报告
短信
检查您的手机以获取来自ClickSend的短信
Telegram-bot监控
要跟踪自动备用输入控制系统的变量瞬时值,请输入命令(或从菜单中选择项)。
/ats
要跟踪自动冬季花园管理系统变量的瞬时值,请输入命令(或从菜单中选择项)。
/wintergarden
Telegram bot在以下情况下发送消息
- 数据库操作错误
- Modbus tcp操作错误
- 应用程序的其他关键错误
Telegram bot和sms网关在以下情况下发送消息
- 从主电网断电
# For example:
disconnecting power from the mains,
successful start of the generator
或
# For example:
disconnecting power from the mains,
the generator startup failed
- 从电网恢复供电
# For example:
the power supply from the power grid has been restored,
the generator is working fine
或
# For example:
the power supply has not been restored,
the generator is faulty
- 城市电网供电传输模式下的发电机故障
# For example:
Alarm! The generator is faulty! Urgently perform service work!
- 从城市电网传输模式恢复发电机的运行
the efficiency of the generator in the mode
of transmission of electricity from the power grid has been restored
依赖项
~15–29MB
~472K SLoC