summaryrefslogtreecommitdiffstats
path: root/misc_scripts
diff options
context:
space:
mode:
authorkrakenrf <78108016+krakenrf@users.noreply.github.com>2022-10-23 06:06:31 +0200
committerGitHub <noreply@github.com>2022-10-23 06:06:31 +0200
commita904f7fd2ad92965d26600a1f09c3950ebfe3178 (patch)
tree96a31b36a33239dcf1516a421dec23d1fa46383d /misc_scripts
parentCreate gpsd_tracker_krakenmap.py (diff)
downloadkrakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar.gz
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar.bz2
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar.lz
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar.xz
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.tar.zst
krakensdr_docs-a904f7fd2ad92965d26600a1f09c3950ebfe3178.zip
Diffstat (limited to 'misc_scripts')
-rw-r--r--misc_scripts/dump1090_krakenmap.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc_scripts/dump1090_krakenmap.py b/misc_scripts/dump1090_krakenmap.py
new file mode 100644
index 0000000..e34962d
--- /dev/null
+++ b/misc_scripts/dump1090_krakenmap.py
@@ -0,0 +1,35 @@
+import requests
+import json
+import time
+
+# The unique ICAO ID of the aircraft in HEX. Ensure it is LOWERCASE.
+HEX_ID = "c822ed"
+
+API_SERVER = 'https://map.krakenrf.com:443'
+
+# Your Kraken Pro Cloud username and password
+login = {'username': 'username', 'password': 'password'}
+
+x = requests.post(API_SERVER + '/login', json = login)
+token = x.text
+
+print(x.text)
+
+while True:
+ f = open('aircraft.json')
+ data = json.load(f)
+
+ for aircraft in data['aircraft']:
+# print(aircraft['hex'])
+ if aircraft['hex'] == HEX_ID:
+ try:
+ beaconData = {'lat': aircraft['lat'], 'lon': aircraft['lon'], 'speed': aircraft['gs'], 'height': aircraft['alt_geom']}
+ x = requests.post(API_SERVER + '/beacon', json = beaconData, headers = {'Authorization': token})
+
+ print (aircraft['lat'])
+ print (aircraft['lon'])
+ except:
+ print('EXCEPTION: Probably out of range')
+ pass #
+
+ time.sleep(1)