diff options
author | krakenrf <78108016+krakenrf@users.noreply.github.com> | 2022-10-12 10:55:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 10:55:13 +0200 |
commit | b1f498cf8c22020d26d4e3051c69025ac98ba315 (patch) | |
tree | c05b7a5262f66f17204a315be9f5c8459a7021ad /misc_scripts | |
parent | Update krakensdr_x86_install_doa_pr.sh (diff) | |
download | krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar.gz krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar.bz2 krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar.lz krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar.xz krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.tar.zst krakensdr_docs-b1f498cf8c22020d26d4e3051c69025ac98ba315.zip |
Diffstat (limited to 'misc_scripts')
-rw-r--r-- | misc_scripts/sondehub_krakenmap.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/misc_scripts/sondehub_krakenmap.py b/misc_scripts/sondehub_krakenmap.py new file mode 100644 index 0000000..e5698a3 --- /dev/null +++ b/misc_scripts/sondehub_krakenmap.py @@ -0,0 +1,32 @@ +# Uses the SondeHub API to gather data about a sonde, and upload it to the krakenrf web mapper. It will show up on the map as a moving beacon. +# Useful for testing tracking of a moving object +# Note that if the elevation angle between the antenna array and sonde is >45deg, direction finding results will be poor. + +# Requires "pip install sondehub" + +import sondehub +import requests + +API_SERVER = 'https://map.krakenrf.com:8842' + +login = {'username': 'username', 'password': 'password'} + +x = requests.post(API_SERVER + '/login', json = login) +token = x.text + +#print(x.text) + +def on_message(message): + beaconData = {'lat': message['lat'], 'lon': message['lon'], 'speed': 0, 'height': message['alt']} + x = requests.post(API_SERVER + '/beacon', json = beaconData, headers = {'Authorization': token}) + #print(x.text) + #print(message['lat']) + #print(message['lon']) + #print(message['alt']) + +# Set sondes to whatever active sonde you want +test = sondehub.Stream(on_message=on_message, sondes=["U1140595"]) + +while 1: + pass + |