Skip to content

Commit 51a5a61

Browse files
authored
v 1.9.6
1 parent 30359b3 commit 51a5a61

File tree

1 file changed

+1
-339
lines changed

1 file changed

+1
-339
lines changed

FreeTAKHub VideoChecker.json

Lines changed: 1 addition & 339 deletions
Original file line numberDiff line numberDiff line change
@@ -1,339 +1 @@
1-
[{
2-
"id": "e81402f5.f8254",
3-
"type": "tab",
4-
"label": "FTH VideoChecker",
5-
"disabled": false,
6-
"info": "this flow checks the simple-RTSP video service using the API and parses the active paths.\nWhen a path is present, it creates a video end point into FTS.\nFTS sends the video point to all the connected TAK devices.\nEnd point with the same name will be updated"
7-
}, {
8-
"id": "2a7e77e7.a92748",
9-
"type": "http request",
10-
"z": "e81402f5.f8254",
11-
"name": "Post Video to FTS",
12-
"method": "POST",
13-
"ret": "txt",
14-
"paytoqs": "ignore",
15-
"url": "{{{addr}}}:{{{port}}}/ManageVideoStream/postVideoStream",
16-
"tls": "",
17-
"persist": false,
18-
"proxy": "",
19-
"authType": "bearer",
20-
"x": 1090,
21-
"y": 240,
22-
"wires": [["25874402.182cec", "f8da2c2e.b2fb3"]]
23-
}, {
24-
"id": "25874402.182cec",
25-
"type": "switch",
26-
"z": "e81402f5.f8254",
27-
"name": "check retunr",
28-
"property": "statusCode",
29-
"propertyType": "msg",
30-
"rules": [{
31-
"t": "eq",
32-
"v": "200",
33-
"vt": "str"
34-
}, {
35-
"t": "eq",
36-
"v": "500",
37-
"vt": "str"
38-
}, {
39-
"t": "eq",
40-
"v": "401",
41-
"vt": "str"
42-
}
43-
],
44-
"checkall": "true",
45-
"repair": false,
46-
"outputs": 3,
47-
"x": 1310,
48-
"y": 240,
49-
"wires": [["791450ee.61b5a"], ["1b6de090.e2467f"], ["a48bd58e.401dc8"]]
50-
}, {
51-
"id": "791450ee.61b5a",
52-
"type": "debug",
53-
"z": "e81402f5.f8254",
54-
"name": "Success!",
55-
"active": true,
56-
"tosidebar": true,
57-
"console": false,
58-
"tostatus": false,
59-
"complete": "payload",
60-
"targetType": "msg",
61-
"statusVal": "",
62-
"statusType": "auto",
63-
"x": 1520,
64-
"y": 200,
65-
"wires": []
66-
}, {
67-
"id": "1b6de090.e2467f",
68-
"type": "debug",
69-
"z": "e81402f5.f8254",
70-
"name": " INTERNAL SERVER ERROR",
71-
"active": true,
72-
"tosidebar": true,
73-
"console": false,
74-
"tostatus": false,
75-
"complete": "payload",
76-
"targetType": "msg",
77-
"statusVal": "",
78-
"statusType": "auto",
79-
"x": 1640,
80-
"y": 240,
81-
"wires": []
82-
}, {
83-
"id": "a48bd58e.401dc8",
84-
"type": "debug",
85-
"z": "e81402f5.f8254",
86-
"name": "Non authorized",
87-
"active": true,
88-
"tosidebar": true,
89-
"console": false,
90-
"tostatus": false,
91-
"complete": "payload",
92-
"targetType": "msg",
93-
"statusVal": "",
94-
"statusType": "auto",
95-
"x": 1540,
96-
"y": 300,
97-
"wires": []
98-
}, {
99-
"id": "41b82d8d.8266e4",
100-
"type": "function",
101-
"z": "e81402f5.f8254",
102-
"name": "CreateVideoStream",
103-
"func": "\n msg.addr = global.get('FTH_FTS_URL');\n msg.port = global.get('FTH_FTS_API_Port');\n msg.streamPort = global.get('FTH_FTS_STREAM_Port');\n msg.streamAddress = global.get('FTH_FTS_VIDEO_URL');\n let streamPath = msg.payload.confName;\n let alias = msg.payload.confName;\n let streamProtocol= \"rtsp\";\n\n \n\nmsg.payload = [];\n\n msg.payload={\n alias: alias,\n streamProtocol: streamProtocol,\n streamAddress: msg.streamAddress,\n streamPort: msg.streamPort ,\n streamPath: streamPath,\n };\n \nreturn msg;\n\n",
104-
"outputs": 1,
105-
"noerr": 0,
106-
"initialize": "",
107-
"finalize": "",
108-
"libs": [],
109-
"x": 870,
110-
"y": 360,
111-
"wires": [["2a7e77e7.a92748", "351711f.8aa5aee"]]
112-
}, {
113-
"id": "351711f.8aa5aee",
114-
"type": "debug",
115-
"z": "e81402f5.f8254",
116-
"name": "Rest Payload",
117-
"active": false,
118-
"tosidebar": true,
119-
"console": false,
120-
"tostatus": false,
121-
"complete": "payload",
122-
"targetType": "msg",
123-
"statusVal": "",
124-
"statusType": "auto",
125-
"x": 1090,
126-
"y": 360,
127-
"wires": []
128-
}, {
129-
"id": "f8da2c2e.b2fb3",
130-
"type": "debug",
131-
"z": "e81402f5.f8254",
132-
"name": "",
133-
"active": false,
134-
"tosidebar": true,
135-
"console": false,
136-
"tostatus": false,
137-
"complete": "true",
138-
"targetType": "full",
139-
"statusVal": "",
140-
"statusType": "auto",
141-
"x": 1290,
142-
"y": 360,
143-
"wires": []
144-
}, {
145-
"id": "529fdac2.273054",
146-
"type": "http request",
147-
"z": "e81402f5.f8254",
148-
"name": "Connect to RTSP server",
149-
"method": "GET",
150-
"ret": "obj",
151-
"paytoqs": "ignore",
152-
"url": "http://{{{addr}}}:{{{port}}}/v1/paths/list",
153-
"tls": "",
154-
"persist": false,
155-
"proxy": "",
156-
"authType": "",
157-
"x": 290,
158-
"y": 160,
159-
"wires": [["801fd65f.5be7d8", "70339513.554ecc"]]
160-
}, {
161-
"id": "801fd65f.5be7d8",
162-
"type": "debug",
163-
"z": "e81402f5.f8254",
164-
"name": "",
165-
"active": false,
166-
"tosidebar": true,
167-
"console": false,
168-
"tostatus": false,
169-
"complete": "true",
170-
"targetType": "full",
171-
"statusVal": "",
172-
"statusType": "auto",
173-
"x": 550,
174-
"y": 80,
175-
"wires": []
176-
}, {
177-
"id": "5812cb15.cd4b04",
178-
"type": "inject",
179-
"z": "e81402f5.f8254",
180-
"name": "start",
181-
"props": [{
182-
"p": "addr",
183-
"v": "",
184-
"vt": "date"
185-
}
186-
],
187-
"repeat": "300",
188-
"crontab": "",
189-
"once": false,
190-
"onceDelay": 0.1,
191-
"topic": "",
192-
"x": 110,
193-
"y": 80,
194-
"wires": [["ab5e51e8.e29b5"]]
195-
}, {
196-
"id": "e7eb8030.427a4",
197-
"type": "switch",
198-
"z": "e81402f5.f8254",
199-
"name": "check streams",
200-
"property": "payload.confName",
201-
"propertyType": "msg",
202-
"rules": [{
203-
"t": "nempty"
204-
}, {
205-
"t": "null"
206-
}, {
207-
"t": "eq",
208-
"v": "",
209-
"vt": "str"
210-
}
211-
],
212-
"checkall": "true",
213-
"repair": false,
214-
"outputs": 3,
215-
"x": 640,
216-
"y": 360,
217-
"wires": [["41b82d8d.8266e4"], ["7fc68a9f.e82fe4"], []]
218-
}, {
219-
"id": "7fc68a9f.e82fe4",
220-
"type": "debug",
221-
"z": "e81402f5.f8254",
222-
"name": "no stream!",
223-
"active": true,
224-
"tosidebar": true,
225-
"console": false,
226-
"tostatus": false,
227-
"complete": "true",
228-
"targetType": "full",
229-
"statusVal": "",
230-
"statusType": "auto",
231-
"x": 850,
232-
"y": 420,
233-
"wires": []
234-
}, {
235-
"id": "b6661f0d.790e8",
236-
"type": "debug",
237-
"z": "e81402f5.f8254",
238-
"name": "after split",
239-
"active": false,
240-
"tosidebar": true,
241-
"console": false,
242-
"tostatus": false,
243-
"complete": "payload",
244-
"targetType": "msg",
245-
"statusVal": "",
246-
"statusType": "auto",
247-
"x": 840,
248-
"y": 80,
249-
"wires": []
250-
}, {
251-
"id": "70339513.554ecc",
252-
"type": "split",
253-
"z": "e81402f5.f8254",
254-
"name": "",
255-
"splt": "\\n",
256-
"spltType": "str",
257-
"arraySplt": 1,
258-
"arraySpltType": "len",
259-
"stream": false,
260-
"addname": "",
261-
"x": 530,
262-
"y": 180,
263-
"wires": [["90676aac.d49f98"]]
264-
}, {
265-
"id": "90676aac.d49f98",
266-
"type": "split",
267-
"z": "e81402f5.f8254",
268-
"name": "",
269-
"splt": "\\n",
270-
"spltType": "str",
271-
"arraySplt": 1,
272-
"arraySpltType": "len",
273-
"stream": false,
274-
"addname": "",
275-
"x": 670,
276-
"y": 180,
277-
"wires": [["b6661f0d.790e8", "e7eb8030.427a4"]]
278-
}, {
279-
"id": "ab5e51e8.e29b5",
280-
"type": "function",
281-
"z": "e81402f5.f8254",
282-
"name": "getVideoStream",
283-
"func": "\n msg.addr = global.get('FTH_FTS_VIDEO_URL');\n msg.port = global.get('FTH_FTS_VIDEO_API_PORT');\n \n \nreturn msg;\n\n",
284-
"outputs": 1,
285-
"noerr": 0,
286-
"initialize": "",
287-
"finalize": "",
288-
"libs": [],
289-
"x": 160,
290-
"y": 360,
291-
"wires": [["529fdac2.273054"]]
292-
}, {
293-
"id": "cb4abca3.6a73d",
294-
"type": "config",
295-
"z": "e81402f5.f8254",
296-
"name": "FTH Global Config",
297-
"properties": [{
298-
"p": "FTH_FTS_URL",
299-
"pt": "global",
300-
"to": "",
301-
"tot": "str"
302-
}, {
303-
"p": "FTH_FTS_TCP_Port",
304-
"pt": "global",
305-
"to": "8087",
306-
"tot": "str"
307-
}, {
308-
"p": "FTH_FTS_API_Port",
309-
"pt": "global",
310-
"to": "19023",
311-
"tot": "str"
312-
}, {
313-
"p": "FTH_FTS_API_Auth",
314-
"pt": "global",
315-
"to": "",
316-
"tot": "str"
317-
}, {
318-
"p": "FTH_FTS_STREAM_Port",
319-
"pt": "global",
320-
"to": "8554",
321-
"tot": "str"
322-
}, {
323-
"p": "FTH_FTS_VIDEO_URL",
324-
"pt": "global",
325-
"to": "",
326-
"tot": "str"
327-
}, {
328-
"p": "FTH_FTS_VIDEO_API_PORT",
329-
"pt": "global",
330-
"to": "9997",
331-
"tot": "str"
332-
}
333-
],
334-
"active": true,
335-
"x": 170,
336-
"y": 420,
337-
"wires": []
338-
}
339-
]
1+
[{"id":"e81402f5.f8254","type":"tab","label":"FTH VideoChecker","disabled":false,"info":"this flow checks the simple-RTSP video service using the API and parses the active paths.\nWhen a path is present, it creates a video end point into FTS.\nFTS sends the video point to all the connected TAK devices.\nEnd point with the same name will be updated"},{"id":"2a7e77e7.a92748","type":"http request","z":"e81402f5.f8254","name":"Post Video to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"{{{addr}}}:{{{port}}}/ManageVideoStream/postVideoStream","tls":"","persist":false,"proxy":"","authType":"bearer","x":970,"y":240,"wires":[["25874402.182cec","f8da2c2e.b2fb3"]]},{"id":"25874402.182cec","type":"switch","z":"e81402f5.f8254","name":"check retunr","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"eq","v":"500","vt":"str"},{"t":"eq","v":"401","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1310,"y":240,"wires":[["791450ee.61b5a"],["1b6de090.e2467f"],["a48bd58e.401dc8"]]},{"id":"791450ee.61b5a","type":"debug","z":"e81402f5.f8254","name":"Success!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1520,"y":200,"wires":[]},{"id":"1b6de090.e2467f","type":"debug","z":"e81402f5.f8254","name":" INTERNAL SERVER ERROR","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1590,"y":240,"wires":[]},{"id":"a48bd58e.401dc8","type":"debug","z":"e81402f5.f8254","name":"Non authorized","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1520,"y":300,"wires":[]},{"id":"41b82d8d.8266e4","type":"function","z":"e81402f5.f8254","name":"CreateVideoStream","func":"\n msg.addr = global.get('FTH_FTS_URL');\n msg.port = global.get('FTH_FTS_API_Port');\n msg.streamPort = global.get('FTH_FTS_STREAM_Port');\n msg.streamAddress = global.get('FTH_FTS_VIDEO_URL');\n let streamPath = msg.payload;\n let alias = msg.payload;\n let streamProtocol= \"rtsp\";\n\n \n\nmsg.payload = [];\n\n msg.payload={\n alias: alias,\n streamProtocol: streamProtocol,\n streamAddress: msg.streamAddress,\n streamPort: msg.streamPort ,\n streamPath: streamPath,\n };\n \nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":280,"wires":[["2a7e77e7.a92748","351711f.8aa5aee"]]},{"id":"351711f.8aa5aee","type":"debug","z":"e81402f5.f8254","name":"Rest Payload","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":300,"wires":[]},{"id":"f8da2c2e.b2fb3","type":"debug","z":"e81402f5.f8254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":180,"wires":[]},{"id":"529fdac2.273054","type":"http request","z":"e81402f5.f8254","name":"Connect to RTSP server","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://{{{addr}}}:{{{port}}}/v1/paths/list","tls":"","persist":false,"proxy":"","authType":"","x":490,"y":160,"wires":[["801fd65f.5be7d8","70339513.554ecc"]]},{"id":"801fd65f.5be7d8","type":"debug","z":"e81402f5.f8254","name":"received from JSON","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":80,"wires":[]},{"id":"5812cb15.cd4b04","type":"inject","z":"e81402f5.f8254","name":"start","props":[{"p":"addr","v":"","vt":"date"}],"repeat":"120","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":80,"wires":[["ab5e51e8.e29b5"]]},{"id":"e7eb8030.427a4","type":"switch","z":"e81402f5.f8254","name":"check streams","property":"payload.source","propertyType":"msg","rules":[{"t":"nempty"},{"t":"null"},{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":600,"y":400,"wires":[[],["7fc68a9f.e82fe4"],[]]},{"id":"7fc68a9f.e82fe4","type":"debug","z":"e81402f5.f8254","name":"no stream!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":440,"wires":[]},{"id":"b6661f0d.790e8","type":"debug","z":"e81402f5.f8254","name":"after split","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":460,"wires":[]},{"id":"70339513.554ecc","type":"split","z":"e81402f5.f8254","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":710,"y":160,"wires":[["ce49e6a3.280768","7714b387.25136c"]]},{"id":"90676aac.d49f98","type":"split","z":"e81402f5.f8254","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":410,"y":420,"wires":[["b6661f0d.790e8","e7eb8030.427a4"]]},{"id":"ab5e51e8.e29b5","type":"function","z":"e81402f5.f8254","name":"getVideoStream","func":"\n msg.addr = global.get('FTH_FTS_VIDEO_URL');\n msg.port = global.get('FTH_FTS_VIDEO_API_PORT');\n \n \nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":80,"wires":[["529fdac2.273054"]]},{"id":"cb4abca3.6a73d","type":"config","z":"e81402f5.f8254","name":"FTH Global Config","properties":[{"p":"FTH_FTS_URL","pt":"global","to":"204.48.30.216","tot":"str"},{"p":"FTH_FTS_TCP_Port","pt":"global","to":"8087","tot":"str"},{"p":"FTH_FTS_API_Port","pt":"global","to":"19023","tot":"str"},{"p":"FTH_FTS_API_Auth","pt":"global","to":"OrionLab11","tot":"str"},{"p":"FTH_FTS_STREAM_Port","pt":"global","to":"8554","tot":"str"},{"p":"FTH_FTS_VIDEO_URL","pt":"global","to":"147.182.190.54","tot":"str"},{"p":"FTH_FTS_VIDEO_API_PORT","pt":"global","to":"9997","tot":"str"}],"active":true,"x":150,"y":160,"wires":[]},{"id":"ce49e6a3.280768","type":"debug","z":"e81402f5.f8254","name":"conf name","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":60,"wires":[]},{"id":"7714b387.25136c","type":"function","z":"e81402f5.f8254","name":"","func":"\nnode.warn(Object.keys(msg.payload).length);\nfor (let i = 0; i < Object.keys(msg.payload).length; i++) { \n // node.warn(Object.keys(msg.payload)[i])\n if (Object.values(msg.payload)[i].source){\n msg.payload = \"/\"+Object.keys(msg.payload)[i]\n node.send(msg)\n }\n}\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":160,"wires":[["41b82d8d.8266e4","b6146596.a3aeb8"]]},{"id":"b6146596.a3aeb8","type":"debug","z":"e81402f5.f8254","name":"after function","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":80,"wires":[]},{"id":"bfadd2cc.7c368","type":"inject","z":"e81402f5.f8254","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":390,"y":520,"wires":[["a4bc3376.a38dd"]]},{"id":"a4bc3376.a38dd","type":"function","z":"e81402f5.f8254","name":"","func":"var colors=[\"red\",\"blue\",\"green\"];\nfor (let i = 0; i < colors.length; i++) { \n msg.payload = colors[i]\n node.send(msg);\n}\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":520,"wires":[["c290bbb3.401e98"]]},{"id":"c290bbb3.401e98","type":"debug","z":"e81402f5.f8254","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":520,"wires":[]}]

0 commit comments

Comments
 (0)