From 8a3d4cc59db5878fc63e831c1f14efeb5491fb4d Mon Sep 17 00:00:00 2001 From: nodered Date: Mon, 1 Jun 2026 12:56:15 +0300 Subject: [PATCH] Create project --- .gitignore | 1 + README.md | 7 + flows.json | 388 ++++++++++++++++++++++++++++++++++++++++++++++++ flows_cred.json | 4 + package.json | 12 ++ 5 files changed, 412 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 flows.json create mode 100644 flows_cred.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c9c01a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.backup \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ce9d31 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +EDGE5 +===== + +### About + +This is your project's README.md file. It helps users understand what your +project does, how to use it and anything else they may need to know. \ No newline at end of file diff --git a/flows.json b/flows.json new file mode 100644 index 0000000..c6aa75d --- /dev/null +++ b/flows.json @@ -0,0 +1,388 @@ +[ + { + "id": "0ddaa4b089a41228", + "type": "tab", + "label": "ИВЭ Modbus-Read", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "f1a1b1c1d1e1f1a1", + "type": "tab", + "label": "TRASSIR RTSP capture", + "disabled": false, + "info": "" + }, + { + "id": "5da01c52b4b66842", + "type": "modbus-client", + "name": "modbus client", + "clienttype": "simpleser", + "bufferCommands": true, + "stateLogEnabled": false, + "queueLogEnabled": false, + "failureLogEnabled": true, + "tcpHost": "201.204.210.10", + "tcpPort": 502, + "tcpType": "DEFAULT", + "serialPort": "COM3", + "serialType": "RTU-BUFFERD", + "serialBaudrate": "115200", + "serialDatabits": 8, + "serialStopbits": 1, + "serialParity": "none", + "serialConnectionDelay": 100, + "serialAsciiResponseStartDelimiter": "0x3A", + "unit_id": 1, + "commandDelay": 1, + "clientTimeout": 1000, + "reconnectOnTimeout": true, + "reconnectTimeout": 2000, + "parallelUnitIdsAllowed": true, + "showErrors": false, + "showWarnings": true, + "showLogs": true + }, + { + "id": "f8c6b094974bfa97", + "type": "serial-port", + "d": true, + "name": "", + "serialport": "COM3", + "serialbaud": "115200", + "databits": 8, + "parity": "none", + "stopbits": 1, + "waitfor": "", + "dtr": "none", + "rts": "none", + "cts": "none", + "dsr": "none", + "newline": "1", + "bin": "bin", + "out": "count", + "addchar": "", + "responsetimeout": 10000 + }, + { + "id": "2ea045ed18342d31", + "type": "modbus-read", + "z": "0ddaa4b089a41228", + "name": "Modbus-Read", + "topic": "", + "showStatusActivities": false, + "logIOActivities": false, + "showErrors": false, + "showWarnings": true, + "unitid": "1", + "dataType": "HoldingRegister", + "adr": "0", + "quantity": "125", + "rate": "1000", + "rateUnit": "ms", + "delayOnStart": false, + "enableDeformedMessages": false, + "startDelayTime": "", + "server": "5da01c52b4b66842", + "useIOFile": false, + "ioFile": "", + "useIOForPayload": false, + "emptyMsgOnFail": false, + "x": 130, + "y": 60, + "wires": [ + [ + "a6152c5476ec5893", + "98304439b5ebd360" + ], + [] + ] + }, + { + "id": "a6152c5476ec5893", + "type": "debug", + "z": "0ddaa4b089a41228", + "name": "debug 2", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 460, + "y": 60, + "wires": [] + }, + { + "id": "98304439b5ebd360", + "type": "http request", + "z": "0ddaa4b089a41228", + "d": true, + "name": "", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://drill.greact.online/ingest", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 470, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "a1", + "type": "inject", + "z": "f1a1b1c1d1e1f1a1", + "name": "start stream", + "props": [ + { + "p": "payload" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 130, + "y": 100, + "wires": [ + [ + "a2" + ] + ] + }, + { + "id": "a2", + "type": "function", + "z": "f1a1b1c1d1e1f1a1", + "name": "build ffmpeg args", + "func": "msg.payload = '-hide_banner -loglevel error -rtsp_transport tcp ' +\n '-i \"rtsp://admin:admin@192.168.0.11:554/live/main\" ' +\n '-an -c copy -f mpegts pipe:1';\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 340, + "y": 100, + "wires": [ + [ + "a3" + ] + ] + }, + { + "id": "a3", + "type": "exec", + "z": "f1a1b1c1d1e1f1a1", + "command": "ffmpeg", + "addpay": "payload", + "append": "", + "useSpawn": "true", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "ffmpeg spawn", + "x": 560, + "y": 100, + "wires": [ + [ + "a4", + "a7" + ], + [ + "a5" + ], + [ + "a6" + ] + ] + }, + { + "id": "a4", + "type": "function", + "z": "f1a1b1c1d1e1f1a1", + "name": "chunk info", + "func": "if (Buffer.isBuffer(msg.payload)) {\n msg.chunkLength = msg.payload.length;\n msg.payload = {\n chunkLength: msg.chunkLength,\n headHex: msg.payload.subarray(0, Math.min(32, msg.payload.length)).toString('hex')\n };\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 770, + "y": 80, + "wires": [ + [ + "a8" + ] + ] + }, + { + "id": "a5", + "type": "debug", + "z": "f1a1b1c1d1e1f1a1", + "name": "ffmpeg stderr/log", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": true, + "complete": "payload", + "targetType": "msg", + "x": 790, + "y": 120, + "wires": [] + }, + { + "id": "a6", + "type": "debug", + "z": "f1a1b1c1d1e1f1a1", + "name": "ffmpeg rc", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": true, + "complete": "payload", + "targetType": "msg", + "x": 760, + "y": 160, + "wires": [] + }, + { + "id": "a7", + "type": "delay", + "z": "f1a1b1c1d1e1f1a1", + "name": "sample 1/5 sec", + "pauseType": "rate", + "timeout": "5", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "5", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": true, + "allowrate": false, + "outputs": 1, + "x": 760, + "y": 220, + "wires": [ + [ + "a9" + ] + ] + }, + { + "id": "a8", + "type": "debug", + "z": "f1a1b1c1d1e1f1a1", + "name": "stream chunk meta", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": true, + "complete": "payload", + "targetType": "msg", + "x": 990, + "y": 80, + "wires": [] + }, + { + "id": "a9", + "type": "http request", + "z": "f1a1b1c1d1e1f1a1", + "name": "send chunk to cloud", + "method": "POST", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://YOUR-CLOUD-ENDPOINT.example/upload-chunk", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 990, + "y": 220, + "wires": [ + [ + "b1" + ] + ] + }, + { + "id": "b1", + "type": "debug", + "z": "f1a1b1c1d1e1f1a1", + "name": "cloud response", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": true, + "complete": "payload", + "targetType": "msg", + "x": 1200, + "y": 220, + "wires": [] + }, + { + "id": "dfbb81298270d1d0", + "type": "exec", + "z": "f1a1b1c1d1e1f1a1", + "command": "taskkill", + "addpay": "", + "append": "/IM ffmpeg.exe /F", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "", + "x": 310, + "y": 220, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "7cd54e61e1944119", + "type": "inject", + "z": "f1a1b1c1d1e1f1a1", + "name": "stop stream", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 110, + "y": 220, + "wires": [ + [ + "dfbb81298270d1d0" + ] + ] + } +] \ No newline at end of file diff --git a/flows_cred.json b/flows_cred.json new file mode 100644 index 0000000..964c95a --- /dev/null +++ b/flows_cred.json @@ -0,0 +1,4 @@ +{ + "98304439b5ebd360": {}, + "a9": {} +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..72b794e --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "EDGE5", + "description": "A Node-RED Project", + "version": "0.0.1", + "dependencies": {}, + "node-red": { + "settings": { + "flowFile": "flows.json", + "credentialsFile": "flows_cred.json" + } + } +} \ No newline at end of file