From 1d3f0d4e6f42275fa40649b1daa1fc25421fac3c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 09:50:13 -0400 Subject: [PATCH 01/99] restored from earlier commit --- groundstation/fox-startup.sh | 74 ++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index a0ade800..822d2b32 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -1,14 +1,82 @@ #!/bin/bash # script to run FoxTelem -echo "Script to run FoxTelem for ARISS Radio Pi" +echo "Startup script to run FoxTelem for ARISS Radio Pi" echo +FILE=/home/pi/CubeSatSim/groundstation/.profile +if [ ! -f "$FILE" ]; then + echo "You need to choose your default FoxTelem profile." + echo + echo "The choices are:" + echo + echo "1. Fox-in-a-Box. Use this profile if you want to receive and decode telemetry from the AMSAT Fox satellites. If you enter a callsign and a grid square, you can upload to the AMSAT telemetry server." + echo + echo "2. CubeSatSim Ground Station. Use this profile if you want to receive and decode telemetry from an AMSAT CubeSatSim or CubeSatSim Lite." + echo + echo "Which profile do choose? Enter 1 or 2" + + read -r ANS -sudo killall -9 foxtelem &>/dev/null + if [ "$ANS" = "1" ]; then -/home/pi/Downloads/FoxTelem/FoxTelem & + echo "You have chosen the Fox-in-a-Box profile." + echo "b" > /home/pi/CubeSatSim/groundstation/.profile + echo + + echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" + read callsign + sudo sed -i "s/callsign=NONE/callsign=$callsign/g" /home/pi/Documents/FITB/FoxTelem.properties + echo + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/Documents/FITB/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/Documents/FITB/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/Documents/FITB/FoxTelem.properties + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/Documents/FITB/FoxTelem.properties + + sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/Documents/FITB/FoxTelem.properties + + sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/Documents/FITB/FoxTelem.properties # change to FunCube + + + python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py + +# echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" +# read grid +# sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties +# echo + elif [ "$ANS" = "2" ]; then + + echo "You have chosen the CubeSatSim Ground Station profile." + echo "c" > /home/pi/CubeSatSim/groundstation/.profile + + else + + echo "Please enter only 1 or 2" + + fi + +fi + +value=`cat /home/pi/CubeSatSim/groundstation/.profile` +echo "$value" > /dev/null +set -- $value + +sudo killall -9 java &>/dev/null + +if [ "$1" = "c" ]; then + echo "CubeSatSim Ground Station profile is set!" + echo + /home/pi/Downloads/FoxTelem/FoxTelem & +else + echo "Fox-in-a-box profile is set!" + echo + /home/pi/Downloads/FoxTelem-FITB/FoxTelem /home/pi/Documents/FITB +fi $SHELL From 6f8217223f8b6a76fce82670a9d8f844727ba6ba Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 21:44:58 -0400 Subject: [PATCH 02/99] changed locations of files to match FIAB v2 --- groundstation/fox-startup.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 822d2b32..9ca3b77c 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -1,7 +1,7 @@ #!/bin/bash # script to run FoxTelem -echo "Startup script to run FoxTelem for ARISS Radio Pi" +echo "Startup script to run FoxTelem for FIAB v3" echo @@ -22,25 +22,25 @@ if [ ! -f "$FILE" ]; then if [ "$ANS" = "1" ]; then echo "You have chosen the Fox-in-a-Box profile." - echo "b" > /home/pi/CubeSatSim/groundstation/.profile + echo "b" > /home/pi/.profile echo echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" read callsign - sudo sed -i "s/callsign=NONE/callsign=$callsign/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/callsign=NONE/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties echo - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryDataFoxTelem.properties - sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/Documents/FITB/FoxTelem.properties + sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/Documents/FITB/FoxTelem.properties # change to FunCube + sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py @@ -53,7 +53,7 @@ if [ ! -f "$FILE" ]; then elif [ "$ANS" = "2" ]; then echo "You have chosen the CubeSatSim Ground Station profile." - echo "c" > /home/pi/CubeSatSim/groundstation/.profile + echo "c" > /home/pi/.profile else @@ -63,7 +63,7 @@ if [ ! -f "$FILE" ]; then fi -value=`cat /home/pi/CubeSatSim/groundstation/.profile` +value=`cat /home/pi/.profile` echo "$value" > /dev/null set -- $value @@ -72,11 +72,11 @@ sudo killall -9 java &>/dev/null if [ "$1" = "c" ]; then echo "CubeSatSim Ground Station profile is set!" echo - /home/pi/Downloads/FoxTelem/FoxTelem & + /home/pi/CubeSatSim/groundstation/fox.sh else echo "Fox-in-a-box profile is set!" echo - /home/pi/Downloads/FoxTelem-FITB/FoxTelem /home/pi/Documents/FITB + /home/pi/Desktop/FoxTelem_1.11b_linux /home/pi/FoxTelemetryData fi $SHELL From e89285f9acaa42493bf53e799e4d425a40043a8e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 22:01:13 -0400 Subject: [PATCH 03/99] fixed FoxTelem --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 9ca3b77c..3902b0b9 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -76,7 +76,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/Desktop/FoxTelem_1.11b_linux /home/pi/FoxTelemetryData + /home/pi/Desktop/FoxTelem_1.11b_linux/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From c9727229ab82f7e7a4ecea81529ca2b3c1ca2341 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 22:05:18 -0400 Subject: [PATCH 04/99] put .profile in FoxTelemetryData --- groundstation/fox-startup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 3902b0b9..6f1aafab 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -22,7 +22,7 @@ if [ ! -f "$FILE" ]; then if [ "$ANS" = "1" ]; then echo "You have chosen the Fox-in-a-Box profile." - echo "b" > /home/pi/.profile + echo "b" > /home/pi/FoxTelemetryData/.profile echo echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" @@ -53,7 +53,7 @@ if [ ! -f "$FILE" ]; then elif [ "$ANS" = "2" ]; then echo "You have chosen the CubeSatSim Ground Station profile." - echo "c" > /home/pi/.profile + echo "c" > /home/pi/FoxTelemetryData/.profile else @@ -63,7 +63,7 @@ if [ ! -f "$FILE" ]; then fi -value=`cat /home/pi/.profile` +value=`cat /home/pi/FoxTelemetryData/.profile` echo "$value" > /dev/null set -- $value From e073f6f68aeeb1bc03cbfbed26c7592eb5d88459 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 22:06:00 -0400 Subject: [PATCH 05/99] changed to .foxprofile --- groundstation/fox-startup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 6f1aafab..6159a243 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -5,7 +5,7 @@ echo "Startup script to run FoxTelem for FIAB v3" echo -FILE=/home/pi/CubeSatSim/groundstation/.profile +FILE=/home/pi/CubeSatSim/groundstation/.foxprofile if [ ! -f "$FILE" ]; then echo "You need to choose your default FoxTelem profile." echo @@ -22,7 +22,7 @@ if [ ! -f "$FILE" ]; then if [ "$ANS" = "1" ]; then echo "You have chosen the Fox-in-a-Box profile." - echo "b" > /home/pi/FoxTelemetryData/.profile + echo "b" > /home/pi/FoxTelemetryData/.foxprofile echo echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" @@ -53,7 +53,7 @@ if [ ! -f "$FILE" ]; then elif [ "$ANS" = "2" ]; then echo "You have chosen the CubeSatSim Ground Station profile." - echo "c" > /home/pi/FoxTelemetryData/.profile + echo "c" > /home/pi/FoxTelemetryData/.foxprofile else @@ -63,7 +63,7 @@ if [ ! -f "$FILE" ]; then fi -value=`cat /home/pi/FoxTelemetryData/.profile` +value=`cat /home/pi/FoxTelemetryData/.foxprofile` echo "$value" > /dev/null set -- $value From b0bac4f7a9dc46e6b1045891a38f7799874562dc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 22:07:30 -0400 Subject: [PATCH 06/99] missing / --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 6159a243..9f1d895a 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -32,7 +32,7 @@ if [ ! -f "$FILE" ]; then sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryDataFoxTelem.properties + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties From a7710df29178e38f3f61522122217db09d8fc0bd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 1 Jul 2021 22:14:20 -0400 Subject: [PATCH 07/99] fixed .foxprofile check --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 9f1d895a..ca00e916 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -5,7 +5,7 @@ echo "Startup script to run FoxTelem for FIAB v3" echo -FILE=/home/pi/CubeSatSim/groundstation/.foxprofile +FILE=/home/pi/FoxTelemetryData/.foxprofile if [ ! -f "$FILE" ]; then echo "You need to choose your default FoxTelem profile." echo From 2f7d610d5b070e1454e18de078b3478d23fb0bd8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 08:55:46 -0400 Subject: [PATCH 08/99] changed to fox-startup.sh --- groundstation/foxtelem.desktop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index 59a186c7..bb70c183 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Type=Application -Exec=/home/pi/CubeSatSim/groundstation/fox.sh +Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh Name=FoxTelem -Comment=Test Version 1.09 for CubeSatSim +Comment=FIAB-v3 Icon=/home/pi/Downloads/foxtelem.png Path=/home/pi #Terminal=true From 9844bd8ac8b4760dcdc3517191a7e970f523bd80 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 08:58:13 -0400 Subject: [PATCH 09/99] changed to fox-startup.sh --- groundstation/foxtelem.desktop.autostart.bk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/foxtelem.desktop.autostart.bk b/groundstation/foxtelem.desktop.autostart.bk index 6b24d049..f8a8c54e 100644 --- a/groundstation/foxtelem.desktop.autostart.bk +++ b/groundstation/foxtelem.desktop.autostart.bk @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application Name=FoxTelem -Exec=/home/pi/CubeSatSim/groundstation/fox.sh +Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh From 7a24094b7ffaa97ae36efff1339763bc5535a7c7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:01:29 -0400 Subject: [PATCH 10/99] moved --- groundstation/autostart/foxtelem.desktop | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 groundstation/autostart/foxtelem.desktop diff --git a/groundstation/autostart/foxtelem.desktop b/groundstation/autostart/foxtelem.desktop new file mode 100644 index 00000000..f8a8c54e --- /dev/null +++ b/groundstation/autostart/foxtelem.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=FoxTelem +Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh From 1d2305a78d1be17a1208ca19f613170c65dafd08 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:02:44 -0400 Subject: [PATCH 11/99] moved --- groundstation/autostart/chromium.desktop | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 groundstation/autostart/chromium.desktop diff --git a/groundstation/autostart/chromium.desktop b/groundstation/autostart/chromium.desktop new file mode 100644 index 00000000..fc57834e --- /dev/null +++ b/groundstation/autostart/chromium.desktop @@ -0,0 +1,5 @@ + +[Desktop Entry] +Type=Application +Name=Chromium with WebSDR +Exec=chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 From b93d717ce65e762e903363fc46baf2dd8fc5ebeb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:03:31 -0400 Subject: [PATCH 12/99] Delete foxtelem.desktop.autostart.bk --- groundstation/foxtelem.desktop.autostart.bk | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 groundstation/foxtelem.desktop.autostart.bk diff --git a/groundstation/foxtelem.desktop.autostart.bk b/groundstation/foxtelem.desktop.autostart.bk deleted file mode 100644 index f8a8c54e..00000000 --- a/groundstation/foxtelem.desktop.autostart.bk +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Type=Application -Name=FoxTelem -Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh From 614ab9301decc921bbdef1089f292f4b4ab3565f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:24:27 -0400 Subject: [PATCH 13/99] Delete satnogs_readme.txt --- groundstation/satnogs_readme.txt | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 groundstation/satnogs_readme.txt diff --git a/groundstation/satnogs_readme.txt b/groundstation/satnogs_readme.txt deleted file mode 100644 index 21f0ef05..00000000 --- a/groundstation/satnogs_readme.txt +++ /dev/null @@ -1,19 +0,0 @@ -This image has the SatNOGS client pre installed. It allows you to join the Satellite Network Operators Group network: - -https://network.satnogs.org - -To join, all you have to do is follow the instructions starting at SatNOGS Client Setup - -https://wiki.satnogs.org/SatNOGS_Client_Ansible#SatNOGS_Client_Setup - -You will need to Sign Up and create an account: - -https://network.satnogs.org/login/auth0 - -Maybe include "ARISS" in your SatNOGS station name? For example: Joe's ARISS GS - -Once you have an account and have logged in, click on the upper right corner and select Dashboard. Click on the API Key button to copy and paste your API Key which you will need to configure using sudo satnogs-setup Basic Configuration SATNOGS_API_TOKEN - -Good luck and feel free to message me ku2y on SatNOGS! - - From 3af649f3dbdce4e080045a968c51ceac46e10890 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:31:42 -0400 Subject: [PATCH 14/99] include terminal --- groundstation/foxtelem.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/foxtelem.desktop b/groundstation/foxtelem.desktop index bb70c183..e8e5b548 100644 --- a/groundstation/foxtelem.desktop +++ b/groundstation/foxtelem.desktop @@ -5,6 +5,6 @@ Name=FoxTelem Comment=FIAB-v3 Icon=/home/pi/Downloads/foxtelem.png Path=/home/pi -#Terminal=true +Terminal=true Categories=HamRadio Keywords=Ham Radio;AMSAT From a8f36003a42f3fb736c55c908c3774077c9bbade Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:32:03 -0400 Subject: [PATCH 15/99] include terminal --- groundstation/autostart/foxtelem.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/autostart/foxtelem.desktop b/groundstation/autostart/foxtelem.desktop index f8a8c54e..b71a6436 100644 --- a/groundstation/autostart/foxtelem.desktop +++ b/groundstation/autostart/foxtelem.desktop @@ -1,4 +1,5 @@ [Desktop Entry] Type=Application Name=FoxTelem +Terminal=true Exec=/home/pi/CubeSatSim/groundstation/fox-startup.sh From d219526b9651a01f1358daba5d2d99330ce5a1e4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 09:41:22 -0400 Subject: [PATCH 16/99] added fox-startup.sh --- groundstation/autostart/autostart | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 groundstation/autostart/autostart diff --git a/groundstation/autostart/autostart b/groundstation/autostart/autostart new file mode 100644 index 00000000..2510c6e4 --- /dev/null +++ b/groundstation/autostart/autostart @@ -0,0 +1,5 @@ +@lxpanel --profile LXDE-pi +@pcmanfm --desktop --profile LXDE-pi +@lxterminal --command "/home/pi/CubeSatSim/groundstation/fox-startup.sh" +@xscreensaver -no-splash + From e497bea07aea0644f90a371e8dad140c71b24588 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 2 Jul 2021 17:46:38 -0400 Subject: [PATCH 17/99] initial add --- groundstation/fox-profile.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 groundstation/fox-profile.sh diff --git a/groundstation/fox-profile.sh b/groundstation/fox-profile.sh new file mode 100755 index 00000000..36ac8aa2 --- /dev/null +++ b/groundstation/fox-profile.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# script to change FoxTelem default profile + +echo "Script to change your default FoxTelem profile for FIAB v3" + +echo + +sudo rm /home/pi/FoxTelemetryData/.foxprofile + +/home/pi/CubeSatSim/groundstaton/fox-startup.sh + +$SHELL From e42474961411708a7a0da23411f67a2d3df5f090 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 17:49:40 -0400 Subject: [PATCH 18/99] Create fox-profile.desktop --- groundstation/fox-profile.desktop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 groundstation/fox-profile.desktop diff --git a/groundstation/fox-profile.desktop b/groundstation/fox-profile.desktop new file mode 100644 index 00000000..3fa99e7e --- /dev/null +++ b/groundstation/fox-profile.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Exec=/home/pi/CubeSatSim/groundstation/fox-profile.sh +Name=FoxTelem +Comment=FIAB-v3 +Icon=/home/pi/Downloads/foxtelem.png +Path=/home/pi +Terminal=true +Categories=HamRadio +Keywords=Ham Radio;AMSAT From 5e1318ea482d3448dad50cd7f2edda5497f47f5e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 17:50:36 -0400 Subject: [PATCH 19/99] Update fox-profile.desktop --- groundstation/fox-profile.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-profile.desktop b/groundstation/fox-profile.desktop index 3fa99e7e..c03f40d4 100644 --- a/groundstation/fox-profile.desktop +++ b/groundstation/fox-profile.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Exec=/home/pi/CubeSatSim/groundstation/fox-profile.sh -Name=FoxTelem +Name=Change FoxTelem Profile Comment=FIAB-v3 Icon=/home/pi/Downloads/foxtelem.png Path=/home/pi From 47646acda12f860ef91855a6f671e034263a3f3e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 17:53:30 -0400 Subject: [PATCH 20/99] typo --- groundstation/fox-profile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-profile.sh b/groundstation/fox-profile.sh index 36ac8aa2..be0074e4 100755 --- a/groundstation/fox-profile.sh +++ b/groundstation/fox-profile.sh @@ -7,6 +7,6 @@ echo sudo rm /home/pi/FoxTelemetryData/.foxprofile -/home/pi/CubeSatSim/groundstaton/fox-startup.sh +/home/pi/CubeSatSim/groundstation/fox-startup.sh $SHELL From 019c7a2a2ec9474628ac6f38a194ee0772f7c760 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 18:55:16 -0400 Subject: [PATCH 21/99] changed to FoxTelemetryData-CubeSatSim --- groundstation/fox.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index af7853b7..baf9e6af 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -21,8 +21,6 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null -/home/pi/Downloads/FoxTelem/FoxTelem & - -#/usr/bin/chromium-browser --noerrdialogs --disable-infobars http://localhost:8073 &>/dev/null & +/home/pi/Desktop/FoxTelem_1.11b_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From 0d3ae788a3ae8277c1cee8fd76824e5cad7fdb5d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 19:15:26 -0400 Subject: [PATCH 22/99] updated to /home/pi/FoxTelemetryData --- groundstation/loc-add-foxtelem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 6fdf3b5d..f95bf082 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -26,11 +26,11 @@ print(longitude) #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' +latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/home/pi/FoxTelemetryData/FoxTelem.properties' #print (latSedStr) system(latSedStr) -longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/Documents/FITB/FoxTelem.properties' +longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/home/pi/FoxTelemetryData/FoxTelem.properties' #print (longSedStr) system(longSedStr) From 314a15a62ca8decd2ab2433fef6ff89158df7247 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 19:18:44 -0400 Subject: [PATCH 23/99] typo --- groundstation/loc-add-foxtelem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index f95bf082..e867719f 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -26,11 +26,11 @@ print(longitude) #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/home/pi/FoxTelemetryData/FoxTelem.properties' +latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (latSedStr) system(latSedStr) -longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/home/pi/FoxTelemetryData/FoxTelem.properties' +longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (longSedStr) system(longSedStr) From c66ae7b5f67925b76f560e40e78ce70b6f7b79a6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 2 Jul 2021 21:20:15 -0400 Subject: [PATCH 24/99] kill FoxTelem at start --- groundstation/fox-startup.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index ca00e916..0f3b340f 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -5,6 +5,8 @@ echo "Startup script to run FoxTelem for FIAB v3" echo +sudo killall -9 FoxTelem &>/dev/null + FILE=/home/pi/FoxTelemetryData/.foxprofile if [ ! -f "$FILE" ]; then echo "You need to choose your default FoxTelem profile." @@ -39,10 +41,10 @@ if [ ! -f "$FILE" ]; then sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube - - + +# sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" From d058852703171c2fe87fee90fe178b8afc012071 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 10:16:44 -0400 Subject: [PATCH 25/99] copy profile before changing, set CubeSatSim settings --- groundstation/fox-startup.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 0f3b340f..c042a413 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -26,7 +26,9 @@ if [ ! -f "$FILE" ]; then echo "You have chosen the Fox-in-a-Box profile." echo "b" > /home/pi/FoxTelemetryData/.foxprofile echo - + + cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 + echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" read callsign sudo sed -i "s/callsign=NONE/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties @@ -56,7 +58,13 @@ if [ ! -f "$FILE" ]; then echo "You have chosen the CubeSatSim Ground Station profile." echo "c" > /home/pi/FoxTelemetryData/.foxprofile - + + cp /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties.0 + + sudo sed -i "s/useCostas=false/useCostas=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + + sudo sed -i "s/findSignal=false/findSignal=true/g" /home/pi/FoxTelemetryData-CubeSatSim/FoxTelem.properties + else echo "Please enter only 1 or 2" From 4a3cf22d22abd1a20396cd5eb0d67f24b8307209 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 14:50:21 -0400 Subject: [PATCH 26/99] updated to version 1.11c --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index baf9e6af..5b075d01 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -21,6 +21,6 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null -/home/pi/Desktop/FoxTelem_1.11b_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/Desktop/FoxTelem_1.11c_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From 50ad6b59a58555822650d81654cf316a063a4193 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 14:57:07 -0400 Subject: [PATCH 27/99] updated to 1.11c --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index c042a413..746cecbc 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -86,7 +86,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/Desktop/FoxTelem_1.11b_linux/FoxTelem /home/pi/FoxTelemetryData + /home/pi/Desktop/FoxTelem_1.11c_linux/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From d0446e975fe5efa5fa182e41d26e1a5c6b781b7b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 15:25:35 -0400 Subject: [PATCH 28/99] added auto switch bands (retuneCenterFrequency) --- groundstation/fox-startup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 746cecbc..84f192d8 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -44,6 +44,8 @@ if [ ! -f "$FILE" ]; then sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube From 82cfe9eac525b719f2e6c76885517a27c06d15a5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:01:42 -0400 Subject: [PATCH 29/99] changed to alasa audio device 3 instead of 2 --- groundstation/aprs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 15d9c2df..a0af0ea8 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -31,7 +31,7 @@ sleep 1 direwolf -t 0 & -rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 From 24d4585bc21df06bfd7ba5e8487dad030a38cee3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:02:04 -0400 Subject: [PATCH 30/99] changed 2 to 3 fora play --- groundstation/aprs-cubesatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 2b80439f..bd7cb933 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -32,7 +32,7 @@ sleep 1 direwolf -t 0 & #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 From f4fcdfd0cc6c4d91453c0b990df386cb1d7718dd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:03:03 -0400 Subject: [PATCH 31/99] changed aplay 2 to 3 --- groundstation/sstv_decode_sim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index f45754c3..c7e8b4ae 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -35,6 +35,6 @@ qsstv & #sudo systemctl restart cubesatsim -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From 9f53e7003b1d84e13e87e3cf2b219cdecc75af57 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:03:29 -0400 Subject: [PATCH 32/99] changed aplay 2 to 3 --- groundstation/sstv_decode_iss.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index dcf26181..bd0dc7fa 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -31,5 +31,5 @@ sudo killall -9 CubicSDR &>/dev/null qsstv & -rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From 8af09cad82d0353cbc28eff0ff482741a54fa5e0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:07:15 -0400 Subject: [PATCH 33/99] added sleep 5 after openwebrx restart before launching chromium --- groundstation/sdr.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index 46e8593e..bbdb5923 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -29,6 +29,8 @@ sudo systemctl stop rtl_tcp sudo systemctl restart openwebrx +sleep 5 + chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 &>/dev/null & $SHELL From a9ece0f51fca4c8159e9cb72e8bc857c72ebd3b3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 16:09:10 -0400 Subject: [PATCH 34/99] sleep 10 --- groundstation/sdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh index bbdb5923..27aa41c7 100755 --- a/groundstation/sdr.sh +++ b/groundstation/sdr.sh @@ -29,7 +29,7 @@ sudo systemctl stop rtl_tcp sudo systemctl restart openwebrx -sleep 5 +sleep 10 chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 &>/dev/null & From 8729989f6b660bab7f4b48a994ce98dcf536714d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 19:44:02 -0400 Subject: [PATCH 35/99] get location in grid or lat/long --- groundstation/loc-add-foxtelem.py | 69 +++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index e867719f..487b4928 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -4,26 +4,69 @@ import requests from os import system +import re + +latitude = 0 +longitude = 0 -URL = "https://geocode.search.hereapi.com/v1/geocode" 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 -PARAMS = {'apikey':api_key,'q':location} +print("\nYou can enter:") +print("1. Location name (e.g. country or city, state, etc)") +print("2. Grid square (e.g. FM29)") +print("3. Latitude and Longitude\n") +print("4. No location") + +choice = input ("Enter your choice (1 -4):") + +if (choice == 2): + regex = '[A-Z]+[A-Z]+[0-9]+[0-9]' + + grid = input("Type your 4 character grid square (i.e. FM29): ") + + if re.search(regex, grid): + print("grid is valid!") + else + print("grid is not valid!") + +elif (choice == 3): + + lat = input("Type your latitude: ") + try: + float(lat) + print("Valid number!") + except ValueError: + print("Not a number!") + long = input("Type your longitude: ") + try: + float(long) + print("Valid number!") + except ValueError: + print("Not a number!") +elif (choice == 1): + URL = "https://geocode.search.hereapi.com/v1/geocode" + + print("Enter your location including country. \n\n") + location = input("Type your location: ") #taking user input + api_key = '' # Acquire from developer.here.com + PARAMS = {'apikey':api_key,'q':location} -# sending get request and saving the response as response object -r = requests.get(url = URL, params = PARAMS) -data = r.json() + # sending get request and saving the response as response object + r = requests.get(url = URL, params = PARAMS) + data = r.json() -#print(data) + #print(data) -latitude = data['items'][0]['position']['lat'] -longitude = data['items'][0]['position']['lng'] + latitude = data['items'][0]['position']['lat'] + longitude = data['items'][0]['position']['lng'] -print(latitude) -print(longitude) + print(latitude) + print(longitude) +else: + print("You have chosen not to enter your location.") + print("To track satellites and upload telemetry data,") + print("you can set your location in Settings in FoxTelem.") + #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' From b7919497fc0f2ba98b7952d2ccf99e6a0f6b036d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 19:45:50 -0400 Subject: [PATCH 36/99] typo --- groundstation/loc-add-foxtelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 487b4928..1b1ff1de 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -25,7 +25,7 @@ if (choice == 2): if re.search(regex, grid): print("grid is valid!") - else + else: print("grid is not valid!") elif (choice == 3): From 92bbe0275f9e0c78a8073259b4e8bda25a350473 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 19:47:47 -0400 Subject: [PATCH 37/99] fixed comparison --- groundstation/loc-add-foxtelem.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 1b1ff1de..3ebd7c40 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -13,12 +13,12 @@ print("\nIn order to upload your satellite telemetry data to the AMSAT servers, print("\nYou can enter:") print("1. Location name (e.g. country or city, state, etc)") print("2. Grid square (e.g. FM29)") -print("3. Latitude and Longitude\n") +print("3. Latitude and longitude") print("4. No location") -choice = input ("Enter your choice (1 -4):") +choice = input ("Enter your choice (1 -4): ") -if (choice == 2): +if (choice == '2'): regex = '[A-Z]+[A-Z]+[0-9]+[0-9]' grid = input("Type your 4 character grid square (i.e. FM29): ") @@ -28,7 +28,7 @@ if (choice == 2): else: print("grid is not valid!") -elif (choice == 3): +elif (choice == '3'): lat = input("Type your latitude: ") try: @@ -42,7 +42,8 @@ elif (choice == 3): print("Valid number!") except ValueError: print("Not a number!") -elif (choice == 1): + +elif (choice == '1'): URL = "https://geocode.search.hereapi.com/v1/geocode" print("Enter your location including country. \n\n") From d02457d4cd47afd535d6abf3afcdc84beec144f2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 19:49:49 -0400 Subject: [PATCH 38/99] cleanup --- groundstation/loc-add-foxtelem.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 3ebd7c40..f865589f 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -9,19 +9,19 @@ import re latitude = 0 longitude = 0 -print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location\n") -print("\nYou can enter:") +print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location") +print("\nYou can enter:\n") print("1. Location name (e.g. country or city, state, etc)") print("2. Grid square (e.g. FM29)") print("3. Latitude and longitude") -print("4. No location") +print("4. No location\n") choice = input ("Enter your choice (1 -4): ") if (choice == '2'): regex = '[A-Z]+[A-Z]+[0-9]+[0-9]' - grid = input("Type your 4 character grid square (i.e. FM29): ") + grid = input("\nType your 4 character grid square (i.e. FM29): ") if re.search(regex, grid): print("grid is valid!") @@ -30,13 +30,13 @@ if (choice == '2'): elif (choice == '3'): - lat = input("Type your latitude: ") + lat = input("\nType your latitude: ") try: float(lat) print("Valid number!") except ValueError: print("Not a number!") - long = input("Type your longitude: ") + long = input("\nType your longitude: ") try: float(long) print("Valid number!") @@ -46,7 +46,7 @@ elif (choice == '3'): elif (choice == '1'): URL = "https://geocode.search.hereapi.com/v1/geocode" - print("Enter your location including country. \n\n") + print("\nEnter your location including country. \n\n") location = input("Type your location: ") #taking user input api_key = '' # Acquire from developer.here.com PARAMS = {'apikey':api_key,'q':location} From 40f97a7b1b0c2257dc624c0293ed9461e98a4684 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:08:58 -0400 Subject: [PATCH 39/99] added sed properties changes --- groundstation/loc-add-foxtelem.py | 48 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index f865589f..9151272e 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -51,32 +51,48 @@ elif (choice == '1'): api_key = '' # Acquire from developer.here.com PARAMS = {'apikey':api_key,'q':location} - # sending get request and saving the response as response object - r = requests.get(url = URL, params = PARAMS) - data = r.json() + try: + # sending get request and saving the response as response object + r = requests.get(url = URL, params = PARAMS) + data = r.json() - #print(data) + #print(data) - latitude = data['items'][0]['position']['lat'] - longitude = data['items'][0]['position']['lng'] + latitude = data['items'][0]['position']['lat'] + longitude = data['items'][0]['position']['lng'] - print(latitude) - print(longitude) + print(latitude) + print(longitude) + + except: + print("There is a problem with the location API. Please try again") else: - print("You have chosen not to enter your location.") + print("\nYou have chosen not to enter your location.") print("To track satellites and upload telemetry data,") print("you can set your location in Settings in FoxTelem.") #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -latSedStr = 'sed -i "s/latitude=0.0/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' -#print (latSedStr) -system(latSedStr) +if ((latitude != 0) and (longitude != 0)): + + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (latSedStr) + system(latSedStr) + + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (longSedStr) + system(longSedStr) + + print("\nFoxTelem configuration updated with your latitude and longitude") + +if grid: + + gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (gridSedStr) + system(gridSedStr) + + print("\nFoxTelem configuration updated with your Maidenhead grid") -longSedStr = 'sed -i "s/longitude=0.0/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' -#print (longSedStr) -system(longSedStr) -print("\nFoxTelem configuration updated with your latitude and longitude") From c2dc69a982d5c17ff6b985c201a73fe5f0f4bb79 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:12:18 -0400 Subject: [PATCH 40/99] grid 6 characters --- groundstation/loc-add-foxtelem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 9151272e..fdd3b5de 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -12,16 +12,16 @@ longitude = 0 print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location") print("\nYou can enter:\n") print("1. Location name (e.g. country or city, state, etc)") -print("2. Grid square (e.g. FM29)") +print("2. Grid square (e.g. FM29ha)") print("3. Latitude and longitude") print("4. No location\n") choice = input ("Enter your choice (1 -4): ") if (choice == '2'): - regex = '[A-Z]+[A-Z]+[0-9]+[0-9]' + regex = '[A-Z]+[A-Z]+[0-9]+[0-9]+[a-z]+[a-z]' - grid = input("\nType your 4 character grid square (i.e. FM29): ") + grid = input("\nType your 6 character character grid square (i.e. FM29ha): ") if re.search(regex, grid): print("grid is valid!") From e8b991ac6a2bc5c53b90f98269b85bf5f1eccc6b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:20:47 -0400 Subject: [PATCH 41/99] added empty grid string --- groundstation/loc-add-foxtelem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index fdd3b5de..3202ce3c 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -8,6 +8,7 @@ import re latitude = 0 longitude = 0 +grid = "" print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location") print("\nYou can enter:\n") From db6c0828fecd9a25feea3d2600c4aea7dbfffac9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:22:42 -0400 Subject: [PATCH 42/99] updated lat and long variables --- groundstation/loc-add-foxtelem.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 3202ce3c..4edf0510 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -33,14 +33,14 @@ elif (choice == '3'): lat = input("\nType your latitude: ") try: - float(lat) - print("Valid number!") + latitude = float(lat) + print(latitude) except ValueError: print("Not a number!") long = input("\nType your longitude: ") try: - float(long) - print("Valid number!") + longitude = float(long) + print(longitude) except ValueError: print("Not a number!") From f34e31c00a5fa87a7f5efd3dd4cccc5ec5baeddc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:25:25 -0400 Subject: [PATCH 43/99] clear lat and long if grid is set --- groundstation/loc-add-foxtelem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 4edf0510..3b641aa9 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -75,7 +75,7 @@ else: #file = open(r"/home/pi/CubeSatSim/groundstation/.profile","w+") -if ((latitude != 0) and (longitude != 0)): +if ((latitude != 0) and (longitude != 0) or grid): latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (latSedStr) @@ -85,7 +85,8 @@ if ((latitude != 0) and (longitude != 0)): #print (longSedStr) system(longSedStr) - print("\nFoxTelem configuration updated with your latitude and longitude") + if not grid: + print("\nFoxTelem configuration updated with your latitude and longitude") if grid: From 32ff39429d10f992f923af12590a4e0cfdc5fa6f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 3 Jul 2021 20:57:32 -0400 Subject: [PATCH 44/99] added wildcard so can replace callsign --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 84f192d8..2e373fcc 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -31,7 +31,7 @@ if [ ! -f "$FILE" ]; then echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" read callsign - sudo sed -i "s/callsign=NONE/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties + sudo sed -i "s/callsign=.*/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties echo sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties From 1341ef03798eaaceacce7df6e135c1be7588da60 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:22:08 -0400 Subject: [PATCH 45/99] 1.11d update --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 5b075d01..090d7b56 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -21,6 +21,6 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null -/home/pi/Desktop/FoxTelem_1.11c_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/Desktop/FoxTelem_1.11d_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From 8b48f9b6369d293e98374e62b9540f5e63680fb6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:31:34 -0400 Subject: [PATCH 46/99] 1.11d and FoxInABox station details, and don't overwrite blank callsign --- groundstation/fox-startup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 2e373fcc..6cae934b 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -31,7 +31,11 @@ if [ ! -f "$FILE" ]; then echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" read callsign - sudo sed -i "s/callsign=.*/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + if [ -n "$callsign" ]; then + sudo sed -i "s/callsign=.*/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties + fi + echo sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties @@ -45,7 +49,9 @@ if [ ! -f "$FILE" ]; then sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - + + sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube @@ -88,7 +94,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/Desktop/FoxTelem_1.11c_linux/FoxTelem /home/pi/FoxTelemetryData + /home/pi/Desktop/FoxTelem_1.11d_linux/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From 02a6c8974b2a8090bc11f6c41e1b40adfc066405 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:34:07 -0400 Subject: [PATCH 47/99] sleep after stop openwebrx --- groundstation/rtl-tcp.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh index 1078db39..3e267f34 100755 --- a/groundstation/rtl-tcp.sh +++ b/groundstation/rtl-tcp.sh @@ -23,6 +23,10 @@ echo "Note: you need to be on the Wifi network: $ssid" echo +sudo systemctl stop openwebrx + +sleep 2 + pkill -o chromium &>/dev/null sudo killall -9 java &>/dev/null @@ -31,8 +35,6 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 CubicSDR &>/dev/null -sudo systemctl stop openwebrx - sudo killall -9 rtl_tcp &>/dev/null sudo killall -9 qsstv &>/dev/null From 9aceacbb4ce51616a033a9815e5b87034f2720ac Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:34:43 -0400 Subject: [PATCH 48/99] sleep 2 after stop openwebrx --- groundstation/cubicsdr.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index f2e0c92e..57d38d28 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -9,6 +9,10 @@ echo "Note: Select Generic RTL2832 device then click Start to begin" echo +sudo systemctl stop openwebrx + +sleep 2 + sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -19,8 +23,6 @@ sudo systemctl stop rtl_tcp sudo killall -9 rtl_tcp &>/dev/null -sudo systemctl stop openwebrx - CubicSDR $SHELL From 820d68821e370f73019ba0089267f253aa938633 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:35:38 -0400 Subject: [PATCH 49/99] sleep 2 after stop openwebrx --- groundstation/fox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 090d7b56..c5c68718 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -7,6 +7,8 @@ echo sudo systemctl stop openwebrx +sleep 2 + sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From 191d8fe8bbd4dffd471069276ee11ed70ff3513f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:36:20 -0400 Subject: [PATCH 50/99] sleep 2 after stop openwebrx --- groundstation/sstv_decode.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode.sh b/groundstation/sstv_decode.sh index 85308325..3836ca68 100755 --- a/groundstation/sstv_decode.sh +++ b/groundstation/sstv_decode.sh @@ -5,12 +5,14 @@ echo "Script to decode SSTV from the CubeSatSim for ARISS Radio Pi" echo +sudo systemctl stop openwebrx + +sleep 2 + sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null -sudo systemctl stop openwebrx - sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From 86a8db02a49396df1a16fd29cedfe9f1ae550448 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:36:56 -0400 Subject: [PATCH 51/99] sleep 2 after stop openwebrx --- groundstation/rtl-tcp-d.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/rtl-tcp-d.sh b/groundstation/rtl-tcp-d.sh index 4fbaede4..ee6741bf 100755 --- a/groundstation/rtl-tcp-d.sh +++ b/groundstation/rtl-tcp-d.sh @@ -17,6 +17,10 @@ echo "Note: you need to be on the Wifi network: $ssid" echo +sudo systemctl stop openwebrx + +sleep 2 + sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -27,8 +31,6 @@ sudo killall -9 qsstv &>/dev/null sudo systemctl stop rtl_tcp -sudo systemctl stop openwebrx - sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ") -D 2' $SHELL From f0661b12b308bb2af08b628b4bfc997c86780c53 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:37:27 -0400 Subject: [PATCH 52/99] sleep 2 after stop openwebrx --- groundstation/sstv_decode_iss.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index bd0dc7fa..7589d25c 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -5,6 +5,10 @@ echo "Script to decode SSTV from the CubeSatSim for ARISS Radio Pi" echo +sudo systemctl stop openwebrx + +sleep 2 + sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null @@ -15,8 +19,6 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo systemctl stop openwebrx - sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From 751a9686f8938b4b0074fdb8452f72f155c80f47 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:37:49 -0400 Subject: [PATCH 53/99] sleep 2 after stop openwebrx --- groundstation/aprs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index a0af0ea8..201f8c7c 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -5,6 +5,8 @@ sudo modprobe snd-aloop sudo systemctl stop openwebrx +sleep 2 + sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From c1d04f0100b179d59cb8ab6e014be7e0ba414dbe Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:38:27 -0400 Subject: [PATCH 54/99] sleep 2 after stop openwebrx --- groundstation/sstv_decode_sim.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index c7e8b4ae..180ff14a 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -5,6 +5,10 @@ echo "Script to decode SSTV from the CubeSatSim for ARISS Radio Pi" echo +sudo systemctl stop openwebrx + +sleep 2 + sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null @@ -15,8 +19,6 @@ sudo killall -9 aplay &>/dev/null sudo killall -9 direwolf &>/dev/null -sudo systemctl stop openwebrx - sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From 59250972091af85c4014658b475c044ebfce4fa7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 15:39:02 -0400 Subject: [PATCH 55/99] sleep 2 after stop openwebrx --- groundstation/aprs-cubesatsim.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index bd7cb933..79c3bb43 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -1,10 +1,12 @@ #!/bin/bash # script to auto decode APRS packets from CubeSatSim -sudo modprobe snd-aloop - sudo systemctl stop openwebrx +sleep 2 + +sudo modprobe snd-aloop + sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null From 60fd86ed9da248421d4681467652bef79a70dd57 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 17:22:12 -0400 Subject: [PATCH 56/99] changed to sleep 10 and moved to just before rtl_fm --- groundstation/sstv_decode_sim.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index 180ff14a..089f6e64 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -7,8 +7,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null @@ -31,10 +29,12 @@ sudo killall -9 java &>/dev/null sudo killall -9 CubicSDR &>/dev/null -echo "ARG1=s" >> .mode +#echo "s" >> .mode qsstv & +sleep 10 + #sudo systemctl restart cubesatsim rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 From 70e2aaa181b3c69fec50c84fef7fde8398a66b66 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 18:52:24 -0400 Subject: [PATCH 57/99] changed to sleep 5 --- groundstation/sstv_decode_sim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index 089f6e64..dfdf3e96 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -33,7 +33,7 @@ sudo killall -9 CubicSDR &>/dev/null qsstv & -sleep 10 +sleep 5 #sudo systemctl restart cubesatsim From 1ef7fc1796a10c149d0055f55105d0e5b70af3d2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 18:58:51 -0400 Subject: [PATCH 58/99] sleep 5 --- groundstation/aprs.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 201f8c7c..7cd95ae2 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -5,8 +5,6 @@ sudo modprobe snd-aloop sudo systemctl stop openwebrx -sleep 2 - sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null @@ -27,12 +25,12 @@ sudo killall -9 CubicSDR &>/dev/null echo -e "Script to auto decode APRS packets on 144.390 MHz\n" -sleep 1 - #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - direwolf -t 0 & +sleep 5 + rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 From 66ba7d26bcbb170840c1429d48f33008c2f0c506 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 18:59:41 -0400 Subject: [PATCH 59/99] sleep 5 --- groundstation/aprs-cubesatsim.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 79c3bb43..5bd93cbb 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -3,8 +3,6 @@ sudo systemctl stop openwebrx -sleep 2 - sudo modprobe snd-aloop sudo systemctl stop rtl_tcp @@ -27,12 +25,12 @@ sudo killall -9 CubicSDR &>/dev/null echo -e "Script to auto decode APRS packets from CubeSatSim on 434.90 MHz\n" -sleep 1 - #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - direwolf -t 0 & +sleep 5 + #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 From 8ca088ccd7ef4cceb48a96d6eb0f4ca11e288b3a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 19:01:30 -0400 Subject: [PATCH 60/99] sleep 5 --- groundstation/sstv_decode.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/groundstation/sstv_decode.sh b/groundstation/sstv_decode.sh index 3836ca68..c7afae2e 100755 --- a/groundstation/sstv_decode.sh +++ b/groundstation/sstv_decode.sh @@ -7,8 +7,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null @@ -25,8 +23,10 @@ sudo killall -9 rtl_fm &>/dev/null sudo killall -9 CubicSDR &>/dev/null -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 & - qsstv & +sleep 5 + +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 & + $SHELL From 46c97388b459a3023f16bc8896e1ca71e9be220d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 19:01:55 -0400 Subject: [PATCH 61/99] sleep 5 --- groundstation/sstv_decode_iss.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index 7589d25c..62515a4f 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -7,8 +7,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo modprobe snd-aloop sudo killall -9 qsstv &>/dev/null @@ -33,5 +31,7 @@ sudo killall -9 CubicSDR &>/dev/null qsstv & +sleep 5 + rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From f669dacdbadb425ac1165ff15744e736cf6d0108 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 19:02:24 -0400 Subject: [PATCH 62/99] sleep 5 --- groundstation/rtl-tcp-d.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/rtl-tcp-d.sh b/groundstation/rtl-tcp-d.sh index ee6741bf..5fdd67d7 100755 --- a/groundstation/rtl-tcp-d.sh +++ b/groundstation/rtl-tcp-d.sh @@ -19,8 +19,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -31,6 +29,8 @@ sudo killall -9 qsstv &>/dev/null sudo systemctl stop rtl_tcp +sleep 5 + sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ") -D 2' $SHELL From a37c2af6c3f429a60c1ccc17759ae7697bde4c1d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 19:02:44 -0400 Subject: [PATCH 63/99] sleep 5 --- groundstation/fox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index c5c68718..3e94debf 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -7,8 +7,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo systemctl stop rtl_tcp pkill -o chromium &>/dev/null @@ -23,6 +21,8 @@ sudo killall -9 CubicSDR &>/dev/null sudo killall -9 qsstv &>/dev/null +sleep 5 + /home/pi/Desktop/FoxTelem_1.11d_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From cd7c44d17ac2d60568ed6f5fe78ea8136f344dfc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Jul 2021 19:03:07 -0400 Subject: [PATCH 64/99] sleep 5 --- groundstation/cubicsdr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/cubicsdr.sh b/groundstation/cubicsdr.sh index 57d38d28..9e9e6be0 100755 --- a/groundstation/cubicsdr.sh +++ b/groundstation/cubicsdr.sh @@ -11,8 +11,6 @@ echo sudo systemctl stop openwebrx -sleep 2 - sudo killall -9 java &>/dev/null sudo killall -9 rtl_fm &>/dev/null @@ -23,6 +21,8 @@ sudo systemctl stop rtl_tcp sudo killall -9 rtl_tcp &>/dev/null +sleep 5 + CubicSDR $SHELL From 11425fa961fe4777372f2214cbb157c5693b6e35 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 10:21:52 -0400 Subject: [PATCH 65/99] 1.11e --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 3e94debf..814e5d98 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -23,6 +23,6 @@ sudo killall -9 qsstv &>/dev/null sleep 5 -/home/pi/Desktop/FoxTelem_1.11d_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/Desktop/FoxTelem_1.11e_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From b63b1b3c906a7c3f038164351a6d8902be506207 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 10:22:07 -0400 Subject: [PATCH 66/99] 1.11e --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 6cae934b..96782b79 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -94,7 +94,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/Desktop/FoxTelem_1.11d_linux/FoxTelem /home/pi/FoxTelemetryData + /home/pi/Desktop/FoxTelem_1.11e_linux/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From 43bdb891c682be63ec2de0424858a503cf5b6121 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 18:07:39 -0400 Subject: [PATCH 67/99] aplay back to 2 from 3 --- groundstation/sstv_decode_sim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index dfdf3e96..fc07a33f 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -37,6 +37,6 @@ sleep 5 #sudo systemctl restart cubesatsim -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From e8361d0bccaa67997af110ab5e878b2e45b2c08b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 18:12:47 -0400 Subject: [PATCH 68/99] changed aplay 2 from 3 --- groundstation/aprs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 7cd95ae2..7c844533 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -31,7 +31,7 @@ direwolf -t 0 & sleep 5 -rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 From 12b89f1c11029f1f3f4fd130eb9dc0346461ba74 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 18:13:16 -0400 Subject: [PATCH 69/99] changed aplay 3 to 2 --- groundstation/sstv_decode_iss.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index 62515a4f..64ca0b4e 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -33,5 +33,5 @@ qsstv & sleep 5 -rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From 24da8362d1682c6c432b7e8a4a8866e3d8eb655b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 5 Jul 2021 18:13:46 -0400 Subject: [PATCH 70/99] change aplay 3 to 2 --- groundstation/aprs-cubesatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 5bd93cbb..1ae0b5d6 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -32,7 +32,7 @@ direwolf -t 0 & sleep 5 #rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:3,0,0 -r 48000 -t raw -f S16_LE -c 1 +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 From 624b5fe9a6778a6f86edd4a16ffb84f4474ac15a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 15:01:35 -0400 Subject: [PATCH 71/99] grep for Loopback number fora play --- groundstation/sstv_decode_sim.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_sim.sh b/groundstation/sstv_decode_sim.sh index fc07a33f..300895ee 100755 --- a/groundstation/sstv_decode_sim.sh +++ b/groundstation/sstv_decode_sim.sh @@ -37,6 +37,10 @@ sleep 5 #sudo systemctl restart cubesatsim -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From 3396b9242845dfc8ed54bc58a7351d4854fc687c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 15:13:06 -0400 Subject: [PATCH 72/99] added grep for Loopback fora play --- groundstation/aprs-cubesatsim.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 1ae0b5d6..87e0cbbf 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -31,8 +31,11 @@ direwolf -t 0 & sleep 5 -#rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 -rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +rtl_fm -M fm -f 434.9M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 From cf42fa404351cb6e28ff45fda537a65a5f8bacc8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 15:14:28 -0400 Subject: [PATCH 73/99] added grep for Loopback for aplay --- groundstation/aprs.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index 7c844533..d0d21496 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -31,7 +31,11 @@ direwolf -t 0 & sleep 5 -rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +rtl_fm -M fm -f 144.39M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 From a4d520da083ebecc08e71e14f5932c7753651204 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 15:15:21 -0400 Subject: [PATCH 74/99] added grep for Loopback fora play --- groundstation/sstv_decode_iss.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groundstation/sstv_decode_iss.sh b/groundstation/sstv_decode_iss.sh index 64ca0b4e..da19a72b 100755 --- a/groundstation/sstv_decode_iss.sh +++ b/groundstation/sstv_decode_iss.sh @@ -33,5 +33,9 @@ qsstv & sleep 5 -rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:2,0,0 -r 48000 -t raw -f S16_LE -c 1 +value=`aplay -l | grep "Loopback"` +echo "$value" > /dev/null +set -- $value + +rtl_fm -M fm -f 145.8M -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 $SHELL From f96ebb7b08af3962c02287f11be359b84b66cc06 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 16:10:22 -0400 Subject: [PATCH 75/99] changed FoxTelem path to FoxTelem for link to actual version --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 96782b79..7f078e6e 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -94,7 +94,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/Desktop/FoxTelem_1.11e_linux/FoxTelem /home/pi/FoxTelemetryData + /home/pi/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From 7b658b5bc9ec93e523e14e1c7f44b73320ee283e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 16:10:53 -0400 Subject: [PATCH 76/99] changed path for FoxTelem for link to version --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 814e5d98..d747feb0 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -23,6 +23,6 @@ sudo killall -9 qsstv &>/dev/null sleep 5 -/home/pi/Desktop/FoxTelem_1.11e_linux/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From bcccb4b72ac018020cc46c31ac8a25fc95e535d6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 16:20:58 -0400 Subject: [PATCH 77/99] fixed FoxTelem path --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index d747feb0..79bdeba3 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -23,6 +23,6 @@ sudo killall -9 qsstv &>/dev/null sleep 5 -/home/pi/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/FoxTelem/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From 50acf4dba6205dd796e8e77a2a8ee42604299ddb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 16:21:22 -0400 Subject: [PATCH 78/99] fixed FoxTelem path --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 7f078e6e..3782faf4 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -94,7 +94,7 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/FoxTelem /home/pi/FoxTelemetryData + /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData fi $SHELL From ea850206b7dc3f4891794d6ed3ecd9cd9b8ecd64 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 6 Jul 2021 16:23:52 -0400 Subject: [PATCH 79/99] fixed path again --- groundstation/fox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox.sh b/groundstation/fox.sh index 79bdeba3..eb2289dd 100755 --- a/groundstation/fox.sh +++ b/groundstation/fox.sh @@ -23,6 +23,6 @@ sudo killall -9 qsstv &>/dev/null sleep 5 -/home/pi/FoxTelem/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim +/home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData-CubeSatSim $SHELL From 80344fe6ec764ca04f2713cc8fa7dad0388464b0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 08:47:54 -0400 Subject: [PATCH 80/99] added altitude prompt and config --- groundstation/loc-add-foxtelem.py | 39 ++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 3b641aa9..35dfc907 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -77,24 +77,37 @@ else: if ((latitude != 0) and (longitude != 0) or grid): - latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (latSedStr) - system(latSedStr) + alt = input("\nType your altitude: ") + try: + altitude = float(alt) + print(altitude) + altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' +# print (altSedStr) + system(altSedStr) + print("\nFoxTelem configuration updated with your alitude") + + except ValueError: + print("Not a number!") + + if not grid: + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (latSedStr) + system(latSedStr) - longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (longSedStr) - system(longSedStr) + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (longSedStr) + system(longSedStr) - if not grid: - print("\nFoxTelem configuration updated with your latitude and longitude") + print("\nFoxTelem configuration updated with your latitude and longitude") + + else: -if grid: + gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (gridSedStr) + system(gridSedStr) - gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' - #print (gridSedStr) - system(gridSedStr) + print("\nFoxTelem configuration updated with your maidenhead grid square") - print("\nFoxTelem configuration updated with your Maidenhead grid") From 2887f99628e9830067a9eba4ed584f281f311e4e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 08:48:44 -0400 Subject: [PATCH 81/99] typo --- groundstation/loc-add-foxtelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 35dfc907..e12dfece 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -81,7 +81,7 @@ if ((latitude != 0) and (longitude != 0) or grid): try: altitude = float(alt) print(altitude) - altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' # print (altSedStr) system(altSedStr) print("\nFoxTelem configuration updated with your alitude") From d4445e1b7863bc0689ac61c28697bfcdb8f29523 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 08:50:55 -0400 Subject: [PATCH 82/99] moved altitude to end --- groundstation/loc-add-foxtelem.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index e12dfece..1787793e 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -77,18 +77,6 @@ else: if ((latitude != 0) and (longitude != 0) or grid): - alt = input("\nType your altitude: ") - try: - altitude = float(alt) - print(altitude) - altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' -# print (altSedStr) - system(altSedStr) - print("\nFoxTelem configuration updated with your alitude") - - except ValueError: - print("Not a number!") - if not grid: latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (latSedStr) @@ -105,9 +93,20 @@ if ((latitude != 0) and (longitude != 0) or grid): gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (gridSedStr) system(gridSedStr) - + print("\nFoxTelem configuration updated with your maidenhead grid square") - - + alt = input("\nType your altitude: ") + try: + altitude = float(alt) + #print(altitude) + altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (altSedStr) + system(altSedStr) + + print("\nFoxTelem configuration updated with your alitude") + + except ValueError: + print("Not a number!") + From 018e8b3a03191893c0348caa8b4cd56d41d30c06 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 09:01:15 -0400 Subject: [PATCH 83/99] added text to why need location --- groundstation/loc-add-foxtelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 1787793e..23deb3de 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -10,7 +10,7 @@ latitude = 0 longitude = 0 grid = "" -print("\nIn order to upload your satellite telemetry data to the AMSAT servers, we need to know your location") +print("\nIn order to track the satellites as they fly over your location and upload your satellite telemetry data to the AMSAT servers, we need to know your location") print("\nYou can enter:\n") print("1. Location name (e.g. country or city, state, etc)") print("2. Grid square (e.g. FM29ha)") From 7b68bfb001f662ad38c225254176b4b15a9af12a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 23:32:48 -0400 Subject: [PATCH 84/99] made altitude an int --- groundstation/loc-add-foxtelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 23deb3de..fa54017c 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -99,7 +99,7 @@ if ((latitude != 0) and (longitude != 0) or grid): alt = input("\nType your altitude: ") try: - altitude = float(alt) + altitude = int(alt) #print(altitude) altSedStr = 'sed -i "s/altitude=.*/altitude=' + str(altitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (altSedStr) From cba27e817577d6be47ed2ce7d2e7112b8d73eea5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 23:36:02 -0400 Subject: [PATCH 85/99] added note altitude is in integer meters --- groundstation/loc-add-foxtelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index fa54017c..05e26eb4 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -97,7 +97,7 @@ if ((latitude != 0) and (longitude != 0) or grid): print("\nFoxTelem configuration updated with your maidenhead grid square") - alt = input("\nType your altitude: ") + alt = input("\nType your altitude in integer meters: ") try: altitude = int(alt) #print(altitude) From 66bab794ca96ef3dceed9ed906619eff7ca3c89d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 23:45:45 -0400 Subject: [PATCH 86/99] start FoxTelem with Xmx512M option --- groundstation/fox-startup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 3782faf4..d3d59532 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -95,6 +95,11 @@ else echo "Fox-in-a-box profile is set!" echo /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData + SCRIPTPATH=$(dirname "$0") + cd /home/pi/Desktop/FoxTelem + echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar + java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData" < /dev/null > /dev/null & + fi $SHELL From c9d2376793267dd6b17686a145ca12071727a303 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 9 Jul 2021 23:47:29 -0400 Subject: [PATCH 87/99] fixed path --- groundstation/fox-startup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index d3d59532..42d8818f 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -94,9 +94,9 @@ if [ "$1" = "c" ]; then else echo "Fox-in-a-box profile is set!" echo - /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData +# /home/pi/FoxTelem/FoxTelem /home/pi/FoxTelemetryData SCRIPTPATH=$(dirname "$0") - cd /home/pi/Desktop/FoxTelem + cd /home/pi/FoxTelem echo Starting $SCRIPTPATH/current_foxtelem/FoxTelem.jar java -Xmx512M -jar FoxTelem.jar "/home/pi/FoxTelemetryData" < /dev/null > /dev/null & From 65ec9175512be5d98bb0372b35bf7d74648ebc8c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 10 Jul 2021 11:36:19 -0400 Subject: [PATCH 88/99] clear lat and long if grid set --- groundstation/loc-add-foxtelem.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 05e26eb4..ff6fd5a4 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -89,6 +89,14 @@ if ((latitude != 0) and (longitude != 0) or grid): print("\nFoxTelem configuration updated with your latitude and longitude") else: + latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (latSedStr) + system(latSedStr) + + longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' + #print (longSedStr) + system(longSedStr) + gridSedStr = 'sed -i "s/maidenhead=.*/maidenhead=' + grid + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' #print (gridSedStr) @@ -108,5 +116,5 @@ if ((latitude != 0) and (longitude != 0) or grid): print("\nFoxTelem configuration updated with your alitude") except ValueError: - print("Not a number!") + print("Not an integer!") From 26451db672fbebcefba9ba7c1164025e84de4a45 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 10 Jul 2021 11:45:20 -0400 Subject: [PATCH 89/99] only backup properties if no backup --- groundstation/fox-startup.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 42d8818f..ebc5f1ad 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -26,9 +26,12 @@ if [ ! -f "$FILE" ]; then echo "You have chosen the Fox-in-a-Box profile." echo "b" > /home/pi/FoxTelemetryData/.foxprofile echo - - cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 - + + FILE=/home/pi/FoxTelemetryData/FoxTelem.properties.0 + if [ ! -f "$FILE" ]; then + cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 + fi + echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" read callsign From 68885a3b867d309fb5a8cac346099b99087b3250 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 12 Jul 2021 16:25:17 -0400 Subject: [PATCH 90/99] added return value --- groundstation/loc-add-foxtelem.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index ff6fd5a4..51193772 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -9,6 +9,7 @@ import re latitude = 0 longitude = 0 grid = "" +return_value = 0 print("\nIn order to track the satellites as they fly over your location and upload your satellite telemetry data to the AMSAT servers, we need to know your location") print("\nYou can enter:\n") @@ -87,6 +88,8 @@ if ((latitude != 0) and (longitude != 0) or grid): system(longSedStr) print("\nFoxTelem configuration updated with your latitude and longitude") + + return_value = 1 else: latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/FoxTelemetryData/FoxTelem.properties' @@ -103,7 +106,8 @@ if ((latitude != 0) and (longitude != 0) or grid): system(gridSedStr) print("\nFoxTelem configuration updated with your maidenhead grid square") - + + return_value = 1 alt = input("\nType your altitude in integer meters: ") try: @@ -118,3 +122,4 @@ if ((latitude != 0) and (longitude != 0) or grid): except ValueError: print("Not an integer!") +return return_value From f837b059d0ba666fb00deaf840561e7d71767a41 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 12 Jul 2021 16:31:28 -0400 Subject: [PATCH 91/99] changed to sys.exit --- groundstation/loc-add-foxtelem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index 51193772..a2b93498 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -5,6 +5,7 @@ import requests from os import system import re +import sys latitude = 0 longitude = 0 @@ -122,4 +123,4 @@ if ((latitude != 0) and (longitude != 0) or grid): except ValueError: print("Not an integer!") -return return_value +sys.exit(return_value) From 046132f698b8bffb395c6bdf02299d9cf608f1f7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 12 Jul 2021 16:42:37 -0400 Subject: [PATCH 92/99] only do settings if location is provided --- groundstation/fox-startup.sh | 64 ++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index ebc5f1ad..15f801d9 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -32,38 +32,44 @@ if [ ! -f "$FILE" ]; then cp /home/pi/FoxTelemetryData/FoxTelem.properties /home/pi/FoxTelemetryData/FoxTelem.properties.0 fi - echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" - read callsign - - if [ -n "$callsign" ]; then - sudo sed -i "s/callsign=.*/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties - fi - - echo - - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py - sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + if [ $? -eq 1 ]; then - sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + echo "Enter your CALLSIGN. If you don't have a callsign, enter a text string that will be displayed on the FoxTelem leader board at https://amsat.org/tlm" + read callsign - sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties - - sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties - -# sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube - sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube - - python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py - -# echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" -# read grid -# sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties -# echo + if [ -n "$callsign" ]; then + sudo sed -i "s/callsign=.*/callsign=$callsign/g" /home/pi/FoxTelemetryData/FoxTelem.properties + fi + + echo + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsDoppler=false/foxTelemCalcsDoppler=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/foxTelemCalcsPosition=false/foxTelemCalcsPosition=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/uploadToServer=false/uploadToServer=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/whenAboveHorizon=false/whenAboveHorizon=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/retuneCenterFrequency=false/retuneCenterFrequency=true/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + sudo sed -i "s/stationDetails=.*/stationDetails=FoxInABox/g" /home/pi/FoxTelemetryData/FoxTelem.properties + + # sudo sed -i "s/soundCard=NONE/soundCard=RTL SDR/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + sudo sed -i "s/soundCard=NONE/soundCard=Direct Audio Device\: FUNcube Dongle V2.0, USB Audi/g" /home/pi/FoxTelemetryData/FoxTelem.properties # change to FunCube + + + + # echo "Enter your Maidenhead grid square. It is two letters followed by two numbers followed by two letters with no spaces. If you don't know your gridsquare, you can look it up here https://dxcluster.ha8tks.hu/hamgeocoding/" + # read grid + # sudo sed -i "s/maidenhead=XX00xx/maidenhead=$grid/g" /home/pi/Documents/FITB/FoxTelem.properties + # echo + + fi elif [ "$ANS" = "2" ]; then From 39907e40df081d6c0a6b295ebc89d8bfa9201f50 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 12 Jul 2021 16:53:01 -0400 Subject: [PATCH 93/99] cleared grid if invalid --- groundstation/loc-add-foxtelem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/groundstation/loc-add-foxtelem.py b/groundstation/loc-add-foxtelem.py index a2b93498..98a16a19 100644 --- a/groundstation/loc-add-foxtelem.py +++ b/groundstation/loc-add-foxtelem.py @@ -30,6 +30,7 @@ if (choice == '2'): print("grid is valid!") else: print("grid is not valid!") + grid = "" elif (choice == '3'): From 91dbf4f2ffbd23587a05914495150eb5a0c0caba Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 13 Jul 2021 13:12:07 -0400 Subject: [PATCH 94/99] Update fox-startup.sh --- groundstation/fox-startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index 15f801d9..b4504388 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -17,7 +17,7 @@ if [ ! -f "$FILE" ]; then echo echo "2. CubeSatSim Ground Station. Use this profile if you want to receive and decode telemetry from an AMSAT CubeSatSim or CubeSatSim Lite." echo - echo "Which profile do choose? Enter 1 or 2" + echo "Which profile do you choose? Enter 1 or 2" read -r ANS From 47d0e253587a6323b6e7ed9328715efaece85a96 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 10 Aug 2021 19:49:48 -0400 Subject: [PATCH 95/99] added -r 48000 to dire wolf --- groundstation/aprs-cubesatsim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs-cubesatsim.sh b/groundstation/aprs-cubesatsim.sh index 87e0cbbf..4599d9b4 100755 --- a/groundstation/aprs-cubesatsim.sh +++ b/groundstation/aprs-cubesatsim.sh @@ -27,7 +27,7 @@ echo -e "Script to auto decode APRS packets from CubeSatSim on 434.90 MHz\n" #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - -direwolf -t 0 & +direwolf -r 48000 -t 0 & sleep 5 From bc53fce2028ce9f4a8b9cde80477415f53dc2f8a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 10 Aug 2021 19:53:01 -0400 Subject: [PATCH 96/99] added -r 48000 to dire wolf --- groundstation/aprs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh index d0d21496..315a6ba0 100755 --- a/groundstation/aprs.sh +++ b/groundstation/aprs.sh @@ -27,7 +27,7 @@ echo -e "Script to auto decode APRS packets on 144.390 MHz\n" #sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw - -direwolf -t 0 & +direwolf -r 48000 -t 0 & sleep 5 From 738a12f957dc6f9769f2380186a95f6a643970df Mon Sep 17 00:00:00 2001 From: John Hutchison Date: Tue, 10 Aug 2021 19:21:02 -0500 Subject: [PATCH 97/99] Add SI1145 & LIS3MDL sensors to payload. --- .../Payload_BME280_MPU6050_XS_Extended.ino | 356 ++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino diff --git a/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino new file mode 100644 index 00000000..587256f2 --- /dev/null +++ b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino @@ -0,0 +1,356 @@ +#include +#include +#include +#include +#include +#include "Adafruit_SI1145.h" +#include + +#define SEALEVELPRESSURE_HPA (1013.25) + +Adafruit_BME280 bme; +MPU6050 mpu6050(Wire); +Adafruit_SI1145 uv = Adafruit_SI1145(); +Adafruit_LIS3MDL lis3mdl; + +long timer = 0; +int bmePresent; +int uvPresent; +int magPresent; +int RXLED = 17; // The RX LED has a defined Arduino pin +int greenLED = 9; +int blueLED = 8; +void eeprom_word_write(int addr, int val); +short eeprom_word_read(int addr); +int first_time = true; +int first_read = true; +float T2 = 26.3; // Temperature data point 1 +float R2 = 167; // Reading data point 1 +float T1 = 2; // Temperature data point 2 +float R1 = 179; // Reading data point 2 +int sensorValue; +float Temp; +float rest; +float mag = 0; + +void setup() { + + Serial.begin(9600); // Serial Monitor for testing + + Serial1.begin(115200); // Pi UART faster speed + + Serial.println("Starting!"); + + blink_setup(); + + blink(500); + delay(250); + blink(500); + delay(250); + led_set(greenLED, HIGH); + delay(250); + led_set(greenLED, LOW); + led_set(blueLED, HIGH); + delay(250); + led_set(blueLED, LOW); + + if (bme.begin(0x76)) { + bmePresent = 1; + } else { + Serial.println("BME280 sensor fault"); + bmePresent = 0; + } + + if (! uv.begin()) { + Serial.println("Si1145 sensor fault"); + uvPresent = 0; + } else { + uvPresent = 1; + } + + if (! lis3mdl.begin_I2C()) { + Serial.println("LIS3MDL sensor fault"); + magPresent = 0; + } else { + magPresent = 1; + } + + mpu6050.begin(); + + if (eeprom_word_read(0) == 0xA07) + { + Serial.println("Reading gyro offsets from EEPROM\n"); + + float xOffset = ((float)eeprom_word_read(1)) / 100.0; + float yOffset = ((float)eeprom_word_read(2)) / 100.0; + float zOffset = ((float)eeprom_word_read(3)) / 100.0; + + Serial.println(xOffset, DEC); + Serial.println(yOffset, DEC); + Serial.println(zOffset, DEC); + + mpu6050.setGyroOffsets(xOffset, yOffset, zOffset); + } + else + { + Serial.println("Calculating gyro offsets and storing in EEPROM\n"); + + mpu6050.calcGyroOffsets(true); + + eeprom_word_write(0, 0xA07); + eeprom_word_write(1, (int)(mpu6050.getGyroXoffset() * 100.0) + 0.5); + eeprom_word_write(2, (int)(mpu6050.getGyroYoffset() * 100.0) + 0.5); + eeprom_word_write(3, (int)(mpu6050.getGyroZoffset() * 100.0) + 0.5); + + Serial.println(eeprom_word_read(0), HEX); + Serial.println(((float)eeprom_word_read(1)) / 100.0, DEC); + Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC); + Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC); + } + pinMode(greenLED, OUTPUT); + pinMode(blueLED, OUTPUT); +} + +void loop() { + + if ((Serial.available() > 0) || first_time == true) { + blink(50); + char result = Serial.read(); + + if (result == 'R') { + Serial.println("OK"); + delay(100); + first_time = true; + setup(); + } + else if (result == 'C') { + Serial.println("Clearing stored gyro offsets in EEPROM\n"); + eeprom_word_write(0, 0x00); + first_time = true; + setup(); + } + if ((result == '?') || first_time == true) + { + first_time = false; + if (bmePresent) { + Serial.print("OK BME280 "); + Serial.print(bme.readTemperature()); + Serial.print(" "); + Serial.print(bme.readPressure() / 100.0F); + Serial.print(" "); + Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); + Serial.print(" "); + Serial.print(bme.readHumidity()); + } else + { + Serial.print("OK BME280 0.0 0.0 0.0 0.0"); + } + mpu6050.update(); + + Serial.print(" MPU6050 "); + Serial.print(mpu6050.getGyroX()); + Serial.print(" "); + Serial.print(mpu6050.getGyroY()); + Serial.print(" "); + Serial.print(mpu6050.getGyroZ()); + + Serial.print(" "); + Serial.print(mpu6050.getAccX()); + Serial.print(" "); + Serial.print(mpu6050.getAccY()); + Serial.print(" "); + Serial.print(mpu6050.getAccZ()); + + sensorValue = analogRead(A3); + Temp = T1 + (sensorValue - R1) * ((T2 - T1) / (R2 - R1)); + + Serial.print(" XS "); + Serial.print(Temp); + Serial.print(" "); + if (uvPresent) { + Serial.print(uv.readVisible()); + Serial.print(" "); + Serial.print(uv.readIR()); + Serial.print(" "); + } else + { + Serial.print("0.0 0.0 "); + } + if (magPresent) { + lis3mdl.read(); + mag = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); + Serial.println(mag); + } else + { + Serial.println("0.0"); + } + + float rotation = sqrt(mpu6050.getGyroX() * mpu6050.getGyroX() + mpu6050.getGyroY() * mpu6050.getGyroY() + mpu6050.getGyroZ() * mpu6050.getGyroZ()); + float acceleration = sqrt(mpu6050.getAccX() * mpu6050.getAccX() + mpu6050.getAccY() * mpu6050.getAccY() + mpu6050.getAccZ() * mpu6050.getAccZ()); + + if (acceleration > 1.2) + led_set(greenLED, HIGH); + else + led_set(greenLED, LOW); + + if (rotation > 5) + led_set(blueLED, HIGH); + else + led_set(blueLED, LOW); + } + } + + if (Serial1.available() > 0) { + + blink(50); + char result = Serial1.read(); + + if (result == 'R') { + Serial1.println("OK"); + delay(100); + first_read = true; + setup(); + } + + if (result == '?') + { + if (bmePresent) { + Serial1.print("OK BME280 "); + Serial1.print(bme.readTemperature()); + Serial1.print(" "); + Serial1.print(bme.readPressure() / 100.0F); + Serial1.print(" "); + Serial1.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); + Serial1.print(" "); + Serial1.print(bme.readHumidity()); + } else + { + Serial1.print("OK BME280 0.0 0.0 0.0 0.0"); + } + mpu6050.update(); + + Serial1.print(" MPU6050 "); + Serial1.print(mpu6050.getGyroX()); + Serial1.print(" "); + Serial1.print(mpu6050.getGyroY()); + Serial1.print(" "); + Serial1.print(mpu6050.getGyroZ()); + + Serial1.print(" "); + Serial1.print(mpu6050.getAccX()); + Serial1.print(" "); + Serial1.print(mpu6050.getAccY()); + Serial1.print(" "); + Serial1.print(mpu6050.getAccZ()); + + sensorValue = analogRead(A3); + Temp = T1 + (sensorValue - R1) * ((T2 - T1) / (R2 - R1)); + + Serial1.print(" XS "); + Serial1.print(Temp); + Serial1.print(" "); + if (uvPresent) { + Serial1.print(uv.readVisible()); + Serial1.print(" "); + Serial1.print(uv.readIR()); + Serial1.print(" "); + } else + { + Serial1.print("0.0 0.0 "); + } + if (magPresent) { + lis3mdl.read(); + mag = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); + Serial1.println(mag); + } else + { + Serial1.println("0.0"); + } + + + float rotation = sqrt(mpu6050.getGyroX() * mpu6050.getGyroX() + mpu6050.getGyroY() * mpu6050.getGyroY() + mpu6050.getGyroZ() * mpu6050.getGyroZ()); + float acceleration = sqrt(mpu6050.getAccX() * mpu6050.getAccX() + mpu6050.getAccY() * mpu6050.getAccY() + mpu6050.getAccZ() * mpu6050.getAccZ()); + + if (first_read == true) { + first_read = false; + rest = acceleration; + } + + if (acceleration > 1.2 * rest) + led_set(greenLED, HIGH); + else + led_set(greenLED, LOW); + + if (rotation > 5) + led_set(blueLED, HIGH); + else + led_set(blueLED, LOW); + } + } + +} + +void eeprom_word_write(int addr, int val) +{ + EEPROM.write(addr * 2, lowByte(val)); + EEPROM.write(addr * 2 + 1, highByte(val)); +} + +short eeprom_word_read(int addr) +{ + return ((EEPROM.read(addr * 2 + 1) << 8) | EEPROM.read(addr * 2)); +} + +void blink_setup() +{ +#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) + // initialize digital pin PB1 as an output. + pinMode(PC13, OUTPUT); + pinMode(PB9, OUTPUT); + pinMode(PB8, OUTPUT); +#endif + +#if defined __AVR_ATmega32U4__ + pinMode(RXLED, OUTPUT); // Set RX LED as an output + // TX LED is set as an output behind the scenes + pinMode(greenLED, OUTPUT); + pinMode(blueLED, OUTPUT); +#endif +} + +void blink(int length) +{ +#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) + digitalWrite(PC13, LOW); // turn the LED on (HIGH is the voltage level) +#endif + +#if defined __AVR_ATmega32U4__ + digitalWrite(RXLED, LOW); // set the RX LED ON + TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF +#endif + + delay(length); // wait for a lenth of time + +#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) + digitalWrite(PC13, HIGH); // turn the LED off by making the voltage LOW +#endif + +#if defined __AVR_ATmega32U4__ + digitalWrite(RXLED, HIGH); // set the RX LED OFF + TXLED0; //TX LED macro to turn LED ON +#endif +} + +void led_set(int ledPin, bool state) +{ +#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) + if (ledPin == greenLED) + digitalWrite(PB9, state); + else if (ledPin == blueLED) + digitalWrite(PB8, state); +#endif + +#if defined __AVR_ATmega32U4__ + digitalWrite(ledPin, state); +#endif +} From f4638cab7a32863abe14809d1ba5646e78c70bf0 Mon Sep 17 00:00:00 2001 From: John Hutchison Date: Wed, 11 Aug 2021 18:47:34 -0500 Subject: [PATCH 98/99] Prevent negative mag values --- .../Payload_BME280_MPU6050_XS_Extended.ino | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino index 587256f2..f8740323 100644 --- a/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino +++ b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino @@ -16,7 +16,7 @@ Adafruit_LIS3MDL lis3mdl; long timer = 0; int bmePresent; int uvPresent; -int magPresent; +int magRawPresent; int RXLED = 17; // The RX LED has a defined Arduino pin int greenLED = 9; int blueLED = 8; @@ -31,7 +31,8 @@ float R1 = 179; // Reading data point 2 int sensorValue; float Temp; float rest; -float mag = 0; +float magRaw = 0; +float magRawAbs = 0; void setup() { @@ -70,9 +71,9 @@ void setup() { if (! lis3mdl.begin_I2C()) { Serial.println("LIS3MDL sensor fault"); - magPresent = 0; + magRawPresent = 0; } else { - magPresent = 1; + magRawPresent = 1; } mpu6050.begin(); @@ -176,10 +177,11 @@ void loop() { { Serial.print("0.0 0.0 "); } - if (magPresent) { + if (magRawPresent) { lis3mdl.read(); - mag = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); - Serial.println(mag); + magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); + magAbs = abs(magRaw); + Serial.println(magAbs); } else { Serial.println("0.0"); @@ -258,10 +260,11 @@ void loop() { { Serial1.print("0.0 0.0 "); } - if (magPresent) { + if (magRawPresent) { lis3mdl.read(); - mag = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); - Serial1.println(mag); + magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); + magAbs = abs(magRaw); + Serial1.println(magAbs); } else { Serial1.println("0.0"); From e64febd5806bab2dd6d8cf570af65630ce62220d Mon Sep 17 00:00:00 2001 From: John Hutchison Date: Wed, 11 Aug 2021 18:50:32 -0500 Subject: [PATCH 99/99] Fix magPresent typo --- .../Payload_BME280_MPU6050_XS_Extended.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino index f8740323..f7b391b4 100644 --- a/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino +++ b/stempayload/Payload_BME280_MPU6050_XS_Extended/Payload_BME280_MPU6050_XS_Extended.ino @@ -16,7 +16,7 @@ Adafruit_LIS3MDL lis3mdl; long timer = 0; int bmePresent; int uvPresent; -int magRawPresent; +int magPresent; int RXLED = 17; // The RX LED has a defined Arduino pin int greenLED = 9; int blueLED = 8; @@ -71,9 +71,9 @@ void setup() { if (! lis3mdl.begin_I2C()) { Serial.println("LIS3MDL sensor fault"); - magRawPresent = 0; + magPresent = 0; } else { - magRawPresent = 1; + magPresent = 1; } mpu6050.begin(); @@ -177,7 +177,7 @@ void loop() { { Serial.print("0.0 0.0 "); } - if (magRawPresent) { + if (magPresent) { lis3mdl.read(); magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); magAbs = abs(magRaw); @@ -260,7 +260,7 @@ void loop() { { Serial1.print("0.0 0.0 "); } - if (magRawPresent) { + if (magPresent) { lis3mdl.read(); magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); magAbs = abs(magRaw);