Skip to content

Instantly share code, notes, and snippets.

@unixweb
Last active November 20, 2017 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unixweb/31b3982090de07c924af158428027d29 to your computer and use it in GitHub Desktop.
Save unixweb/31b3982090de07c924af158428027d29 to your computer and use it in GitHub Desktop.
Satellite Tracking with Node-Red
[{"id":"3032c892.f64c88","type":"change","z":"714cf6f5.79bd2","name":"... to \"ISS\"","rules":[{"t":"set","p":"payload","pt":"flow","to":"ISS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":435,"y":393,"wires":[[]]},{"id":"65fd3912.8c08f8","type":"inject","z":"714cf6f5.79bd2","name":"Set flow.payload ...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":171,"y":392,"wires":[["3032c892.f64c88"]]},{"id":"6cca73f6.c2f5dc","type":"inject","z":"714cf6f5.79bd2","name":"Set flow.payload ...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":168,"y":447,"wires":[["e4611412.f78248"]]},{"id":"e4611412.f78248","type":"change","z":"714cf6f5.79bd2","name":"... to \"AGGIESAT\"","rules":[{"t":"set","p":"payload","pt":"flow","to":"AGGIESAT","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":447,"y":448,"wires":[[]]},{"id":"368e42a7.a7ee3e","type":"change","z":"714cf6f5.79bd2","name":"... to \"CUBESAT\"","rules":[{"t":"set","p":"payload","pt":"flow","to":"CUBESAT","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":458,"y":505,"wires":[[]]},{"id":"93602a7c.e54358","type":"inject","z":"714cf6f5.79bd2","name":"Set flow.payload ...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":166,"y":505,"wires":[["368e42a7.a7ee3e"]]},{"id":"10e9af40.448211","type":"inject","z":"714cf6f5.79bd2","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"x":119,"y":143,"wires":[["d61890c7.7cf92","3c20f95f.6b7b9e","d05678d3.050698","bb1961aa.d64e9"]]},{"id":"d61890c7.7cf92","type":"timearray","z":"714cf6f5.79bd2","plus":"20","minus":"20","samples":"40","name":"","x":332,"y":92,"wires":[["3c20f95f.6b7b9e","d05678d3.050698","bb1961aa.d64e9"]]},{"id":"3c20f95f.6b7b9e","type":"satellite","z":"714cf6f5.79bd2","satid":"ISS","tle1":"1 25544U 98067A 17322.24806701 .00004090 00000-0 68891-4 0 9992","tle2":"2 25544 51.6417 350.3065 0004386 126.8467 335.8607 15.54174693 85711","name":"ISS","x":439,"y":142,"wires":[["9be6f107.69bc"]]},{"id":"d05678d3.050698","type":"satellite","z":"714cf6f5.79bd2","satid":"AGGIESAT 4","tle1":"1 41313U 98067HP 17321.39339956 .00077618 00000-0 29625-3 0 9999","tle2":"2 41313 51.6360 290.4570 0004888 57.8339 302.3139 15.86798133103135","name":"AGGIESAT 4","x":392,"y":195,"wires":[["cfc79843.8e6148"]]},{"id":"bb1961aa.d64e9","type":"satellite","z":"714cf6f5.79bd2","satid":"CUBESAT XI-IV (CO-57)","tle1":"1 27848U 03031J 17321.92467202 .00000072 00000-0 52684-4 0 9990","tle2":"2 27848 98.6984 329.0161 0008622 273.1642 86.8549 14.21685122746010","name":"CUBESAT XI-IV (CO-57)","x":357,"y":255,"wires":[["6dc9bc97.3e5c44"]]},{"id":"6dc9bc97.3e5c44","type":"and-gate","z":"714cf6f5.79bd2","name":"","rules":[{"t":"regex","v":"CUBESAT","vt":"str","case":false,"propertyType":"flow","property":"payload"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":587,"y":255,"wires":[["26e5001b.97d468"]]},{"id":"cfc79843.8e6148","type":"and-gate","z":"714cf6f5.79bd2","name":"","rules":[{"t":"regex","v":"AGGIESAT","vt":"str","case":false,"propertyType":"flow","property":"payload"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":591,"y":196,"wires":[["26e5001b.97d468"]]},{"id":"9be6f107.69bc","type":"and-gate","z":"714cf6f5.79bd2","name":"","rules":[{"t":"regex","v":"ISS","vt":"str","case":false,"propertyType":"flow","property":"payload"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":599,"y":141,"wires":[["26e5001b.97d468"]]},{"id":"26e5001b.97d468","type":"switch","z":"714cf6f5.79bd2","name":"","property":"payload.length","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":764,"y":193,"wires":[["edd49800.c700f"],["96bbcee8.b64cb"]]},{"id":"edd49800.c700f","type":"function","z":"714cf6f5.79bd2","name":"Convert to Path","func":"var path = [];\n\nfor (var i=0; i<msg.payload.length; i++) {\n path.push([msg.payload[i].position.lat, msg.payload[i].position.lon])\n}\n\nmsg.payload = {\n name : 'ISS Route',\n line : path\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":912,"y":146,"wires":[["a6859c3f.af55b8"]]},{"id":"96bbcee8.b64cb","type":"function","z":"714cf6f5.79bd2","name":"Convert to Point","func":"var sat = msg.payload;\n\nmsg.payload = {\n name: sat.name,\n icon: \"fa-space-shuttle\",\n iconColor: \"blue\",\n lat: sat.position.lat, \n lon: sat.position.lon, \n alt: parseInt(sat.position.alt)/1000 + 'km'\n}\nreturn msg;","outputs":1,"noerr":0,"x":903,"y":244,"wires":[["a6859c3f.af55b8"]]},{"id":"a6859c3f.af55b8","type":"worldmap","z":"714cf6f5.79bd2","name":"","lat":"","lon":"","zoom":"","layer":"Nat Geo","cluster":"","maxage":"5","usermenu":"show","layers":"show","panit":"false","x":1102,"y":193,"wires":[]}]
@unixweb
Copy link
Author

unixweb commented Nov 18, 2017

This Node-Red Flow have dependencies:

  1. npm install node-red-contrib-satellites
  2. npm install node-red-contrib-web-worldmap
  3. npm install node-red-contrib-bool-gate

Open the Map with:
http://Node-Red-IP-Address:1880/worldmap/

Update for Tracking Datas, please get here:
https://www.celestrak.com/NORAD/elements/amateur.txt

@unixweb
Copy link
Author

unixweb commented Nov 18, 2017

bildschirmfoto 2017-11-18 um 13 11 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment