-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwigleTakFlow.json
744 lines (744 loc) · 34.1 KB
/
wigleTakFlow.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
[
{
"id": "039de8c509054630",
"type": "tab",
"label": "wigleTakFlow",
"disabled": false,
"info": "",
"env": []
},
{
"id": "2f2a6e6e0ee881cc",
"type": "http request",
"z": "039de8c509054630",
"name": "http req",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.wigle.net/api/v2/cell/search?onlymine=false¬mine=true&latrange1={{{payload.lat1}}}&latrange2={{{payload.lat2}}}&longrange1={{{payload.lon1}}}&longrange2={{{payload.lon2}}}&startTransID={{{payload.earliest}}}&minQoS=0&showGsm=true&showCdma=true&showLte=true&showWcdma=true&showNr=true&variance={{{payload.variance}}}&resultsPerPage={{{payload.results}}}",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [
{
"keyType": "Authorization",
"keyValue": "",
"valueType": "other",
"valueValue": "\"Basic QUllEABR6UODVP7wm4FGs4VB6o1XAPdW3VBsZ7Nzc3YzU5OTc=\""
}
],
"x": 1360,
"y": 300,
"wires": [
[
"22f5a257871faf09",
"8a82ddb1d310185b"
]
]
},
{
"id": "22f5a257871faf09",
"type": "debug",
"z": "039de8c509054630",
"name": "debug http1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1530,
"y": 200,
"wires": []
},
{
"id": "874afbc53414d974",
"type": "tcp in",
"z": "039de8c509054630",
"name": "",
"server": "client",
"host": "10.237.104.20",
"port": "8089",
"datamode": "stream",
"datatype": "utf8",
"newline": "",
"topic": "",
"trim": false,
"base64": false,
"tls": "1c52b35895c06e7e",
"x": 340,
"y": 240,
"wires": [
[
"3b883c904c42322a"
]
]
},
{
"id": "3b883c904c42322a",
"type": "tak",
"z": "039de8c509054630",
"name": "TAK",
"x": 630,
"y": 240,
"wires": [
[
"a2fb3759b1880994",
"ed766a5f88e0c60b",
"6f817d83c48a1c6d",
"32c3e7b31e5f9c54",
"2a51209568c61a36",
"d74c0b5a4ee274b2",
"1b01bd44f60505e7"
],
[],
[]
]
},
{
"id": "a2fb3759b1880994",
"type": "function",
"z": "039de8c509054630",
"name": "filter data cellular",
"func": "var callsign = msg.payload.event.detail.contact._attributes.callsign;\nif (callsign === \"Cellular\" || callsign === \"CELLULAR\" || callsign === \"cellular\") {\n var coord1 = msg.payload.event.detail.link[0]._attributes.point.split(\",\");\n var coord2 = msg.payload.event.detail.link[1]._attributes.point.split(\",\");\n var coord3 = msg.payload.event.detail.link[2]._attributes.point.split(\",\");\n var coord4 = msg.payload.event.detail.link[3]._attributes.point.split(\",\");\n var lat = [coord1[0], coord2[0], coord3[0], coord4[0]];\n var lon = [coord1[1], coord2[1], coord3[1], coord4[1]];\n lat.sort(function(a,b){\n return a - b;\n });\n lon.sort(function (a, b) {\n return a - b;\n });\n\n var results = 50;\n var variance = 0.001;\n var earliest = \"20230101-00000\";\n\n msg.payload = {\n \"lat1\": String(parseFloat(lat[0])),\n \"lat2\": String(parseFloat(lat[3])),\n \"lon1\": String(parseFloat(lon[0])),\n \"lon2\": String(parseFloat(lon[3])),\n \"results\": results,\n \"variance\": variance,\n \"earliest\": earliest\n };\n node.send(msg);\n} else {\n return null;\n};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 850,
"y": 300,
"wires": [
[
"8316e8d0c8bdf329",
"2f2a6e6e0ee881cc"
]
]
},
{
"id": "8316e8d0c8bdf329",
"type": "debug",
"z": "039de8c509054630",
"name": "debug filter1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1050,
"y": 200,
"wires": []
},
{
"id": "f6d29f64729af6de",
"type": "debug",
"z": "039de8c509054630",
"name": "debug json1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1750,
"y": 200,
"wires": []
},
{
"id": "b8271e7ce1d88dc1",
"type": "comment",
"z": "039de8c509054630",
"name": "README",
"info": "README\n\nREQUIREMENTS:\n-Node-Red\n-node-red-contrib-tak https://github.com/snstac/node-red-contrib-tak\n-TAKServer (or Multicast supported devices)\n-WiGLE account to obtain an API Token https://www.wigle.net\n\n------------------------------\n\nSETUP NODE-RED:\n-https://nodered.org/docs/getting-started/\n-options include installing node-red on your local PC, a Raspberry Pi or similar single board computer or mini PC, deploying node-red on a cloud server or virtual private server (VPS), Docker Container, or local virtual environment. After installing node-red you should be able to go to the node-red dashboard at http://*nodeRedIPaddress:1880 you may have to open appropriate ports (1880) to allow devices to access the node-red dashboard.\n\n------------------------------\n\nIMPORT .JSON FLOW TO NODE RED:\n-in GitHub: click on \"wigleTakFlow.json\" > click on the download icon \"Download raw file\" > note where the \"wigleTakFlow.json\" file downloaded to, default is in your Downloads folder\n-in Node-Red: click on menu icon (3 horizontal lines top right) > click on \"Import\" > click on \"select a file to import\" > go to Downloads folder and click on \"wigleTakFlow.json\" > Upload > Import\n\nALTERNATIVELY..\n-you can just copy the whole \"wigleTakFlow.json\" code from GitHub and paste it into the Node-Red Import Clipboard.\n\n------------------------------\n\nCONFIGURE TAKSERVER:\n-TAKServer can be hosted on various platforms: Raspberry Pi, Mini PCs, your local PC, Cloud Servers or Virtual Private Servers (VPS), Docker Containers, or Virtual Environments. Regardless, if you're looking for instructions on setting up your TAKServer I recommend ATAKHQs guides https://www.atakhq.com/en/tak-server\n-Configuring the TCP (TAKServer) node in Node-Red wigleTakFlow, Input your TAKServer IP and Port, and checkbox whether you're using SSL/TLS or not. If you are using SSL/TLS, ensure you upload you TAKServer certificates and key that are located in the directory of your TAKServer that stores all client certificates/keys (ie: ubuntu docker container is \"/opt/tak/certs/files\"). I Suggest creating a TAK client \"node-red\" to be used specifically for Node-Reds handling of forwarding data to TAK. In your certificates file you will want to copy and upload \"node-red.pem\" as the \"Certificate\", \"node-red.key\" as the \"Private Key\" and \"ca.pem\" as the \"CA Certificate\" in the TLS Configuration Properties in the TCP (TAKServer) node in Node-Red. You will also need to enter the Passphrase for your TAKServer truststore, this can be found in your TAKServers CoreConfig.xml file. Default is \"atakatak\".\n\n------------------------------\n\nOBTAINING WIGLE API KEY:\n-register for a WiGLE account at https://wigle.net\n-navigate to WiGLEs API page for your account at https://wigle.net/account > Login > Show Token:\n-Encoded for use: \"Basic \" followed by this token will be copy pasted in the Authorization Header in Node-Red for both http req nodes in wigleTakFlow. The Authorization Header should look like \"Basic YOURTOKEN\" (quotation marks included).\n-API Name: this token will be copy pasted to the \"Username\" under \"basic authentication\" in Node-Red for both http req nodes in wigleTakFlow.\n-API Token: this token will be copy pasted to the \"Password\" under \"basic authentication\" in Node-Red for both http req nodes in wigleTakFlow.\n\n------------------------------\n\nUSING THE WIGLETAKFLOW:\n-once your TCP TAKServer node is connected and your WiGLE API tokens are entered (correctly), you're ready to start having your TAK devices get cell and wifi data.\n-in ATAK: Menu (3 horizontal lines) > Drawing Tools > *choose square > *tap your 3 points to create your box > *select center CoT marker of your box (default name is Rectangle 1) > *click bottom right waypoint/menu icon in radial menu > change shape name to: Cellular (to get cellular coverage) or change shape name to: Wifi (to get open WiFi APs) > Send > Broadcast > cellular or wifi data will return as CoT icons inside your square. In the remarks section of each CoT returned will be additional data on the cell tower or wifi AP.\n-in iTAK: Draw > *select polygon (the not circle shape) > select > *create a square around your area of interest > *change name to: Cellular (to get cellular coverage) or change shape name to: Wifi (to get open WiFi APs) > Share > Share with Contacts > Share With All >cellular or wifi data will return as CoT icons inside your square. In the remarks section of each CoT returned will be additional data on the cell tower or wifi AP.\n\n-------------------------------\n\nHOW THE WIGLETAKFLOW WORKS:\n-TCP (TAKServer) node sends CoT traffic to TAK node to turn into a readable JSON format\n-TAK node sends CoT as JSON to filter data node\n-filter data node constantly reads and waits til a CoT marker includes \"cellular\" or \"wifi\" as the callsign in which it grabs the plotted locations of the square shape as the maximum and minimum range to grab the wifi or cellular data for\n-http req nodes send a http GET to request of specific data from WiGLEs API depending on the callsign name\n-wigle json node formats a readable CoT to be passed to TAK node to turn into a XML CoT that TAK can understand\n-TAK turns the json data to CoT and pushes it via TCP (TAKServer) or UDP depending on what is chosen.\n",
"x": 520,
"y": 120,
"wires": []
},
{
"id": "60c8901c9b15f387",
"type": "tak",
"z": "039de8c509054630",
"name": "TAK",
"x": 1750,
"y": 300,
"wires": [
[
"e08477edbd5f97c7",
"848ad892cd929acf"
],
[],
[]
]
},
{
"id": "e08477edbd5f97c7",
"type": "debug",
"z": "039de8c509054630",
"name": "debug cot",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1950,
"y": 200,
"wires": []
},
{
"id": "a0bcdb61486af266",
"type": "udp out",
"z": "039de8c509054630",
"name": "",
"addr": "239.2.3.1",
"iface": "",
"port": "6969",
"ipv": "udp4",
"outport": "",
"base64": false,
"multicast": "multi",
"x": 1970,
"y": 280,
"wires": []
},
{
"id": "848ad892cd929acf",
"type": "tcp out",
"z": "039de8c509054630",
"name": "",
"host": "10.237.104.20",
"port": "8089",
"beserver": "client",
"base64": false,
"end": false,
"tls": "1c52b35895c06e7e",
"x": 1990,
"y": 340,
"wires": []
},
{
"id": "786665e303d206f2",
"type": "comment",
"z": "039de8c509054630",
"name": "configure both http req",
"info": "https://wigle.net/account\n\nusername = your API name\npassword = your API token\nauthorization header = \"Basic \" followed by your encoded for use token",
"x": 1320,
"y": 600,
"wires": []
},
{
"id": "8a82ddb1d310185b",
"type": "function",
"z": "039de8c509054630",
"name": "wigle json (towers)",
"func": "var newMsg;\nconst short = 10000;\nconst uno = 60 * 1000;\nconst cinco = 5 * 60 * 1000;\nconst diez = 2 * cinco;\nconst stale = new Date(Date.now() + uno).toISOString();\n\nfor (var i = 0; i < msg.payload.results.length; i++) {\n var lat = String(msg.payload.results[i].trilat);\n var lon = String(msg.payload.results[i].trilong);\n var name = msg.payload.results[i].ssid;\n var summary = msg.payload.results[i].attributes;\n var callsign = name + \";\" + summary;\n var uuid = msg.payload.results[i].id;\n var color = \"-65281\" //purple\n\n var ssid = \"SSID: \" + msg.payload.results[i].ssid;\n var qos = \", QoS: \" + msg.payload.results[i].qos;\n var firstSeen = \", First Seen: \" + msg.payload.results[i].firsttime;\n var lastSeen = \", Last Seen: \" + msg.payload.results[i].firsttime;\n var cellId = \", Cell ID: \" + msg.payload.results[i].id;\n var channel = \", Channel: \" + msg.payload.results[i].channel;\n var type = \", Type: \" + msg.payload.results[i].gentype;\n var address = \", Address: \" + msg.payload.results[i].housenumber + \" \" + msg.payload.results[i].road + \", \" + msg.payload.results[i].city + \", \" + msg.payload.results[i].region + \", \" + msg.payload.results[i].postalcode;\n var data = String(ssid + type + cellId + channel + qos + firstSeen + lastSeen + address);\n newMsg = {\n \"payload\": {\n \"event\": {\n \"_attributes\": {\n \"version\": \"2.0\",\n \"uid\": \"\"+ uuid +\"\",\n \"type\": \"b-m-p-s-m\",\n \"how\": \"h-g-i-g-o\",\n \"time\": new Date(Date.now()).toISOString(),\n \"start\": new Date(Date.now()).toISOString(),\n \"stale\": stale,\n },\n \"point\": {\n \"_attributes\": {\n \"lat\": \"\"+ lat +\"\",\n \"lon\": \"\"+ lon + \"\",\n \"hae\": \"0.0\",\n \"ce\": \"9999999.0\",\n \"le\": \"9999999.0\"\n }\n },\n \"detail\": {\n \"usericon\": {\n \"_attributes\": {\n \"iconsetpath\": \"COT_MAPPING_SPOTMAP/b-m-p-s-m/\"+ color +\"\",\n },\n },\n \"remarks\": {\n \"_text\": data,\n },\n \"contact\": {\n \"_attributes\": {\n \"callsign\": \"\"+ callsign +\"\",\n }\n },\n \"color\": {\n \"_attributes\": {\n \"argb\": \"\"+ color +\"\",\n },\n },\n }\n }\n }\n }\n node.send(newMsg);\n}\n//return msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1570,
"y": 300,
"wires": [
[
"60c8901c9b15f387",
"f6d29f64729af6de"
]
]
},
{
"id": "ed766a5f88e0c60b",
"type": "function",
"z": "039de8c509054630",
"name": "filter data wifi",
"func": "var callsign = msg.payload.event.detail.contact._attributes.callsign;\nif (callsign === \"wifi\" || callsign === \"WIFI\" || callsign === \"Wifi\" || callsign === \"WiFi\") {\n var coord1 = msg.payload.event.detail.link[0]._attributes.point.split(\",\");\n var coord2 = msg.payload.event.detail.link[1]._attributes.point.split(\",\");\n var coord3 = msg.payload.event.detail.link[2]._attributes.point.split(\",\");\n var coord4 = msg.payload.event.detail.link[3]._attributes.point.split(\",\");\n var lat = [coord1[0], coord2[0], coord3[0], coord4[0]];\n var lon = [coord1[1], coord2[1], coord3[1], coord4[1]];\n lat.sort(function(a,b){\n return a - b;\n });\n lon.sort(function (a, b) {\n return a - b;\n });\n\n //config parameters if needed\n var results = 50;\n var variance = 0.001;\n var earliest = \"20230101-00000\";\n var freenet = \"false\"; //only include wifi known free to public?\n\n msg.payload = {\n \"lat1\": String(parseFloat(lat[0])),\n \"lat2\": String(parseFloat(lat[3])),\n \"lon1\": String(parseFloat(lon[0])),\n \"lon2\": String(parseFloat(lon[3])),\n \"results\": results,\n \"variance\": variance,\n \"earliest\": earliest\n };\n node.send(msg);\n} else {\n return null;\n};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 830,
"y": 560,
"wires": [
[
"a943f211596333a9",
"abae6a374448a3c6"
]
]
},
{
"id": "a943f211596333a9",
"type": "http request",
"z": "039de8c509054630",
"name": "http req",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.wigle.net/api/v2/network/search?onlymine=false¬mine=true&latrange1={{{payload.lat1}}}&latrange2={{{payload.lat2}}}&longrange1={{{payload.lon1}}}&longrange2={{{payload.lon2}}}&startTransID={{{payload.earliest}}}&encryption=None&freenet={{{payload.freenet}}}&paynet=false&variance={{{payload.variance}}}&resultsPerPage={{{payload.results}}}",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [
{
"keyType": "Authorization",
"keyValue": "",
"valueType": "other",
"valueValue": "\"Basic QUlEABR6UODVP7wm4FGs4VB6o1XAPdW3VBsZ7Nzc3YzU5OTc=\""
}
],
"x": 1360,
"y": 560,
"wires": [
[
"63cf75369e67b6cc",
"919d7ccb16866592"
]
]
},
{
"id": "63cf75369e67b6cc",
"type": "debug",
"z": "039de8c509054630",
"name": "debug http2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1530,
"y": 660,
"wires": []
},
{
"id": "919d7ccb16866592",
"type": "function",
"z": "039de8c509054630",
"name": "wigle json (APs)",
"func": "var newMsg;\nvar freq;\nconst short = 10000;\nconst uno = 60 * 1000;\nconst cinco = 5 * 60 * 1000;\nconst diez = 2 * cinco;\nconst stale = new Date(Date.now() + uno).toISOString();\n\nfor (var i = 0; i < msg.payload.results.length; i++) {\n var lat = String(msg.payload.results[i].trilat);\n var lon = String(msg.payload.results[i].trilong);\n var name = msg.payload.results[i].ssid;\n var uuid = msg.payload.results[i].netid;\n var color = \"-16776961\" //blue\n var ssid = \"SSID: \" + msg.payload.results[i].ssid;\n var qos = \", QoS: \" + msg.payload.results[i].qos;\n var firstSeen = \", First Seen: \" + msg.payload.results[i].firsttime;\n var lastSeen = \", Last Seen: \" + msg.payload.results[i].firsttime;\n var mac = \", MAC: \" + msg.payload.results[i].netid;\n var type = \", Type: \" + msg.payload.results[i].type;\n var channel = \", Channel: \" + msg.payload.results[i].channel;\n if (msg.payload.results[i].channel <= 14) {\n freq = \", Frequency: 2.4GHz\";\n } else {\n freq = \", Frequency: 5GHz\";\n };\n var encryption = \", Encryption: \" + msg.payload.results[i].encryption;\n var address = \", Address: \" + msg.payload.results[i].housenumber + \" \" + msg.payload.results[i].road + \", \" + msg.payload.results[i].city + \", \" + msg.payload.results[i].region + \", \" + msg.payload.results[i].postalcode;\n var data = String(ssid + mac + freq + channel + type + encryption + qos + firstSeen + lastSeen + address);\n\n newMsg = {\n \"payload\": {\n \"event\": {\n \"_attributes\": {\n \"version\": \"2.0\",\n \"uid\": \"\"+ uuid +\"\",\n \"type\": \"b-m-p-s-m\",\n \"how\": \"h-g-i-g-o\",\n \"time\": new Date(Date.now()).toISOString(),\n \"start\": new Date(Date.now()).toISOString(),\n \"stale\": stale,\n },\n \"point\": {\n \"_attributes\": {\n \"lat\": \"\"+ lat +\"\",\n \"lon\": \"\"+ lon + \"\",\n \"hae\": \"0.0\",\n \"ce\": \"9999999.0\",\n \"le\": \"9999999.0\"\n }\n },\n \"detail\": {\n \"usericon\": {\n \"_attributes\": {\n \"iconsetpath\": \"COT_MAPPING_SPOTMAP/b-m-p-s-m/\"+ color +\"\",\n },\n },\n \"remarks\": {\n \"_text\": data,\n },\n \"contact\": {\n \"_attributes\": {\n \"callsign\": \"\"+ name +\"\",\n }\n },\n \"color\": {\n \"_attributes\": {\n \"argb\": \"\"+ color +\"\",\n },\n },\n }\n }\n }\n }\n node.send(newMsg);\n}\n//return msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1580,
"y": 560,
"wires": [
[
"60c8901c9b15f387",
"5fd339d4e9fac863"
]
]
},
{
"id": "abae6a374448a3c6",
"type": "debug",
"z": "039de8c509054630",
"name": "debug filter2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 990,
"y": 660,
"wires": []
},
{
"id": "5fd339d4e9fac863",
"type": "debug",
"z": "039de8c509054630",
"name": "debug json2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1770,
"y": 660,
"wires": []
},
{
"id": "a652c51409eef16d",
"type": "comment",
"z": "039de8c509054630",
"name": "configure TCP (TAKServer)",
"info": "if using SSL/TLS ensure you upload your certificates, key and input your passphrase.\nCertificates (.pem) and key (.key) can be found in your TAKServers directory where it stores all TAK client certificates.\nDefualt SSL/TLS port is 8089.\n",
"x": 350,
"y": 200,
"wires": []
},
{
"id": "d65d971abac0fcb8",
"type": "comment",
"z": "039de8c509054630",
"name": "configure TCP (TAKServer)",
"info": "if using SSL/TLS ensure you upload your certificates, key and input your passphrase.\nCertificates (.pem) and key (.key) can be found in your TAKServers directory where it stores all TAK client certificates.\nDefualt SSL/TLS port is 8089.\n",
"x": 1990,
"y": 400,
"wires": []
},
{
"id": "a47603aa4bd3be65",
"type": "udp in",
"z": "039de8c509054630",
"name": "",
"iface": "",
"port": "6969",
"ipv": "udp4",
"multicast": "true",
"group": "239.2.3.1",
"datatype": "utf8",
"x": 350,
"y": 300,
"wires": [
[]
]
},
{
"id": "739211902b8e7b98",
"type": "udp in",
"z": "039de8c509054630",
"name": "udp 239.2.3.1:6969 (ZT)",
"iface": "",
"port": "6969",
"ipv": "udp4",
"multicast": "true",
"group": "239.2.3.1",
"datatype": "buffer",
"x": 340,
"y": 360,
"wires": [
[]
]
},
{
"id": "d044a12899db40c3",
"type": "comment",
"z": "039de8c509054630",
"name": "if using ZeroTier over UDP connect the \"udp (ZT)\" ",
"info": "",
"x": 370,
"y": 420,
"wires": []
},
{
"id": "d74c0b5a4ee274b2",
"type": "function",
"z": "039de8c509054630",
"name": "filter data cellular (ZT)",
"func": "var callsign = msg.payload.cotEvent.detail.contact.callsign;\nif (callsign === \"Cellular\" || callsign === \"CELLULAR\" || callsign === \"cellular\") {\n\n msg.part = 1;\n msg.payload = {\n \"callsign\": callsign\n };\n node.send(msg);\n} else {\n return null;\n};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 860,
"y": 340,
"wires": [
[
"bb68172880e3d050"
]
]
},
{
"id": "bb68172880e3d050",
"type": "join",
"z": "039de8c509054630",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1110,
"y": 340,
"wires": [
[
"069220eb48dad3dd"
]
]
},
{
"id": "14d33edd3c2b40f7",
"type": "function",
"z": "039de8c509054630",
"name": "f",
"func": "msg.part = 2;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 380,
"wires": [
[
"c6778236d3abf5ca"
]
]
},
{
"id": "6f817d83c48a1c6d",
"type": "debug",
"z": "039de8c509054630",
"name": "debug 36",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 780,
"y": 180,
"wires": []
},
{
"id": "1b01bd44f60505e7",
"type": "html",
"z": "039de8c509054630",
"name": "",
"property": "payload.cotEvent.detail.xmlDetail",
"outproperty": "payload",
"tag": "link",
"ret": "attr",
"as": "single",
"x": 810,
"y": 380,
"wires": [
[
"14d33edd3c2b40f7"
]
]
},
{
"id": "069220eb48dad3dd",
"type": "function",
"z": "039de8c509054630",
"name": "f",
"func": "var callsign = msg.payload[0].callsign;\nvar coord1 = msg.payload[1][0].point.split(\",\");\nvar coord2 = msg.payload[1][1].point.split(\",\");\nvar coord3 = msg.payload[1][2].point.split(\",\");\nvar coord4 = msg.payload[1][3].point.split(\",\");\nvar lat = [coord1[0], coord2[0], coord3[0], coord4[0]];\nvar lon = [coord1[1], coord2[1], coord3[1], coord4[1]];\n lat.sort(function(a,b){\n return a - b;\n });\n lon.sort(function (a, b) {\n return a - b;\n });\n\n var results = 50;\n var variance = 0.001;\n var earliest = \"20230101-00000\";\n\n msg.payload = {\n \"lat1\": String(parseFloat(lat[0])),\n \"lat2\": String(parseFloat(lat[3])),\n \"lon1\": String(parseFloat(lon[0])),\n \"lon2\": String(parseFloat(lon[3])),\n \"results\": results,\n \"variance\": variance,\n \"earliest\": earliest\n};\nnode.send(msg);",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1230,
"y": 340,
"wires": [
[
"2f2a6e6e0ee881cc"
]
]
},
{
"id": "c6778236d3abf5ca",
"type": "delay",
"z": "039de8c509054630",
"name": "d",
"pauseType": "delay",
"timeout": "100",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1050,
"y": 380,
"wires": [
[
"bb68172880e3d050"
]
]
},
{
"id": "2a51209568c61a36",
"type": "function",
"z": "039de8c509054630",
"name": "filter data wifi (ZT)",
"func": "var callsign = msg.payload.cotEvent.detail.contact.callsign;\nif (callsign === \"wifi\" || callsign === \"WIFI\" || callsign === \"Wifi\" || callsign === \"WiFi\") {\n //config parameters if needed\n\n msg.part = 1;\n msg.payload = {\n \"callsign\": callsign\n };\n node.send(msg);\n} else {\n return null;\n};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 850,
"y": 520,
"wires": [
[
"0c64e1c02db0c65f"
]
]
},
{
"id": "0c4816754117e0a8",
"type": "function",
"z": "039de8c509054630",
"name": "f",
"func": "msg.part = 2;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 480,
"wires": [
[
"f042021ca1869d28"
]
]
},
{
"id": "32c3e7b31e5f9c54",
"type": "html",
"z": "039de8c509054630",
"name": "",
"property": "payload.cotEvent.detail.xmlDetail",
"outproperty": "payload",
"tag": "link",
"ret": "attr",
"as": "single",
"x": 810,
"y": 480,
"wires": [
[
"0c4816754117e0a8"
]
]
},
{
"id": "f042021ca1869d28",
"type": "delay",
"z": "039de8c509054630",
"name": "d",
"pauseType": "delay",
"timeout": "100",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1050,
"y": 480,
"wires": [
[
"0c64e1c02db0c65f"
]
]
},
{
"id": "0c64e1c02db0c65f",
"type": "join",
"z": "039de8c509054630",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1110,
"y": 520,
"wires": [
[
"8e72ba368eab6999"
]
]
},
{
"id": "8e72ba368eab6999",
"type": "function",
"z": "039de8c509054630",
"name": "f",
"func": "var callsign = msg.payload[0].callsign;\nvar coord1 = msg.payload[1][0].point.split(\",\");\nvar coord2 = msg.payload[1][1].point.split(\",\");\nvar coord3 = msg.payload[1][2].point.split(\",\");\nvar coord4 = msg.payload[1][3].point.split(\",\");\nvar lat = [coord1[0], coord2[0], coord3[0], coord4[0]];\nvar lon = [coord1[1], coord2[1], coord3[1], coord4[1]];\n lat.sort(function(a,b){\n return a - b;\n });\n lon.sort(function (a, b) {\n return a - b;\n });\n\nvar results = 50;\nvar variance = 0.001;\nvar earliest = \"20230101-00000\";\nvar freenet = \"false\"; //only include wifi known free to public?\n\n msg.payload = {\n \"lat1\": String(parseFloat(lat[0])),\n \"lat2\": String(parseFloat(lat[3])),\n \"lon1\": String(parseFloat(lon[0])),\n \"lon2\": String(parseFloat(lon[3])),\n \"results\": results,\n \"variance\": variance,\n \"earliest\": earliest,\n \"freenet\": freenet\n};\nnode.send(msg);",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1230,
"y": 520,
"wires": [
[
"a943f211596333a9"
]
]
},
{
"id": "b19f8430818d35be",
"type": "comment",
"z": "039de8c509054630",
"name": "configure both http req",
"info": "https://wigle.net/account\n\nusername = your API name\npassword = your API token\nauthorization header = \"Basic \" followed by your encoded for use token",
"x": 1320,
"y": 260,
"wires": []
},
{
"id": "1c52b35895c06e7e",
"type": "tls-config",
"name": "node-red to takserver",
"cert": "",
"key": "",
"ca": "",
"certname": "node-red.pem",
"keyname": "node-red.key",
"caname": "ca.pem",
"servername": "",
"verifyservercert": false,
"alpnprotocol": ""
}
]