Application for collecting data from controllers, recording values and events in the PostgreSQL DBMS, sending notifications via the SMS gateway API
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
For Windows, visit this page
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();
let mut client =
Client::connect("postgresql://postgres:postgres@localhost/postgres", NoTls)?;
Compile local packages and all their dependencies
$ cargo build --release
Install PostgreSQL
CREATE TABLE avr_control_insert (
mains_power_supply int NOT NULL,
start_generator int NOT NULL,
generator_faulty int NOT NULL,
generator_work int NOT NULL,
connection int NOT NULL,
mark timestamptz default current_timestamp
);
CREATE TABLE журнал_работы_приложения (
событие text NOT NULL,
время_и_дата timestamp default current_timestamp
);
CREATE TABLE зимний_сад (
фитоосвещение_1 int NOT NULL,
фитоосвещение_2 int NOT NULL,
фитоосвещение_3 int NOT NULL,
фитоосвещение_4 int NOT NULL,
вентилятор int NOT NULL,
автополив_1 int NOT NULL,
автополив_2 int NOT NULL,
автополив_3 int NOT NULL,
температура int NOT NULL,
влажность int NOT NULL,
освещенность_в_помещении int NOT NULL,
освещенность_на_улице int NOT NULL,
время_и_дата timestamp default current_timestamp
);
```
CREATE TABLE нагрузканагенератор (
нагрузка int NOT NULL,
времяидата timestamp default current_timestamp);
CREATE TABLE событияавр (
событие text NOT NULL,
времяидата timestamp default currenttimestamp
);
```
* 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