From f5d40dae0077e7096fe901ff174b1367cbfe3497 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 14 Jun 2021 09:05:26 -0400 Subject: [PATCH] added system exec of sed commands --- groundstation/loc-add-foxtelem.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 451b9273..6fdf3b5d 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -3,9 +3,10 @@ # copy or rename to loc-foxtelem.py and add api key import requests +from os import system URL = "https://geocode.search.hereapi.com/v1/geocode" -print("In order to upload your satellite telemetry data to the AMSAT servers, we need to know your location\n") +print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location\n") print("Enter your location including country. \n\n") location = input("Type your location: ") #taking user input api_key = '' # Acquire from developer.here.com @@ -25,8 +26,13 @@ print(longitude) #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -latSedStr = 'sed -i "s/latitude=0.0/latitude=' $grid + str(latitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' -print (latSedStr) +latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' +#print (latSedStr) +system(latSedStr) + +longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' +#print (longSedStr) +system(longSedStr) + +print("\nFoxTelem configuration updated with your latitude and longitude") -longSedStr = 'sed -i "s/longitude=0.0/longitude=' $grid + str(longitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' -print (longSedStr)