ats-monitoring-0.3.0 is not a library.
ATS Monitoring
Application for collecting data from controllers, recording values and events in the PostgreSQL DBMS, sending notifications via the SMS gateway API
Prerequisites
- Install Rust for Linux or macOS
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
For Windows, visit this page
- Install dependencies
$ sudo apt-get install libssl-dev build-essential
Initial setup
- Clone the repository
$ git clone git@github.com:stepanov-denis/ats-monitoring.git
- Edit the http get requests
let resp = reqwest::blocking::get("https://api-mapper.clicksend.com/http/v2/send.php?method=http&username=development-service@yandex.ru&key=1E82A334-89D8-985C-526B-712DB70A713D&to=+79139402913&message=Сбой+питания+от+электросети.+Успешный+старт+генератора.").unwrap();
- Edit the connection configuration strings to PostgreSQL in module psql (psql.rs)
pub fn db_connect() -> String {
let string_connection = String::from("postgresql://stepanov:postgres@localhost/postgres");
return string_connection
}
- Compile local packages and all their dependencies
$ cargo build --release
Setting up the environment
- Install PostgreSQL
- Install SMLogix
- Upload into PLC Pixel file "ats control.psl" and edit network addresses
- Upload into PLC Trim5 file "winter garden.psl" and edit network addresses
- Install Orange Data Mining
- Сonfigure data reading from SQL database
- Create an account on ClickSend and top up your balance
- Run PLC Pixel
- Run PLC Trim5
- Run PostgreSQL
- Run ATS Monitoring
Use
- Сreate and save the report in the form you need in Orange Data Mining
- Check your phone for SMS messages from ClickSend