Merge pull request #451 from alanbjohnston/master-b

v2.3 updates
master-bl
Alan Johnston 1 week ago committed by GitHub
commit 518c786509
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
.gitignore vendored

@ -47,3 +47,13 @@ logt.txt
telem.txt.bk
failure_mode.txt
sim_mode_auto
direwolf-pacsatsim-tmp.conf
groundstation/direwolf-pacsat-tmp.conf
tlm.bin
frequency.txt
freq.txt
logb.txt
logo.txt
logp.txt
hotspot.ini
camera.jpg

@ -0,0 +1,689 @@
showNavigation: false
pageTitle: CubeSatSim Dashboard
logLevel: "INFO"
showFooter: false
additionalNavigationLinks:
- title: CubeSatSim Wiki
url: https://CubeSatSim.org/wiki
target: _blank
- title: CubeSatSim Code
url: https://CubeSatSim.org/code
target: _blank
- title: CubeSatSim YouTube Videos
url: https://www.youtube.com/@ku2y
target: _blank
actions:
- title: "Show CubeSatSim Config"
shell: /home/pi/CubeSatSim/config
icon: logs
onclick: execution-dialog
timeout: 10
- title: "Show All Commands"
shell: /home/pi/CubeSatSim/config -h
icon: logs
onclick: execution-dialog
timeout: 10
- title: "General CubeSatSim Config"
shell: /home/pi/CubeSatSim/config {{ config }}
icon: "⚙" # gear
onclick: execution-dialog
timeout: 10
arguments:
- name: config
type: ascii_sentence
- title: "Change Mode to APRS"
shell: /home/pi/CubeSatSim/config -a
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to FSK"
shell: /home/pi/CubeSatSim/config -f
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to BPSK"
shell: /home/pi/CubeSatSim/config -b
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to SSTV"
shell: /home/pi/CubeSatSim/config -s
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to CW"
shell: /home/pi/CubeSatSim/config -m
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to Repeater"
shell: /home/pi/CubeSatSim/config -e
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to FUNcube"
shell: /home/pi/CubeSatSim/config -j
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 10
- title: "Change Mode to Pacsat"
shell: /home/pi/CubeSatSim/config -G
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 30
- title: "Change Mode to Pacsat Ground Station"
shell: /home/pi/CubeSatSim/config -I
icon: "🛰" # satellite
onclick: execution-dialog
timeout: 30
- title: "Turn Battery Saver Mode ON"
shell: bash -c "/home/pi/CubeSatSim/config -B yes"
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Battery Saver Mode OFF"
shell: bash -c "/home/pi/CubeSatSim/config -B no"
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Turn Doppler Mode OFF"
shell: /home/pi/CubeSatSim/config -K no
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Turn Simulated Doppler Mode ON"
shell: /home/pi/CubeSatSim/config -K sim
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Radio Control Doppler Mode ON"
shell: /home/pi/CubeSatSim/config -K rig
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Change TX and RX Frequency"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -F {{ tx }} {{ rx }}
onclick: execution-dialog
timeout: 10
arguments:
- name: tx
type: ascii_sentence
- name: rx
type: ascii_sentence
- title: "Connect to WiFi using SSID and Password"
icon: "🛜" # wireless
shell: echo "If this works, this web page won't work again until you connect to the new WiFi network!" && echo && sudo nmcli device wifi rescan && sleep 1 && sudo nmcli device wifi connect "{{ wifi_ssid }}" password "{{ wifi_password }}" && sudo reboot now
onclick: execution-dialog
timeout: 10
arguments:
- name: wifi_ssid
type: ascii_sentence
- name: wifi_password
type: ascii_sentence
- title: "Change Hostname and Restart"
icon: "🛜" # wireless
shell: echo "If this works, this web page won't work again until you connect using the new host name after the restart!" && echo && sudo hostnamectl set-hostname {{ hostname }} && sudo reboot now
onclick: execution-dialog
timeout: 10
arguments:
- name: hostname
type: ascii_sentence
- title: "Ping a Host or IP address"
icon: "🛜" # wireless
# shell: echo "This will run for 15 seconds" && ping {{ hostname_or_ip_address }}
shell: ping {{ hostname_or_ip_address }}
onclick: execution-dialog
timeout: 15
arguments:
- name: hostname_or_ip_address
type: ascii_sentence
- title: "See Running Processes"
icon: logs
# shell: echo "This command will timeout after 15 seconds" && top
shell: top -b -n 1 2>&1
onclick: execution-dialog
timeout: 15
- title: "CubeSatSim Directory"
icon: logs
shell: ls -all /home/pi/CubeSatSim
onclick: execution-dialog
timeout: 15
- title: "Show PiOS Boot Files"
icon: logs
shell: /home/pi/CubeSatSim/config -w
onclick: execution-dialog
timeout: 15
- title: "Show Available WiFi Networks"
icon: "🛜" # wireless
shell: sudo nmcli device wifi rescan && nmcli device wifi list
onclick: execution-dialog
timeout: 10
# - title: "Signin to Raspberry Pi Connect"
# icon: "🍓" # strawberry
# shell: sudo su pi - rpi-connect signin
# onclick: execution-dialog
# timeout: 60
# - title: "Signout of Raspberry Pi Connect"
# icon: "🍓" # strawberry
# shell: sudo su pi - rpi-connect signout
# onclick: execution-dialog
# timeout: 10
# - title: "Status of Raspberry Pi Connect"
# icon: "🍓" # strawberry
# shell: sudo su pi - rpi-connect doctor
# onclick: execution-dialog
# timeout: 60
- title: "Show Network Configuration"
icon: "🛜" # wireless
shell: ifconfig
onclick: execution-dialog
timeout: 10
- title: "List Audio Devices Speakers and Microphones"
icon: "🔉" # speaker
shell: aplay -l && arecord -l
onclick: execution-dialog
timeout: 10
- title: "List USB Devices"
icon: logs
shell: lsusb
onclick: execution-dialog
timeout: 10
- title: "Set PL (Private Line) CTCSS/CDCSS"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -P {{ pl_rx }} {{ pl_tx }}
onclick: execution-dialog
timeout: 10
arguments:
- name: pl_rx
type: ascii_sentence
- name: pl_tx
type: ascii_sentence
- title: "Change Callsign"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -c {{ callsign }}
onclick: execution-dialog
timeout: 10
arguments:
- name: callsign
type: ascii_sentence
- title: "Change Latitude and Longitude"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -l {{ latitude }} {{ longitude }}
onclick: execution-dialog
timeout: 10
arguments:
- name: latitude
type: ascii_sentence
- name: longitude
type: ascii_sentence
- title: "Realtime CubeSatSim Log"
shell: /home/pi/CubeSatSim/log -d r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "CubeSatSim Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -d
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Transmit Log"
shell: /home/pi/CubeSatSim/log -t r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Transmit Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -t
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Frequency Control Log"
shell: /home/pi/CubeSatSim/log -r r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Frequency Control Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -r
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Frequency Display Log"
shell: /home/pi/CubeSatSim/log -f r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Frequency Display Log"
shell: /home/pi/CubeSatSim/log -f
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Pacsat Log"
shell: /home/pi/CubeSatSim/log -p r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Pacsat Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -p
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Pushbutton Log"
shell: /home/pi/CubeSatSim/log -b r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Pushbutton Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -b
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Command and Control Log"
shell: /home/pi/CubeSatSim/log -c r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Command and Control Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -c
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Realtime Web (OliveTin) Log"
shell: /home/pi/CubeSatSim/log -o r
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Web (OliveTin) Log"
shell: echo "If this log file is too long, it might timeout. If that happens, try the Realtime Log instead" && /home/pi/CubeSatSim/log -o
icon: logs
onclick: execution-dialog
timeout: 30
- title: "Update CubeSatSim Software"
shell: echo "This will take tens of minutes and only works if connected to internet. It might timeout and need to be run again. You should restart when finished!" && sudo su pi - /home/pi/CubeSatSim/update
icon: "⏳"
onclick: execution-dialog
timeout: 600
- title: "Update CubeSatSim Software to Branch"
shell: echo "This will take tens of minutes and only works if connected to internet. It might timeout and need to be run again. You should restart when finished!" && sudo su pi - /home/pi/CubeSatSim/update {{ branch }}
icon: "⏳"
onclick: execution-dialog
timeout: 600
arguments:
- name: branch
type: ascii_sentence
- title: "Restart CubeSatSim"
shell: echo "Restarting CubeSatSim now!" && sudo reboot now
icon: restart
onclick: execution-dialog
timeout: 10
- title: "Shutdown CubeSatSim"
shell: echo "Shutting Down CubeSatSim now!" && sudo shutdown now
icon: restart
onclick: execution-dialog
timeout: 10
- title: "Restart CubeSatSim Software"
shell: /home/pi/CubeSatSim/config -i
icon: restart
onclick: execution-dialog
timeout: 10
- title: "Scan I2C Bus"
shell: /home/pi/CubeSatSim/config -S
icon: logs
onclick: execution-dialog
timeout: 600
- title: "Clear Logs and Restart"
shell: /home/pi/CubeSatSim/config -C
icon: restart
onclick: execution-dialog
timeout: 10
- title: "Display Squelch"
shell: /home/pi/CubeSatSim/config -Q
icon: logs
onclick: execution-dialog
timeout: 15
- title: "Display Payload Sensor Data"
shell: /home/pi/CubeSatSim/config -p
icon: logs
onclick: execution-dialog
timeout: 15
- title: "Display Voltage and Current Data"
shell: /home/pi/CubeSatSim/config -v
icon: logs
onclick: execution-dialog
timeout: 15
- title: "Reset the Pacsat Configuration"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -k
onclick: execution-dialog
timeout: 10
- title: "Reset the Commands Count"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -R yes
onclick: execution-dialog
timeout: 10
- title: "Turn Simulated Telemetry ON"
shell: /home/pi/CubeSatSim/config -t yes
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Simulated Telemetry OFF"
shell: /home/pi/CubeSatSim/config -t no
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Turn Balloon Mode ON"
shell: /home/pi/CubeSatSim/config -H yes
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Balloon Mode OFF"
shell: /home/pi/CubeSatSim/config -H no
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Next Mode or Failure Mode"
shell: /home/pi/CubeSatSim/config -N
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn gpsd ON"
shell: /home/pi/CubeSatSim/config -u yes
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 30
- title: "Turn gpsd OFF"
shell: /home/pi/CubeSatSim/config -u no
icon: "❌" # red X
onclick: execution-dialog
timeout: 30
- title: "Turn Command and Control ON"
shell: /home/pi/CubeSatSim/config -T yes
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Command and Control OFF"
shell: /home/pi/CubeSatSim/config -T no
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Turn Command and Control Direwolf ON"
shell: /home/pi/CubeSatSim/config -d yes
icon: "🟢" # green ball
onclick: execution-dialog
timeout: 10
- title: "Turn Command and Control Direwolf OFF"
shell: /home/pi/CubeSatSim/config -d no
icon: "❌" # red X
onclick: execution-dialog
timeout: 10
- title: "Set FoxTelem Reset Count"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -r {{ resets }}
onclick: execution-dialog
timeout: 10
arguments:
- name: resets
type: ascii_sentence
- title: "Set Squelch Level"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -q {{ squelch }}
onclick: execution-dialog
timeout: 10
arguments:
- name: squelch
type: ascii_sentence
- title: "Set Microphone Level for Command and Control"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -L {{ mic_level }}
onclick: execution-dialog
timeout: 10
arguments:
- name: mic_level
type: ascii_sentence
- title: "Set Simulated Failure Mode"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -M {{ failure_mode }}
onclick: execution-dialog
timeout: 10
arguments:
- name: failure_mode
type: ascii_sentence
- title: "Set maxcpus Value"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -V {{ maxcpus_value }}
onclick: execution-dialog
timeout: 10
arguments:
- name: maxcpus_value
type: ascii_sentence
- title: "Turn Simulated Failure Mode OFF"
icon: "❌" # red X
shell: /home/pi/CubeSatSim/config -M 0
onclick: execution-dialog
timeout: 10
- title: "Turn Random Simulated Failure Mode ON"
icon: "🟢" # green ball
shell: /home/pi/CubeSatSim/config -U yes {{ random_time_in_seconds }}
onclick: execution-dialog
timeout: 10
arguments:
- name: random_time_in_seconds
type: ascii_sentence
- title: "Turn Random Simulated Failure Mode OFF"
icon: "❌" # red X
shell: /home/pi/CubeSatSim/config -U no
onclick: execution-dialog
timeout: 10
- title: "Change Telemetry Beacon Transmit State"
icon: "⚙" # gear
shell: /home/pi/CubeSatSim/config -o
onclick: execution-dialog
timeout: 10
- title: "Take Camera Photo for PacSat"
shell: /home/pi/CubeSatSim/config -z
icon: "📷" # camera
onclick: execution-dialog
timeout: 30
- title: "Raspberry Pi Software and Hardware"
shell: hostnamectl && echo && cat /sys/firmware/devicetree/base/model && echo
icon: logs
onclick: execution-dialog
timeout: 30
dashboards:
- title: CubeSatSim Dashboard
contents:
- title: Show Configuration
contents:
- title: "Show CubeSatSim Config"
- title: Mode Changes
contents:
- title: "Change Mode to APRS"
- title: "Change Mode to FSK"
- title: "Change Mode to BPSK"
- title: "Change Mode to SSTV"
- title: "Change Mode to CW"
- title: "Change Mode to FUNcube"
- title: "Change Mode to Repeater"
- title: "Change Mode to Pacsat"
- title: "Change Mode to Pacsat Ground Station"
- title: Settings
contents:
- title: "Change Callsign"
- title: "Change Latitude and Longitude"
- title: "Change TX and RX Frequency"
- title: "Set FoxTelem Reset Count"
- title: "Set Squelch Level"
- title: "Set PL (Private Line) CTCSS/CDCSS"
- title: "Reset the Commands Count"
- title: "Reset the Pacsat Configuration"
- title: "Change Telemetry Beacon Transmit State"
- title: "Set Microphone Level for Command and Control"
- title: "Turn Simulated Telemetry ON"
- title: "Turn Simulated Telemetry OFF"
- title: "Set Simulated Failure Mode"
- title: "Turn Simulated Failure Mode OFF"
- title: "Turn Random Simulated Failure Mode ON"
- title: "Turn Random Simulated Failure Mode OFF"
- title: "Next Mode or Failure Mode"
- title: "Turn Simulated Doppler Mode ON"
- title: "Turn Radio Control Doppler Mode ON"
- title: "Turn Doppler Mode OFF"
- title: "Turn Command and Control ON"
- title: "Turn Command and Control OFF"
- title: "Turn Command and Control Direwolf ON"
- title: "Turn Command and Control Direwolf OFF"
- title: "Turn Battery Saver Mode ON"
- title: "Turn Battery Saver Mode OFF"
- title: "Turn Balloon Mode ON"
- title: "Turn Balloon Mode OFF"
- title: "Turn gpsd ON"
- title: "Turn gpsd OFF"
- title: "Set maxcpus Value"
- title: "Show All Commands"
- title: "General CubeSatSim Config"
- title: "Take Camera Photo for PacSat"
- title: Logs
contents:
- title: Static Logs
contents:
- title: "CubeSatSim Log"
- title: "Transmit Log"
- title: "Command and Control Log"
- title: "Pacsat Log"
- title: "Frequency Control Log"
- title: "Frequency Display Log"
- title: "Pushbutton Log"
- title: "Web (OliveTin) Log"
- title: Realtime Logs
contents:
- title: "Realtime CubeSatSim Log"
- title: "Realtime Transmit Log"
- title: "Realtime Command and Control Log"
- title: "Realtime Pacsat Log"
- title: "Realtime Frequency Control Log"
- title: "Realtime Frequency Display Log"
- title: "Realtime Pushbutton Log"
- title: "Realtime Web (OliveTin) Log"
- title: Diagnostics
contents:
- title: "Scan I2C Bus"
- title: "Display Squelch"
- title: "Display Payload Sensor Data"
- title: "Display Voltage and Current Data"
- title: "List Audio Devices Speakers and Microphones"
- title: "List USB Devices"
- title: Utilitites
contents:
- title: "Update CubeSatSim Software"
- title: "Update CubeSatSim Software to Branch"
- title: "Restart CubeSatSim"
- title: "Shutdown CubeSatSim"
- title: "Restart CubeSatSim Software"
- title: "Clear Logs and Restart"
- title: "Connect to WiFi using SSID and Password"
- title: "Change Hostname and Restart"
- title: "Show Network Configuration"
- title: "Show Available WiFi Networks"
- title: "Ping a Host or IP address"
- title: "See Running Processes"
- title: "Show PiOS Boot Files"
- title: "CubeSatSim Directory"
- title: "Raspberry Pi Software and Hardware"
# - title: "Signin to Raspberry Pi Connect" # OliveTin needs to run as pi
# - title: "Signout of Raspberry Pi Connect"
# - title: "Status of Raspberry Pi Connect"

@ -0,0 +1,18 @@
Welcome!
Hello, and welcome to the CubeSatSim Pacsat Simulator!
Here's what you can do with your PacSatSim:
1. Downlink a Message by clicking on the message then the "FILE" button. When it is Downlinked, the Message will show as "New". If you double click on it you can view it and save it to your computer using the 'Export' button.
2. Uplink a Message using the "New Msg" button. Under "Select Type" select "ASCII", type your message and then "Send"
3. Reply to a Message by first Downlinking the message using the "FILE" button, then opening the Message and selecting "Reply" then "Send"
4. Uplink a File using the "New Msg" button. Under "Select Type" select "JPG" or "BINARY". Remember the link is just 1200 bps, so don't try to Uplink anything larger than a few kilobytes. You could Downlink the SSTV image and try Uplinking it.
5. Send a Command using the "Command" button. Under "Type" select "File System". Under "Commands" you can try "Pacsat Broadcast" then try setting "stop" or "start" then click "Send" to send the Command. Or under "Type" select "File Uploads". You can select "Off" or "All Stations" and click "Send" to send the Command. You can restore using config -k
6. You can clear the current Pacsat Directory. You can always restore the default Directory contents running CubeSatSim/config -k and selecting Option 4 Reset PacSat Satellite. Using the "Command" button, select "Delete Folder Contents" then select "PACSAT dir" and then "Send" to send the Command.
You can post questions and comments on the CubeSatSim Discussions Board https://github.com/alanbjohnston/CubeSatSim/discussions
73,
Alan
KU2Y

@ -22,6 +22,7 @@ pcm.softvol {
pcm.shared_speaker {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "hw:CARD=Device,DEV=0"
rate 48000
@ -32,15 +33,28 @@ pcm.shared_speaker {
}
# Recording with input mixing
pcm.shared_mic {
pcm.shared_mic_raw {
type dsnoop
ipc_key 2048
ipc_perm 0666
slave {
pcm "hw:CARD=Device,DEV=0"
# channels 1
channels 1
rate 48000
period_time 0
period_size 1024
buffer_size 4096
}
}
pcm.shared_mic {
type softvol
slave.pcm "shared_mic_raw"
control {
name "MicVolume"
card 2
}
}

@ -1,9 +1,17 @@
#!/bin/bash
echo -e "\nCommand and Control script for CubeSatSim v2.1\n"
echo -e "\nCommand and Control script for CubeSatSim v2.3\n"
sudo modprobe snd-aloop
sudo modprobe snd-aloop
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
MODE=$1
FILE=/home/pi/CubeSatSim/command_control
if [ -f "$FILE" ]; then
echo "Radio command and control is ON"
@ -52,17 +60,19 @@ fi
FILE=/home/pi/CubeSatSim/command_control_direwolf
if [[ $(arecord -l | grep "USB Audio Device") ]] && [ -f "$FILE" ]; then
/home/pi/CubeSatSim/config -L -1
echo "Starting Direwolf DTMF and APRS Command and Control"
if [ "$debug" = "1" ]; then
echo "debug mode"
direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d
direwolf -D3 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | /home/pi/venv/bin/python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d
else
direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py
direwolf -D3 -r 48000 -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | /home/pi/venv/bin/python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py
fi
else
@ -107,11 +117,11 @@ else
# echo "debug mode"
# direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d
# direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf.conf -t 0l | /home/pi/venv/bin/python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py d
# else
# direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf.conf -t 0l | python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py
# direwolf -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf.conf -t 0l | /home/pi/venv/bin/python3 /home/pi/CubeSatSim/dtmf_aprs_cc.py
# fi
@ -124,17 +134,32 @@ else
fi
if [ "$1" = "d" ]; then
echo "debug mode"
python3 /home/pi/CubeSatSim/squelch_cc.py d
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
MODE=$1
if [ ! "$MODE" = "P" ] && [ ! "$MODE" = "P" ] ; then
if [ "$1" = "d" ]; then
echo "debug mode"
/home/pi/venv/bin/python3 /home/pi/CubeSatSim/squelch_cc.py d
else
/home/pi/venv/bin/python3 /home/pi/CubeSatSim/squelch_cc.py
fi
else
python3 /home/pi/CubeSatSim/squelch_cc.py
fi
echo "Not running Carrier (squelch) Command and Control since PacSat or PacSat Ground Station mode!"
sleep 60
fi
fi
sudo killall -9 direwolf &>/dev/null

1613
config

File diff suppressed because it is too large Load Diff

@ -1,2 +1,9 @@
ADEVICE shared_mic hw:CARD=Loopback,DEV=1
DTMF
MYCALL AMSAT
CHANNEL 0
MODEM 1200
FULLDUP OFF
#TXDELAY 0
AGWPORT 8200
KISSPORT 8203

@ -0,0 +1,9 @@
CHANNEL 0
MODEM 1200
DWAIT 0
SLOTTIME 10
PERSIST 63
TXDELAY 30
TXTAIL 10
FULLDUP OFF
DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE

@ -1,4 +1,5 @@
ADEVICE hw:CARD=Loopback,DEV=0 hw:CARD=Headphones,DEV=0
PTT GPIO 20
MYCALL AMSAT
CHANNEL 0
MODEM 1200

@ -1 +0,0 @@
ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0

@ -1,15 +1,20 @@
import sys
from os import system
import RPi.GPIO as GPIO
from RPi.GPIO import output
from time import sleep
import logging
logging.basicConfig(format='%(message)s')
# logging.warning('CC-Warning!')
def blink(times):
for i in range(times):
system("gpio write 27 0")
sleep(0.1)
system("gpio write 27 1")
sleep(0.1)
if __name__ == "__main__":
powerPin = 16
txLed = 27
txLed = 17
change_mode = False
debug_mode = False
counter = 1
@ -17,252 +22,178 @@ if __name__ == "__main__":
# print("There are arguments!")
if ('d' == sys.argv[1]):
debug_mode = True
for line in sys.stdin:
# if (debug_mode):
print(line, end =" ")
logging.warning(line)
# if '^c' == line.rstrip():
# break
if ((line.find("MODE=a")) > 0):
system("echo '\nAPRS Mode!!\n'")
mode = 'a'
change_mode = True
if ((line.find("DTMF>APDW15:t1#")) > 0):
system("echo '\nAPRS Mode!!\n'")
mode = 'a'
change_mode = True
if ((line.find("MODE=f")) > 0):
system("echo '\nFSK Mode!!\n'")
mode = 'f'
change_mode = True
if ((line.find("DTMF>APDW15:t2#")) > 0):
system("echo '\nFSK Mode!!\n'")
mode = 'f'
change_mode = True
if ((line.find("MODE=b")) > 0):
system("echo '\nBPSK Mode!!\n'")
mode = 'b'
change_mode = True
if ((line.find("DTMF>APDW15:t3#")) > 0):
system("echo '\nBPSK Mode!!\n'")
mode = 'b'
change_mode = True
if ((line.find("MODE=s")) > 0):
system("echo '\nSSTV Mode!!\n'")
mode = 's'
change_mode = True
if ((line.find("DTMF>APDW15:t4#")) > 0):
system("echo '\nSSTV Mode!!\n'")
mode = 's'
change_mode = True
if ((line.find("MODE=m")) > 0):
system("echo '\nCW Mode!!\n'")
mode = 'm'
change_mode = True
if ((line.find("DTMF>APDW15:t5#")) > 0):
system("echo '\nCW Mode!!\n'")
mode = 'm'
change_mode = True
if ((line.find("MODE=e")) > 0):
system("echo '\nRepeater Mode!!\n'")
mode = 'e'
change_mode = True
if ((line.find("DTMF>APDW15:t6#")) > 0):
system("echo '\nRepeater Mode!!\n'")
mode = 'e'
change_mode = True
if ((line.find("MODE=j")) > 0):
system("echo '\nFUNcube Mode!!\n'")
mode = 'j'
change_mode = True
if ((line.find("DTMF>APDW15:t7#")) > 0):
system("echo '\nFUNcube Mode!!\n'")
mode = 'j'
change_mode = True
if ((line.find("MODE=n")) > 0):
system("echo '\nTransmit Commands Mode!!\n'")
mode = 'n'
change_mode = True
if ((line.find("DTMF>APDW15:t11#")) > 0):
system("echo '\nTransmit Commands Mode!!\n'")
mode = 'n'
change_mode = True
if ((line.find("MODE=o")) > 0):
counter = (counter + 1) % 2 # Direwolf prints it twice, only do once
if (counter == 1):
system("echo '\nBeacon Mode toggle!!\n'")
mode = 'o'
change_mode = True
counter = 1
if ((line.find("DTMF>APDW15:t10#")) > 0):
system("echo '\nBeacon Mode toggle!!\n'")
mode = 'o'
change_mode = True
# if ((debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice
if (debug_mode == False) and (change_mode == True): # skip every other APRS command since Direwolf prints them twice
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(powerPin, GPIO.OUT)
GPIO.setup(txLed, GPIO.OUT)
if (mode == 'f'):
GPIO.output(powerPin, 0) # blink two times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
while True:
try:
for line in sys.stdin:
# if (debug_mode):
print(line, end =" ")
logging.warning(line)
# if '^c' == line.rstrip():
# break
elif (mode == 'b'):
GPIO.output(powerPin, 0) # blink three times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
elif (mode == 's'):
GPIO.output(powerPin, 0) # blink four times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
elif (mode == 'm'):
GPIO.output(powerPin, 0) # blink five times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1);
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
if ((line.find("MODE=a")) > 0):
system("echo '\nAPRS Mode!!\n'")
mode = 'a'
change_mode = True
elif ((line.find(":t1#")) > 0):
system("echo '\nAPRS Mode!!\n'")
mode = 'a'
change_mode = True
elif ((line.find("MODE=f")) > 0):
system("echo '\nFSK Mode!!\n'")
mode = 'f'
change_mode = True
elif ((line.find(":t2#")) > 0):
system("echo '\nFSK Mode!!\n'")
mode = 'f'
change_mode = True
elif ((line.find("MODE=b")) > 0):
system("echo '\nBPSK Mode!!\n'")
mode = 'b'
change_mode = True
elif ((line.find(":t3#")) > 0):
system("echo '\nBPSK Mode!!\n'")
mode = 'b'
change_mode = True
elif ((line.find("MODE=s")) > 0):
system("echo '\nSSTV Mode!!\n'")
mode = 's'
change_mode = True
elif ((line.find(":t4#")) > 0):
system("echo '\nSSTV Mode!!\n'")
mode = 's'
change_mode = True
elif ((line.find("MODE=m")) > 0):
system("echo '\nCW Mode!!\n'")
mode = 'm'
change_mode = True
elif ((line.find(":t5#")) > 0):
system("echo '\nCW Mode!!\n'")
mode = 'm'
change_mode = True
elif ((line.find("MODE=e")) > 0):
system("echo '\nRepeater Mode!!\n'")
mode = 'e'
change_mode = True
elif (mode == 'e'):
GPIO.output(powerPin, 0) # blink six times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1);
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
elif ((line.find(":t6#")) > 0):
system("echo '\nRepeater Mode!!\n'")
mode = 'e'
change_mode = True
elif ((line.find("MODE=j")) > 0):
system("echo '\nFUNcube Mode!!\n'")
mode = 'j'
change_mode = True
elif ((line.find(":t7#")) > 0):
system("echo '\nFUNcube Mode!!\n'")
mode = 'j'
change_mode = True
elif ((line.find("MODE=G")) > 0):
system("echo '\nPacSatSim Mode!!\n'")
mode = 'G'
change_mode = True
elif ((line.find(":t8#")) > 0):
system("echo '\nPacSatSim Mode!!\n'")
mode = 'G'
change_mode = True
elif ((line.find("MODE=n")) > 0):
system("echo '\nTransmit Commands Mode!!\n'")
mode = 'n'
change_mode = True
elif ((line.find(":t11#")) > 0):
system("echo '\nTransmit Commands Mode!!\n'")
mode = 'n'
change_mode = True
elif (mode == 'j'):
GPIO.output(powerPin, 0) # blink seven times
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1);
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
elif (mode == 'a'):
mode = 'a'
GPIO.output(powerPin, 0) # blink one time
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(1)
try:
file = open("/home/pi/CubeSatSim/command_count.txt", "r")
string = file.read()
file.close()
command_count = int(string)
command_count += 1
filec = open("/home/pi/CubeSatSim/command_count.txt", "w")
command_count_string = str(command_count)
print(command_count_string)
string = filec.write(command_count_string)
filec.close()
except:
print("Can't write command_count file!")
print("Command_count: ")
print(command_count)
GPIO.output(txLed, 0)
GPIO.output(powerPin, 0)
system("sudo systemctl stop transmit")
# system("sudo systemctl stop cubesatsim")
print("\n/home/pi/CubeSatSim/config -" + mode)
system("/home/pi/CubeSatSim/config -" + mode)
elif ((line.find("MODE=o")) > 0):
system("echo '\nBeacon Mode toggle!!\n'")
mode = 'o'
change_mode = True
# counter = (counter + 1) % 2
elif ((line.find(":t10#")) > 0):
system("echo '\nBeacon Mode toggle!!\n'")
mode = 'o'
change_mode = True
if (debug_mode == False) and (change_mode == True) and (counter == 1): # skip every other APRS command since Direwolf prints them twice
if (mode == 'f'):
blink(2)
sleep(1)
elif (mode == 'b'):
blink(3)
sleep(1)
elif (mode == 's'):
blink(4)
sleep(1)
elif (mode == 'm'):
blink(5)
sleep(1)
elif (mode == 'e'):
blink(6)
sleep(1)
elif (mode == 'j'):
blink(7)
sleep(1)
elif (mode == 'p'):
blink(8)
sleep(1)
elif (mode == 'a'):
blink(1)
sleep(1)
try:
file = open("/home/pi/CubeSatSim/command_count.txt", "r")
string = file.read()
file.close()
command_count = int(string)
command_count += 1
filec = open("/home/pi/CubeSatSim/command_count.txt", "w")
command_count_string = str(command_count)
print(command_count_string)
string = filec.write(command_count_string)
filec.close()
except:
print("Can't write command_count file!")
print("Command_count: ")
print(command_count)
system("gpio write " + str(txLed) + " 0")
system("gpio write " + str(powerPin) + " 0")
system("sudo systemctl stop transmit")
# system("sudo systemctl stop cubesatsim")
print("\n/home/pi/CubeSatSim/config -" + mode)
system("/home/pi/CubeSatSim/config -" + mode)
change_mode = False
except:
print("Error reading line (probably due to UTF-8 issue)")
change_mode = False
print("Waiting 5 seconds to allow unplug and plug of soundcard")
sleep(5)
print("Done")

@ -0,0 +1,869 @@
#!/usr/bin/env python
#import subprocess
import time
from time import sleep
#import os
import sys
from os import system
def check_frequency():
global tx_doppler_freq_hz
global rx_doppler_freq_hz
tx_OK = False
rx_OK = False
if tx_doppler_freq_hz > 450000000:
tx_doppler_freq_hz = 435200000
elif (tx_doppler_freq_hz < 420000000) and (tx_doppler_freq_hz > 148000000):
tx_doppler_freq_hz = 434700000
elif (tx_doppler_freq_hz < 144000000):
tx_doppler_freq_hz = 434600000
else:
tx_OK = True
if rx_doppler_freq_hz > 450000000:
rx_doppler_freq_hz = 435200000
elif (rx_doppler_freq_hz < 420000000) and (rx_doppler_freq_hz > 148000000):
rx_doppler_freq_hz = 434700000
elif (rx_doppler_freq_hz < 144000000):
rx_doppler_freq_hz = 434600000
else:
rx_OK = True
if (tx_OK != True) or (rx_OK != True):
print("Error - frequency out of range!")
iss_doppler_passes = {
88: [
{"time_sec": 1, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 2, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 3, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 4, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 5, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 6, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 7, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 8, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 9, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 10, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 11, "doppler_434_khz": 9987, "doppler_144_khz": 3329},
{"time_sec": 12, "doppler_434_khz": 9986, "doppler_144_khz": 3329},
{"time_sec": 13, "doppler_434_khz": 9986, "doppler_144_khz": 3329},
{"time_sec": 14, "doppler_434_khz": 9986, "doppler_144_khz": 3329},
{"time_sec": 15, "doppler_434_khz": 9986, "doppler_144_khz": 3329},
{"time_sec": 16, "doppler_434_khz": 9986, "doppler_144_khz": 3329},
{"time_sec": 17, "doppler_434_khz": 9985, "doppler_144_khz": 3328},
{"time_sec": 18, "doppler_434_khz": 9985, "doppler_144_khz": 3328},
{"time_sec": 19, "doppler_434_khz": 9985, "doppler_144_khz": 3328},
{"time_sec": 20, "doppler_434_khz": 9985, "doppler_144_khz": 3328},
{"time_sec": 21, "doppler_434_khz": 9984, "doppler_144_khz": 3328},
{"time_sec": 22, "doppler_434_khz": 9984, "doppler_144_khz": 3328},
{"time_sec": 23, "doppler_434_khz": 9984, "doppler_144_khz": 3328},
{"time_sec": 24, "doppler_434_khz": 9984, "doppler_144_khz": 3328},
{"time_sec": 25, "doppler_434_khz": 9983, "doppler_144_khz": 3328},
{"time_sec": 26, "doppler_434_khz": 9983, "doppler_144_khz": 3328},
{"time_sec": 27, "doppler_434_khz": 9983, "doppler_144_khz": 3328},
{"time_sec": 28, "doppler_434_khz": 9982, "doppler_144_khz": 3327},
{"time_sec": 29, "doppler_434_khz": 9982, "doppler_144_khz": 3327},
{"time_sec": 30, "doppler_434_khz": 9982, "doppler_144_khz": 3327},
{"time_sec": 31, "doppler_434_khz": 9981, "doppler_144_khz": 3327},
{"time_sec": 32, "doppler_434_khz": 9981, "doppler_144_khz": 3327},
{"time_sec": 33, "doppler_434_khz": 9980, "doppler_144_khz": 3327},
{"time_sec": 34, "doppler_434_khz": 9980, "doppler_144_khz": 3327},
{"time_sec": 35, "doppler_434_khz": 9979, "doppler_144_khz": 3326},
{"time_sec": 36, "doppler_434_khz": 9979, "doppler_144_khz": 3326},
{"time_sec": 37, "doppler_434_khz": 9978, "doppler_144_khz": 3326},
{"time_sec": 38, "doppler_434_khz": 9978, "doppler_144_khz": 3326},
{"time_sec": 39, "doppler_434_khz": 9977, "doppler_144_khz": 3326},
{"time_sec": 40, "doppler_434_khz": 9977, "doppler_144_khz": 3326},
{"time_sec": 41, "doppler_434_khz": 9976, "doppler_144_khz": 3325},
{"time_sec": 42, "doppler_434_khz": 9975, "doppler_144_khz": 3325},
{"time_sec": 43, "doppler_434_khz": 9975, "doppler_144_khz": 3325},
{"time_sec": 44, "doppler_434_khz": 9974, "doppler_144_khz": 3325},
{"time_sec": 45, "doppler_434_khz": 9973, "doppler_144_khz": 3324},
{"time_sec": 46, "doppler_434_khz": 9973, "doppler_144_khz": 3324},
{"time_sec": 47, "doppler_434_khz": 9972, "doppler_144_khz": 3324},
{"time_sec": 48, "doppler_434_khz": 9972, "doppler_144_khz": 3324},
{"time_sec": 49, "doppler_434_khz": 9971, "doppler_144_khz": 3324},
{"time_sec": 50, "doppler_434_khz": 9970, "doppler_144_khz": 3323},
{"time_sec": 51, "doppler_434_khz": 9969, "doppler_144_khz": 3323},
{"time_sec": 52, "doppler_434_khz": 9969, "doppler_144_khz": 3323},
{"time_sec": 53, "doppler_434_khz": 9968, "doppler_144_khz": 3323},
{"time_sec": 54, "doppler_434_khz": 9967, "doppler_144_khz": 3322},
{"time_sec": 55, "doppler_434_khz": 9966, "doppler_144_khz": 3322},
{"time_sec": 56, "doppler_434_khz": 9966, "doppler_144_khz": 3322},
{"time_sec": 57, "doppler_434_khz": 9964, "doppler_144_khz": 3321},
{"time_sec": 58, "doppler_434_khz": 9963, "doppler_144_khz": 3321},
{"time_sec": 59, "doppler_434_khz": 9963, "doppler_144_khz": 3321},
{"time_sec": 60, "doppler_434_khz": 9962, "doppler_144_khz": 3321},
{"time_sec": 61, "doppler_434_khz": 9961, "doppler_144_khz": 3320},
{"time_sec": 62, "doppler_434_khz": 9959, "doppler_144_khz": 3320},
{"time_sec": 63, "doppler_434_khz": 9959, "doppler_144_khz": 3320},
{"time_sec": 64, "doppler_434_khz": 9958, "doppler_144_khz": 3319},
{"time_sec": 65, "doppler_434_khz": 9957, "doppler_144_khz": 3319},
{"time_sec": 66, "doppler_434_khz": 9955, "doppler_144_khz": 3318},
{"time_sec": 67, "doppler_434_khz": 9954, "doppler_144_khz": 3318},
{"time_sec": 68, "doppler_434_khz": 9953, "doppler_144_khz": 3318},
{"time_sec": 69, "doppler_434_khz": 9952, "doppler_144_khz": 3317},
{"time_sec": 70, "doppler_434_khz": 9951, "doppler_144_khz": 3317},
{"time_sec": 71, "doppler_434_khz": 9950, "doppler_144_khz": 3317},
{"time_sec": 72, "doppler_434_khz": 9949, "doppler_144_khz": 3316},
{"time_sec": 73, "doppler_434_khz": 9948, "doppler_144_khz": 3316},
{"time_sec": 74, "doppler_434_khz": 9946, "doppler_144_khz": 3315},
{"time_sec": 75, "doppler_434_khz": 9945, "doppler_144_khz": 3315},
{"time_sec": 76, "doppler_434_khz": 9943, "doppler_144_khz": 3314},
{"time_sec": 77, "doppler_434_khz": 9942, "doppler_144_khz": 3314},
{"time_sec": 78, "doppler_434_khz": 9941, "doppler_144_khz": 3314},
{"time_sec": 79, "doppler_434_khz": 9939, "doppler_144_khz": 3313},
{"time_sec": 80, "doppler_434_khz": 9938, "doppler_144_khz": 3313},
{"time_sec": 81, "doppler_434_khz": 9937, "doppler_144_khz": 3312},
{"time_sec": 82, "doppler_434_khz": 9936, "doppler_144_khz": 3312},
{"time_sec": 83, "doppler_434_khz": 9933, "doppler_144_khz": 3311},
{"time_sec": 84, "doppler_434_khz": 9932, "doppler_144_khz": 3311},
{"time_sec": 85, "doppler_434_khz": 9931, "doppler_144_khz": 3310},
{"time_sec": 86, "doppler_434_khz": 9929, "doppler_144_khz": 3310},
{"time_sec": 87, "doppler_434_khz": 9927, "doppler_144_khz": 3309},
{"time_sec": 88, "doppler_434_khz": 9925, "doppler_144_khz": 3308},
{"time_sec": 89, "doppler_434_khz": 9924, "doppler_144_khz": 3308},
{"time_sec": 90, "doppler_434_khz": 9923, "doppler_144_khz": 3308},
{"time_sec": 91, "doppler_434_khz": 9920, "doppler_144_khz": 3307},
{"time_sec": 92, "doppler_434_khz": 9918, "doppler_144_khz": 3306},
{"time_sec": 93, "doppler_434_khz": 9917, "doppler_144_khz": 3306},
{"time_sec": 94, "doppler_434_khz": 9915, "doppler_144_khz": 3305},
{"time_sec": 95, "doppler_434_khz": 9912, "doppler_144_khz": 3304},
{"time_sec": 96, "doppler_434_khz": 9911, "doppler_144_khz": 3304},
{"time_sec": 97, "doppler_434_khz": 9909, "doppler_144_khz": 3303},
{"time_sec": 98, "doppler_434_khz": 9907, "doppler_144_khz": 3302},
{"time_sec": 99, "doppler_434_khz": 9906, "doppler_144_khz": 3302},
{"time_sec": 100, "doppler_434_khz": 9903, "doppler_144_khz": 3301},
{"time_sec": 101, "doppler_434_khz": 9901, "doppler_144_khz": 3300},
{"time_sec": 102, "doppler_434_khz": 9899, "doppler_144_khz": 3300},
{"time_sec": 103, "doppler_434_khz": 9897, "doppler_144_khz": 3299},
{"time_sec": 104, "doppler_434_khz": 9894, "doppler_144_khz": 3298},
{"time_sec": 105, "doppler_434_khz": 9892, "doppler_144_khz": 3297},
{"time_sec": 106, "doppler_434_khz": 9890, "doppler_144_khz": 3297},
{"time_sec": 107, "doppler_434_khz": 9888, "doppler_144_khz": 3296},
{"time_sec": 108, "doppler_434_khz": 9884, "doppler_144_khz": 3295},
{"time_sec": 109, "doppler_434_khz": 9882, "doppler_144_khz": 3294},
{"time_sec": 110, "doppler_434_khz": 9880, "doppler_144_khz": 3293},
{"time_sec": 111, "doppler_434_khz": 9878, "doppler_144_khz": 3293},
{"time_sec": 112, "doppler_434_khz": 9874, "doppler_144_khz": 3291},
{"time_sec": 113, "doppler_434_khz": 9872, "doppler_144_khz": 3291},
{"time_sec": 114, "doppler_434_khz": 9870, "doppler_144_khz": 3290},
{"time_sec": 115, "doppler_434_khz": 9868, "doppler_144_khz": 3289},
{"time_sec": 116, "doppler_434_khz": 9864, "doppler_144_khz": 3288},
{"time_sec": 117, "doppler_434_khz": 9861, "doppler_144_khz": 3287},
{"time_sec": 118, "doppler_434_khz": 9859, "doppler_144_khz": 3286},
{"time_sec": 119, "doppler_434_khz": 9857, "doppler_144_khz": 3286},
{"time_sec": 120, "doppler_434_khz": 9852, "doppler_144_khz": 3284},
{"time_sec": 121, "doppler_434_khz": 9850, "doppler_144_khz": 3283},
{"time_sec": 122, "doppler_434_khz": 9847, "doppler_144_khz": 3282},
{"time_sec": 123, "doppler_434_khz": 9845, "doppler_144_khz": 3282},
{"time_sec": 124, "doppler_434_khz": 9842, "doppler_144_khz": 3281},
{"time_sec": 125, "doppler_434_khz": 9837, "doppler_144_khz": 3279},
{"time_sec": 126, "doppler_434_khz": 9834, "doppler_144_khz": 3278},
{"time_sec": 127, "doppler_434_khz": 9832, "doppler_144_khz": 3277},
{"time_sec": 128, "doppler_434_khz": 9829, "doppler_144_khz": 3276},
{"time_sec": 129, "doppler_434_khz": 9823, "doppler_144_khz": 3274},
{"time_sec": 130, "doppler_434_khz": 9821, "doppler_144_khz": 3274},
{"time_sec": 131, "doppler_434_khz": 9818, "doppler_144_khz": 3273},
{"time_sec": 132, "doppler_434_khz": 9815, "doppler_144_khz": 3272},
{"time_sec": 133, "doppler_434_khz": 9812, "doppler_144_khz": 3271},
{"time_sec": 134, "doppler_434_khz": 9806, "doppler_144_khz": 3269},
{"time_sec": 135, "doppler_434_khz": 9803, "doppler_144_khz": 3268},
{"time_sec": 136, "doppler_434_khz": 9800, "doppler_144_khz": 3267},
{"time_sec": 137, "doppler_434_khz": 9796, "doppler_144_khz": 3265},
{"time_sec": 138, "doppler_434_khz": 9790, "doppler_144_khz": 3263},
{"time_sec": 139, "doppler_434_khz": 9787, "doppler_144_khz": 3262},
{"time_sec": 140, "doppler_434_khz": 9783, "doppler_144_khz": 3261},
{"time_sec": 141, "doppler_434_khz": 9780, "doppler_144_khz": 3260},
{"time_sec": 142, "doppler_434_khz": 9773, "doppler_144_khz": 3258},
{"time_sec": 143, "doppler_434_khz": 9769, "doppler_144_khz": 3256},
{"time_sec": 144, "doppler_434_khz": 9766, "doppler_144_khz": 3255},
{"time_sec": 145, "doppler_434_khz": 9762, "doppler_144_khz": 3254},
{"time_sec": 146, "doppler_434_khz": 9759, "doppler_144_khz": 3253},
{"time_sec": 147, "doppler_434_khz": 9751, "doppler_144_khz": 3250},
{"time_sec": 148, "doppler_434_khz": 9747, "doppler_144_khz": 3249},
{"time_sec": 149, "doppler_434_khz": 9743, "doppler_144_khz": 3248},
{"time_sec": 150, "doppler_434_khz": 9739, "doppler_144_khz": 3246},
{"time_sec": 151, "doppler_434_khz": 9731, "doppler_144_khz": 3244},
{"time_sec": 152, "doppler_434_khz": 9727, "doppler_144_khz": 3242},
{"time_sec": 153, "doppler_434_khz": 9723, "doppler_144_khz": 3241},
{"time_sec": 154, "doppler_434_khz": 9719, "doppler_144_khz": 3240},
{"time_sec": 155, "doppler_434_khz": 9715, "doppler_144_khz": 3238},
{"time_sec": 156, "doppler_434_khz": 9706, "doppler_144_khz": 3235},
{"time_sec": 157, "doppler_434_khz": 9701, "doppler_144_khz": 3234},
{"time_sec": 158, "doppler_434_khz": 9697, "doppler_144_khz": 3232},
{"time_sec": 159, "doppler_434_khz": 9692, "doppler_144_khz": 3231},
{"time_sec": 160, "doppler_434_khz": 9683, "doppler_144_khz": 3228},
{"time_sec": 161, "doppler_434_khz": 9678, "doppler_144_khz": 3226},
{"time_sec": 162, "doppler_434_khz": 9673, "doppler_144_khz": 3224},
{"time_sec": 163, "doppler_434_khz": 9668, "doppler_144_khz": 3223},
{"time_sec": 164, "doppler_434_khz": 9658, "doppler_144_khz": 3219},
{"time_sec": 165, "doppler_434_khz": 9653, "doppler_144_khz": 3218},
{"time_sec": 166, "doppler_434_khz": 9647, "doppler_144_khz": 3216},
{"time_sec": 167, "doppler_434_khz": 9642, "doppler_144_khz": 3214},
{"time_sec": 168, "doppler_434_khz": 9637, "doppler_144_khz": 3212},
{"time_sec": 169, "doppler_434_khz": 9626, "doppler_144_khz": 3209},
{"time_sec": 170, "doppler_434_khz": 9620, "doppler_144_khz": 3207},
{"time_sec": 171, "doppler_434_khz": 9614, "doppler_144_khz": 3205},
{"time_sec": 172, "doppler_434_khz": 9608, "doppler_144_khz": 3203},
{"time_sec": 173, "doppler_434_khz": 9597, "doppler_144_khz": 3199},
{"time_sec": 174, "doppler_434_khz": 9590, "doppler_144_khz": 3197},
{"time_sec": 175, "doppler_434_khz": 9584, "doppler_144_khz": 3195},
{"time_sec": 176, "doppler_434_khz": 9578, "doppler_144_khz": 3193},
{"time_sec": 177, "doppler_434_khz": 9572, "doppler_144_khz": 3191},
{"time_sec": 178, "doppler_434_khz": 9559, "doppler_144_khz": 3186},
{"time_sec": 179, "doppler_434_khz": 9552, "doppler_144_khz": 3184},
{"time_sec": 180, "doppler_434_khz": 9545, "doppler_144_khz": 3182},
{"time_sec": 181, "doppler_434_khz": 9539, "doppler_144_khz": 3180},
{"time_sec": 182, "doppler_434_khz": 9525, "doppler_144_khz": 3175},
{"time_sec": 183, "doppler_434_khz": 9518, "doppler_144_khz": 3173},
{"time_sec": 184, "doppler_434_khz": 9510, "doppler_144_khz": 3170},
{"time_sec": 185, "doppler_434_khz": 9503, "doppler_144_khz": 3168},
{"time_sec": 186, "doppler_434_khz": 9488, "doppler_144_khz": 3163},
{"time_sec": 187, "doppler_434_khz": 9480, "doppler_144_khz": 3160},
{"time_sec": 188, "doppler_434_khz": 9472, "doppler_144_khz": 3157},
{"time_sec": 189, "doppler_434_khz": 9464, "doppler_144_khz": 3155},
{"time_sec": 190, "doppler_434_khz": 9456, "doppler_144_khz": 3152},
{"time_sec": 191, "doppler_434_khz": 9440, "doppler_144_khz": 3147},
{"time_sec": 192, "doppler_434_khz": 9432, "doppler_144_khz": 3144},
{"time_sec": 193, "doppler_434_khz": 9423, "doppler_144_khz": 3141},
{"time_sec": 194, "doppler_434_khz": 9414, "doppler_144_khz": 3138},
{"time_sec": 195, "doppler_434_khz": 9396, "doppler_144_khz": 3132},
{"time_sec": 196, "doppler_434_khz": 9387, "doppler_144_khz": 3129},
{"time_sec": 197, "doppler_434_khz": 9378, "doppler_144_khz": 3126},
{"time_sec": 198, "doppler_434_khz": 9369, "doppler_144_khz": 3123},
{"time_sec": 199, "doppler_434_khz": 9349, "doppler_144_khz": 3116},
{"time_sec": 200, "doppler_434_khz": 9339, "doppler_144_khz": 3113},
{"time_sec": 201, "doppler_434_khz": 9329, "doppler_144_khz": 3110},
{"time_sec": 202, "doppler_434_khz": 9318, "doppler_144_khz": 3106},
{"time_sec": 203, "doppler_434_khz": 9308, "doppler_144_khz": 3103},
{"time_sec": 204, "doppler_434_khz": 9287, "doppler_144_khz": 3096},
{"time_sec": 205, "doppler_434_khz": 9276, "doppler_144_khz": 3092},
{"time_sec": 206, "doppler_434_khz": 9265, "doppler_144_khz": 3088},
{"time_sec": 207, "doppler_434_khz": 9254, "doppler_144_khz": 3085},
{"time_sec": 208, "doppler_434_khz": 9230, "doppler_144_khz": 3077},
{"time_sec": 209, "doppler_434_khz": 9218, "doppler_144_khz": 3073},
{"time_sec": 210, "doppler_434_khz": 9206, "doppler_144_khz": 3069},
{"time_sec": 211, "doppler_434_khz": 9194, "doppler_144_khz": 3065},
{"time_sec": 212, "doppler_434_khz": 9182, "doppler_144_khz": 3061},
{"time_sec": 213, "doppler_434_khz": 9156, "doppler_144_khz": 3052},
{"time_sec": 214, "doppler_434_khz": 9143, "doppler_144_khz": 3048},
{"time_sec": 215, "doppler_434_khz": 9130, "doppler_144_khz": 3043},
{"time_sec": 216, "doppler_434_khz": 9116, "doppler_144_khz": 3039},
{"time_sec": 217, "doppler_434_khz": 9088, "doppler_144_khz": 3029},
{"time_sec": 218, "doppler_434_khz": 9074, "doppler_144_khz": 3025},
{"time_sec": 219, "doppler_434_khz": 9060, "doppler_144_khz": 3020},
{"time_sec": 220, "doppler_434_khz": 9045, "doppler_144_khz": 3015},
{"time_sec": 221, "doppler_434_khz": 9015, "doppler_144_khz": 3005},
{"time_sec": 222, "doppler_434_khz": 8999, "doppler_144_khz": 3000},
{"time_sec": 223, "doppler_434_khz": 8983, "doppler_144_khz": 2994},
{"time_sec": 224, "doppler_434_khz": 8967, "doppler_144_khz": 2989},
{"time_sec": 225, "doppler_434_khz": 8951, "doppler_144_khz": 2984},
{"time_sec": 226, "doppler_434_khz": 8917, "doppler_144_khz": 2972},
{"time_sec": 227, "doppler_434_khz": 8900, "doppler_144_khz": 2967},
{"time_sec": 228, "doppler_434_khz": 8882, "doppler_144_khz": 2961},
{"time_sec": 229, "doppler_434_khz": 8865, "doppler_144_khz": 2955},
{"time_sec": 230, "doppler_434_khz": 8828, "doppler_144_khz": 2943},
{"time_sec": 231, "doppler_434_khz": 8809, "doppler_144_khz": 2936},
{"time_sec": 232, "doppler_434_khz": 8790, "doppler_144_khz": 2930},
{"time_sec": 233, "doppler_434_khz": 8770, "doppler_144_khz": 2923},
{"time_sec": 234, "doppler_434_khz": 8730, "doppler_144_khz": 2910},
{"time_sec": 235, "doppler_434_khz": 8709, "doppler_144_khz": 2903},
{"time_sec": 236, "doppler_434_khz": 8688, "doppler_144_khz": 2896},
{"time_sec": 237, "doppler_434_khz": 8665, "doppler_144_khz": 2888},
{"time_sec": 238, "doppler_434_khz": 8643, "doppler_144_khz": 2881},
{"time_sec": 239, "doppler_434_khz": 8597, "doppler_144_khz": 2866},
{"time_sec": 240, "doppler_434_khz": 8574, "doppler_144_khz": 2858},
{"time_sec": 241, "doppler_434_khz": 8550, "doppler_144_khz": 2850},
{"time_sec": 242, "doppler_434_khz": 8526, "doppler_144_khz": 2842},
{"time_sec": 243, "doppler_434_khz": 8476, "doppler_144_khz": 2825},
{"time_sec": 244, "doppler_434_khz": 8450, "doppler_144_khz": 2817},
{"time_sec": 245, "doppler_434_khz": 8423, "doppler_144_khz": 2808},
{"time_sec": 246, "doppler_434_khz": 8397, "doppler_144_khz": 2799},
{"time_sec": 247, "doppler_434_khz": 8370, "doppler_144_khz": 2790},
{"time_sec": 248, "doppler_434_khz": 8314, "doppler_144_khz": 2771},
{"time_sec": 249, "doppler_434_khz": 8286, "doppler_144_khz": 2762},
{"time_sec": 250, "doppler_434_khz": 8256, "doppler_144_khz": 2752},
{"time_sec": 251, "doppler_434_khz": 8226, "doppler_144_khz": 2742},
{"time_sec": 252, "doppler_434_khz": 8164, "doppler_144_khz": 2721},
{"time_sec": 253, "doppler_434_khz": 8133, "doppler_144_khz": 2711},
{"time_sec": 254, "doppler_434_khz": 8101, "doppler_144_khz": 2700},
{"time_sec": 255, "doppler_434_khz": 8068, "doppler_144_khz": 2689},
{"time_sec": 256, "doppler_434_khz": 8034, "doppler_144_khz": 2678},
{"time_sec": 257, "doppler_434_khz": 7965, "doppler_144_khz": 2655},
{"time_sec": 258, "doppler_434_khz": 7929, "doppler_144_khz": 2643},
{"time_sec": 259, "doppler_434_khz": 7893, "doppler_144_khz": 2631},
{"time_sec": 260, "doppler_434_khz": 7856, "doppler_144_khz": 2619},
{"time_sec": 261, "doppler_434_khz": 7779, "doppler_144_khz": 2593},
{"time_sec": 262, "doppler_434_khz": 7740, "doppler_144_khz": 2580},
{"time_sec": 263, "doppler_434_khz": 7699, "doppler_144_khz": 2566},
{"time_sec": 264, "doppler_434_khz": 7658, "doppler_144_khz": 2553},
{"time_sec": 265, "doppler_434_khz": 7574, "doppler_144_khz": 2525},
{"time_sec": 266, "doppler_434_khz": 7530, "doppler_144_khz": 2510},
{"time_sec": 267, "doppler_434_khz": 7485, "doppler_144_khz": 2495},
{"time_sec": 268, "doppler_434_khz": 7440, "doppler_144_khz": 2480},
{"time_sec": 269, "doppler_434_khz": 7394, "doppler_144_khz": 2465},
{"time_sec": 270, "doppler_434_khz": 7298, "doppler_144_khz": 2433},
{"time_sec": 271, "doppler_434_khz": 7248, "doppler_144_khz": 2416},
{"time_sec": 272, "doppler_434_khz": 7198, "doppler_144_khz": 2399},
{"time_sec": 273, "doppler_434_khz": 7143, "doppler_144_khz": 2381},
{"time_sec": 274, "doppler_434_khz": 7037, "doppler_144_khz": 2346},
{"time_sec": 275, "doppler_434_khz": 6982, "doppler_144_khz": 2327},
{"time_sec": 276, "doppler_434_khz": 6927, "doppler_144_khz": 2309},
{"time_sec": 277, "doppler_434_khz": 6870, "doppler_144_khz": 2290},
{"time_sec": 278, "doppler_434_khz": 6812, "doppler_144_khz": 2271},
{"time_sec": 279, "doppler_434_khz": 6693, "doppler_144_khz": 2231},
{"time_sec": 280, "doppler_434_khz": 6631, "doppler_144_khz": 2210},
{"time_sec": 281, "doppler_434_khz": 6568, "doppler_144_khz": 2189},
{"time_sec": 282, "doppler_434_khz": 6504, "doppler_144_khz": 2168},
{"time_sec": 283, "doppler_434_khz": 6373, "doppler_144_khz": 2124},
{"time_sec": 284, "doppler_434_khz": 6305, "doppler_144_khz": 2102},
{"time_sec": 285, "doppler_434_khz": 6235, "doppler_144_khz": 2078},
{"time_sec": 286, "doppler_434_khz": 6165, "doppler_144_khz": 2055},
{"time_sec": 287, "doppler_434_khz": 6020, "doppler_144_khz": 2007},
{"time_sec": 288, "doppler_434_khz": 5945, "doppler_144_khz": 1982},
{"time_sec": 289, "doppler_434_khz": 5868, "doppler_144_khz": 1956},
{"time_sec": 290, "doppler_434_khz": 5791, "doppler_144_khz": 1930},
{"time_sec": 291, "doppler_434_khz": 5711, "doppler_144_khz": 1904},
{"time_sec": 292, "doppler_434_khz": 5548, "doppler_144_khz": 1849},
{"time_sec": 293, "doppler_434_khz": 5464, "doppler_144_khz": 1821},
{"time_sec": 294, "doppler_434_khz": 5379, "doppler_144_khz": 1793},
{"time_sec": 295, "doppler_434_khz": 5292, "doppler_144_khz": 1764},
{"time_sec": 296, "doppler_434_khz": 5113, "doppler_144_khz": 1704},
{"time_sec": 297, "doppler_434_khz": 5022, "doppler_144_khz": 1674},
{"time_sec": 298, "doppler_434_khz": 4928, "doppler_144_khz": 1643},
{"time_sec": 299, "doppler_434_khz": 4834, "doppler_144_khz": 1611},
{"time_sec": 300, "doppler_434_khz": 4640, "doppler_144_khz": 1547},
{"time_sec": 301, "doppler_434_khz": 4540, "doppler_144_khz": 1513},
{"time_sec": 302, "doppler_434_khz": 4438, "doppler_144_khz": 1479},
{"time_sec": 303, "doppler_434_khz": 4334, "doppler_144_khz": 1445},
{"time_sec": 304, "doppler_434_khz": 4229, "doppler_144_khz": 1410},
{"time_sec": 305, "doppler_434_khz": 4016, "doppler_144_khz": 1339},
{"time_sec": 306, "doppler_434_khz": 3907, "doppler_144_khz": 1302},
{"time_sec": 307, "doppler_434_khz": 3796, "doppler_144_khz": 1265},
{"time_sec": 308, "doppler_434_khz": 3684, "doppler_144_khz": 1228},
{"time_sec": 309, "doppler_434_khz": 3448, "doppler_144_khz": 1149},
{"time_sec": 310, "doppler_434_khz": 3330, "doppler_144_khz": 1110},
{"time_sec": 311, "doppler_434_khz": 3212, "doppler_144_khz": 1071},
{"time_sec": 312, "doppler_434_khz": 3091, "doppler_144_khz": 1030},
{"time_sec": 313, "doppler_434_khz": 2969, "doppler_144_khz": 990},
{"time_sec": 314, "doppler_434_khz": 2722, "doppler_144_khz": 907},
{"time_sec": 315, "doppler_434_khz": 2595, "doppler_144_khz": 865},
{"time_sec": 316, "doppler_434_khz": 2466, "doppler_144_khz": 822},
{"time_sec": 317, "doppler_434_khz": 2337, "doppler_144_khz": 779},
{"time_sec": 318, "doppler_434_khz": 2206, "doppler_144_khz": 735},
{"time_sec": 319, "doppler_434_khz": 1941, "doppler_144_khz": 647},
{"time_sec": 320, "doppler_434_khz": 1807, "doppler_144_khz": 602},
{"time_sec": 321, "doppler_434_khz": 1672, "doppler_144_khz": 557},
{"time_sec": 322, "doppler_434_khz": 1536, "doppler_144_khz": 512},
{"time_sec": 323, "doppler_434_khz": 1395, "doppler_144_khz": 465},
{"time_sec": 324, "doppler_434_khz": 1119, "doppler_144_khz": 373},
{"time_sec": 325, "doppler_434_khz": 979, "doppler_144_khz": 326},
{"time_sec": 326, "doppler_434_khz": 839, "doppler_144_khz": 280},
{"time_sec": 327, "doppler_434_khz": 699, "doppler_144_khz": 233},
{"time_sec": 328, "doppler_434_khz": 418, "doppler_144_khz": 139},
{"time_sec": 329, "doppler_434_khz": 277, "doppler_144_khz": 92},
{"time_sec": 330, "doppler_434_khz": 137, "doppler_144_khz": 46},
{"time_sec": 331, "doppler_434_khz": -2, "doppler_144_khz": 0},
{"time_sec": 332, "doppler_434_khz": -143, "doppler_144_khz": -47},
{"time_sec": 333, "doppler_434_khz": -427, "doppler_144_khz": -142},
{"time_sec": 334, "doppler_434_khz": -569, "doppler_144_khz": -189},
{"time_sec": 335, "doppler_434_khz": -709, "doppler_144_khz": -236},
{"time_sec": 336, "doppler_434_khz": -848, "doppler_144_khz": -282},
{"time_sec": 337, "doppler_434_khz": -987, "doppler_144_khz": -328},
{"time_sec": 338, "doppler_434_khz": -1263, "doppler_144_khz": -420},
{"time_sec": 339, "doppler_434_khz": -1400, "doppler_144_khz": -466},
{"time_sec": 340, "doppler_434_khz": -1537, "doppler_144_khz": -512},
{"time_sec": 341, "doppler_434_khz": -1672, "doppler_144_khz": -557},
{"time_sec": 342, "doppler_434_khz": -1806, "doppler_144_khz": -601},
{"time_sec": 343, "doppler_434_khz": -2072, "doppler_144_khz": -690},
{"time_sec": 344, "doppler_434_khz": -2204, "doppler_144_khz": -734},
{"time_sec": 345, "doppler_434_khz": -2335, "doppler_144_khz": -778},
{"time_sec": 346, "doppler_434_khz": -2471, "doppler_144_khz": -823},
{"time_sec": 347, "doppler_434_khz": -2599, "doppler_144_khz": -866},
{"time_sec": 348, "doppler_434_khz": -2851, "doppler_144_khz": -950},
{"time_sec": 349, "doppler_434_khz": -2975, "doppler_144_khz": -991},
{"time_sec": 350, "doppler_434_khz": -3098, "doppler_144_khz": -1032},
{"time_sec": 351, "doppler_434_khz": -3220, "doppler_144_khz": -1073},
{"time_sec": 352, "doppler_434_khz": -3458, "doppler_144_khz": -1152},
{"time_sec": 353, "doppler_434_khz": -3574, "doppler_144_khz": -1191},
{"time_sec": 354, "doppler_434_khz": -3693, "doppler_144_khz": -1230},
{"time_sec": 355, "doppler_434_khz": -3807, "doppler_144_khz": -1268},
{"time_sec": 356, "doppler_434_khz": -3921, "doppler_144_khz": -1306},
{"time_sec": 357, "doppler_434_khz": -4141, "doppler_144_khz": -1380},
{"time_sec": 358, "doppler_434_khz": -4249, "doppler_144_khz": -1416},
{"time_sec": 359, "doppler_434_khz": -4356, "doppler_144_khz": -1451},
{"time_sec": 360, "doppler_434_khz": -4460, "doppler_144_khz": -1486},
{"time_sec": 361, "doppler_434_khz": -4563, "doppler_144_khz": -1520},
{"time_sec": 362, "doppler_434_khz": -4763, "doppler_144_khz": -1587},
{"time_sec": 363, "doppler_434_khz": -4861, "doppler_144_khz": -1620},
{"time_sec": 364, "doppler_434_khz": -4956, "doppler_144_khz": -1651},
{"time_sec": 365, "doppler_434_khz": -5050, "doppler_144_khz": -1683},
{"time_sec": 366, "doppler_434_khz": -5142, "doppler_144_khz": -1713},
{"time_sec": 367, "doppler_434_khz": -5323, "doppler_144_khz": -1774},
{"time_sec": 368, "doppler_434_khz": -5410, "doppler_144_khz": -1803},
{"time_sec": 369, "doppler_434_khz": -5497, "doppler_144_khz": -1832},
{"time_sec": 370, "doppler_434_khz": -5582, "doppler_144_khz": -1860},
{"time_sec": 371, "doppler_434_khz": -5665, "doppler_144_khz": -1888},
{"time_sec": 372, "doppler_434_khz": -5825, "doppler_144_khz": -1941},
{"time_sec": 373, "doppler_434_khz": -5904, "doppler_144_khz": -1967},
{"time_sec": 374, "doppler_434_khz": -5981, "doppler_144_khz": -1993},
{"time_sec": 375, "doppler_434_khz": -6056, "doppler_144_khz": -2018},
{"time_sec": 376, "doppler_434_khz": -6203, "doppler_144_khz": -2067},
{"time_sec": 377, "doppler_434_khz": -6275, "doppler_144_khz": -2091},
{"time_sec": 378, "doppler_434_khz": -6344, "doppler_144_khz": -2114},
{"time_sec": 379, "doppler_434_khz": -6413, "doppler_144_khz": -2137},
{"time_sec": 380, "doppler_434_khz": -6479, "doppler_144_khz": -2159},
{"time_sec": 381, "doppler_434_khz": -6609, "doppler_144_khz": -2202},
{"time_sec": 382, "doppler_434_khz": -6676, "doppler_144_khz": -2225},
{"time_sec": 383, "doppler_434_khz": -6738, "doppler_144_khz": -2245},
{"time_sec": 384, "doppler_434_khz": -6798, "doppler_144_khz": -2265},
{"time_sec": 385, "doppler_434_khz": -6858, "doppler_144_khz": -2285},
{"time_sec": 386, "doppler_434_khz": -6974, "doppler_144_khz": -2324},
{"time_sec": 387, "doppler_434_khz": -7031, "doppler_144_khz": -2343},
{"time_sec": 388, "doppler_434_khz": -7086, "doppler_144_khz": -2361},
{"time_sec": 389, "doppler_434_khz": -7139, "doppler_144_khz": -2379},
{"time_sec": 390, "doppler_434_khz": -7191, "doppler_144_khz": -2396},
{"time_sec": 391, "doppler_434_khz": -7292, "doppler_144_khz": -2430},
{"time_sec": 392, "doppler_434_khz": -7342, "doppler_144_khz": -2447},
{"time_sec": 393, "doppler_434_khz": -7390, "doppler_144_khz": -2463},
{"time_sec": 394, "doppler_434_khz": -7437, "doppler_144_khz": -2478},
{"time_sec": 395, "doppler_434_khz": -7483, "doppler_144_khz": -2494},
{"time_sec": 396, "doppler_434_khz": -7573, "doppler_144_khz": -2524},
{"time_sec": 397, "doppler_434_khz": -7617, "doppler_144_khz": -2538},
{"time_sec": 398, "doppler_434_khz": -7659, "doppler_144_khz": -2552},
{"time_sec": 399, "doppler_434_khz": -7701, "doppler_144_khz": -2566},
{"time_sec": 400, "doppler_434_khz": -7742, "doppler_144_khz": -2580},
{"time_sec": 401, "doppler_434_khz": -7821, "doppler_144_khz": -2606},
{"time_sec": 402, "doppler_434_khz": -7860, "doppler_144_khz": -2619},
{"time_sec": 403, "doppler_434_khz": -7898, "doppler_144_khz": -2632},
{"time_sec": 404, "doppler_434_khz": -7935, "doppler_144_khz": -2644},
{"time_sec": 405, "doppler_434_khz": -7971, "doppler_144_khz": -2656},
{"time_sec": 406, "doppler_434_khz": -8041, "doppler_144_khz": -2680},
{"time_sec": 407, "doppler_434_khz": -8076, "doppler_144_khz": -2691},
{"time_sec": 408, "doppler_434_khz": -8109, "doppler_144_khz": -2702},
{"time_sec": 409, "doppler_434_khz": -8142, "doppler_144_khz": -2713},
{"time_sec": 410, "doppler_434_khz": -8205, "doppler_144_khz": -2734},
{"time_sec": 411, "doppler_434_khz": -8236, "doppler_144_khz": -2745},
{"time_sec": 412, "doppler_434_khz": -8266, "doppler_144_khz": -2755},
{"time_sec": 413, "doppler_434_khz": -8296, "doppler_144_khz": -2765},
{"time_sec": 414, "doppler_434_khz": -8325, "doppler_144_khz": -2774},
{"time_sec": 415, "doppler_434_khz": -8381, "doppler_144_khz": -2793},
{"time_sec": 416, "doppler_434_khz": -8408, "doppler_144_khz": -2802},
{"time_sec": 417, "doppler_434_khz": -8435, "doppler_144_khz": -2811},
{"time_sec": 418, "doppler_434_khz": -8462, "doppler_144_khz": -2820},
{"time_sec": 419, "doppler_434_khz": -8487, "doppler_144_khz": -2828},
{"time_sec": 420, "doppler_434_khz": -8539, "doppler_144_khz": -2846},
{"time_sec": 421, "doppler_434_khz": -8563, "doppler_144_khz": -2854},
{"time_sec": 422, "doppler_434_khz": -8587, "doppler_144_khz": -2862},
{"time_sec": 423, "doppler_434_khz": -8610, "doppler_144_khz": -2869},
{"time_sec": 424, "doppler_434_khz": -8633, "doppler_144_khz": -2877},
{"time_sec": 425, "doppler_434_khz": -8678, "doppler_144_khz": -2892},
{"time_sec": 426, "doppler_434_khz": -8700, "doppler_144_khz": -2899},
{"time_sec": 427, "doppler_434_khz": -8721, "doppler_144_khz": -2906},
{"time_sec": 428, "doppler_434_khz": -8742, "doppler_144_khz": -2913},
{"time_sec": 429, "doppler_434_khz": -8762, "doppler_144_khz": -2920},
{"time_sec": 430, "doppler_434_khz": -8802, "doppler_144_khz": -2933},
{"time_sec": 431, "doppler_434_khz": -8822, "doppler_144_khz": -2940},
{"time_sec": 432, "doppler_434_khz": -8841, "doppler_144_khz": -2946},
{"time_sec": 433, "doppler_434_khz": -8860, "doppler_144_khz": -2953},
{"time_sec": 434, "doppler_434_khz": -8878, "doppler_144_khz": -2959},
{"time_sec": 435, "doppler_434_khz": -8915, "doppler_144_khz": -2971},
{"time_sec": 436, "doppler_434_khz": -8932, "doppler_144_khz": -2977},
{"time_sec": 437, "doppler_434_khz": -8949, "doppler_144_khz": -2982},
{"time_sec": 438, "doppler_434_khz": -8966, "doppler_144_khz": -2988},
{"time_sec": 439, "doppler_434_khz": -8982, "doppler_144_khz": -2993},
{"time_sec": 440, "doppler_434_khz": -9015, "doppler_144_khz": -3004},
{"time_sec": 441, "doppler_434_khz": -9030, "doppler_144_khz": -3009},
{"time_sec": 442, "doppler_434_khz": -9045, "doppler_144_khz": -3014},
{"time_sec": 443, "doppler_434_khz": -9061, "doppler_144_khz": -3020},
{"time_sec": 444, "doppler_434_khz": -9075, "doppler_144_khz": -3024},
{"time_sec": 445, "doppler_434_khz": -9104, "doppler_144_khz": -3034},
{"time_sec": 446, "doppler_434_khz": -9118, "doppler_144_khz": -3039},
{"time_sec": 447, "doppler_434_khz": -9132, "doppler_144_khz": -3043},
{"time_sec": 448, "doppler_434_khz": -9146, "doppler_144_khz": -3048},
{"time_sec": 449, "doppler_434_khz": -9172, "doppler_144_khz": -3057},
{"time_sec": 450, "doppler_434_khz": -9185, "doppler_144_khz": -3061},
{"time_sec": 451, "doppler_434_khz": -9197, "doppler_144_khz": -3065},
{"time_sec": 452, "doppler_434_khz": -9210, "doppler_144_khz": -3069},
{"time_sec": 453, "doppler_434_khz": -9222, "doppler_144_khz": -3073},
{"time_sec": 454, "doppler_434_khz": -9246, "doppler_144_khz": -3081},
{"time_sec": 455, "doppler_434_khz": -9258, "doppler_144_khz": -3085},
{"time_sec": 456, "doppler_434_khz": -9270, "doppler_144_khz": -3089},
{"time_sec": 457, "doppler_434_khz": -9281, "doppler_144_khz": -3093},
{"time_sec": 458, "doppler_434_khz": -9292, "doppler_144_khz": -3097},
{"time_sec": 459, "doppler_434_khz": -9313, "doppler_144_khz": -3104},
{"time_sec": 460, "doppler_434_khz": -9324, "doppler_144_khz": -3107},
{"time_sec": 461, "doppler_434_khz": -9334, "doppler_144_khz": -3111},
{"time_sec": 462, "doppler_434_khz": -9344, "doppler_144_khz": -3114},
{"time_sec": 463, "doppler_434_khz": -9354, "doppler_144_khz": -3117},
{"time_sec": 464, "doppler_434_khz": -9374, "doppler_144_khz": -3124},
{"time_sec": 465, "doppler_434_khz": -9383, "doppler_144_khz": -3127},
{"time_sec": 466, "doppler_434_khz": -9393, "doppler_144_khz": -3130},
{"time_sec": 467, "doppler_434_khz": -9402, "doppler_144_khz": -3133},
{"time_sec": 468, "doppler_434_khz": -9411, "doppler_144_khz": -3136},
{"time_sec": 469, "doppler_434_khz": -9429, "doppler_144_khz": -3142},
{"time_sec": 470, "doppler_434_khz": -9438, "doppler_144_khz": -3145},
{"time_sec": 471, "doppler_434_khz": -9446, "doppler_144_khz": -3148},
{"time_sec": 472, "doppler_434_khz": -9454, "doppler_144_khz": -3151},
{"time_sec": 473, "doppler_434_khz": -9470, "doppler_144_khz": -3156},
{"time_sec": 474, "doppler_434_khz": -9478, "doppler_144_khz": -3159},
{"time_sec": 475, "doppler_434_khz": -9486, "doppler_144_khz": -3161},
{"time_sec": 476, "doppler_434_khz": -9494, "doppler_144_khz": -3164},
{"time_sec": 477, "doppler_434_khz": -9501, "doppler_144_khz": -3166},
{"time_sec": 478, "doppler_434_khz": -9516, "doppler_144_khz": -3171},
{"time_sec": 479, "doppler_434_khz": -9523, "doppler_144_khz": -3174},
{"time_sec": 480, "doppler_434_khz": -9530, "doppler_144_khz": -3176},
{"time_sec": 481, "doppler_434_khz": -9537, "doppler_144_khz": -3178},
{"time_sec": 482, "doppler_434_khz": -9551, "doppler_144_khz": -3183},
{"time_sec": 483, "doppler_434_khz": -9557, "doppler_144_khz": -3185},
{"time_sec": 484, "doppler_434_khz": -9564, "doppler_144_khz": -3187},
{"time_sec": 485, "doppler_434_khz": -9570, "doppler_144_khz": -3189},
{"time_sec": 486, "doppler_434_khz": -9583, "doppler_144_khz": -3194},
{"time_sec": 487, "doppler_434_khz": -9589, "doppler_144_khz": -3196},
{"time_sec": 488, "doppler_434_khz": -9595, "doppler_144_khz": -3198},
{"time_sec": 489, "doppler_434_khz": -9601, "doppler_144_khz": -3200},
{"time_sec": 490, "doppler_434_khz": -9607, "doppler_144_khz": -3202},
{"time_sec": 491, "doppler_434_khz": -9619, "doppler_144_khz": -3206},
{"time_sec": 492, "doppler_434_khz": -9625, "doppler_144_khz": -3208},
{"time_sec": 493, "doppler_434_khz": -9630, "doppler_144_khz": -3209},
{"time_sec": 494, "doppler_434_khz": -9636, "doppler_144_khz": -3211},
{"time_sec": 495, "doppler_434_khz": -9642, "doppler_144_khz": -3213},
{"time_sec": 496, "doppler_434_khz": -9652, "doppler_144_khz": -3217},
{"time_sec": 497, "doppler_434_khz": -9658, "doppler_144_khz": -3219},
{"time_sec": 498, "doppler_434_khz": -9663, "doppler_144_khz": -3220},
{"time_sec": 499, "doppler_434_khz": -9668, "doppler_144_khz": -3222},
{"time_sec": 500, "doppler_434_khz": -9678, "doppler_144_khz": -3225},
{"time_sec": 501, "doppler_434_khz": -9683, "doppler_144_khz": -3227},
{"time_sec": 502, "doppler_434_khz": -9687, "doppler_144_khz": -3228},
{"time_sec": 503, "doppler_434_khz": -9692, "doppler_144_khz": -3230},
{"time_sec": 504, "doppler_434_khz": -9697, "doppler_144_khz": -3232},
{"time_sec": 505, "doppler_434_khz": -9706, "doppler_144_khz": -3235},
{"time_sec": 506, "doppler_434_khz": -9710, "doppler_144_khz": -3236},
{"time_sec": 507, "doppler_434_khz": -9715, "doppler_144_khz": -3238},
{"time_sec": 508, "doppler_434_khz": -9719, "doppler_144_khz": -3239},
{"time_sec": 509, "doppler_434_khz": -9727, "doppler_144_khz": -3242},
{"time_sec": 510, "doppler_434_khz": -9732, "doppler_144_khz": -3243},
{"time_sec": 511, "doppler_434_khz": -9736, "doppler_144_khz": -3245},
{"time_sec": 512, "doppler_434_khz": -9740, "doppler_144_khz": -3246},
{"time_sec": 513, "doppler_434_khz": -9747, "doppler_144_khz": -3248},
{"time_sec": 514, "doppler_434_khz": -9751, "doppler_144_khz": -3250},
{"time_sec": 515, "doppler_434_khz": -9755, "doppler_144_khz": -3251},
{"time_sec": 516, "doppler_434_khz": -9759, "doppler_144_khz": -3252},
{"time_sec": 517, "doppler_434_khz": -9763, "doppler_144_khz": -3254},
{"time_sec": 518, "doppler_434_khz": -9770, "doppler_144_khz": -3256},
{"time_sec": 519, "doppler_434_khz": -9773, "doppler_144_khz": -3257},
{"time_sec": 520, "doppler_434_khz": -9777, "doppler_144_khz": -3258},
{"time_sec": 521, "doppler_434_khz": -9780, "doppler_144_khz": -3259},
{"time_sec": 522, "doppler_434_khz": -9787, "doppler_144_khz": -3262},
{"time_sec": 523, "doppler_434_khz": -9791, "doppler_144_khz": -3263},
{"time_sec": 524, "doppler_434_khz": -9794, "doppler_144_khz": -3264},
{"time_sec": 525, "doppler_434_khz": -9797, "doppler_144_khz": -3265},
{"time_sec": 526, "doppler_434_khz": -9800, "doppler_144_khz": -3266},
{"time_sec": 527, "doppler_434_khz": -9807, "doppler_144_khz": -3268},
{"time_sec": 528, "doppler_434_khz": -9810, "doppler_144_khz": -3269},
{"time_sec": 529, "doppler_434_khz": -9813, "doppler_144_khz": -3270},
{"time_sec": 530, "doppler_434_khz": -9816, "doppler_144_khz": -3271},
{"time_sec": 531, "doppler_434_khz": -9822, "doppler_144_khz": -3273},
{"time_sec": 532, "doppler_434_khz": -9825, "doppler_144_khz": -3274},
{"time_sec": 533, "doppler_434_khz": -9827, "doppler_144_khz": -3275},
{"time_sec": 534, "doppler_434_khz": -9830, "doppler_144_khz": -3276},
{"time_sec": 535, "doppler_434_khz": -9833, "doppler_144_khz": -3277},
{"time_sec": 536, "doppler_434_khz": -9838, "doppler_144_khz": -3279},
{"time_sec": 537, "doppler_434_khz": -9841, "doppler_144_khz": -3280},
{"time_sec": 538, "doppler_434_khz": -9843, "doppler_144_khz": -3280},
{"time_sec": 539, "doppler_434_khz": -9846, "doppler_144_khz": -3281},
{"time_sec": 540, "doppler_434_khz": -9851, "doppler_144_khz": -3283},
{"time_sec": 541, "doppler_434_khz": -9853, "doppler_144_khz": -3284},
{"time_sec": 542, "doppler_434_khz": -9856, "doppler_144_khz": -3285},
{"time_sec": 543, "doppler_434_khz": -9858, "doppler_144_khz": -3285},
{"time_sec": 544, "doppler_434_khz": -9861, "doppler_144_khz": -3286},
{"time_sec": 545, "doppler_434_khz": -9865, "doppler_144_khz": -3288},
{"time_sec": 546, "doppler_434_khz": -9867, "doppler_144_khz": -3288},
{"time_sec": 547, "doppler_434_khz": -9870, "doppler_144_khz": -3289},
{"time_sec": 548, "doppler_434_khz": -9872, "doppler_144_khz": -3290},
{"time_sec": 549, "doppler_434_khz": -9876, "doppler_144_khz": -3291},
{"time_sec": 550, "doppler_434_khz": -9878, "doppler_144_khz": -3292},
{"time_sec": 551, "doppler_434_khz": -9880, "doppler_144_khz": -3293},
{"time_sec": 552, "doppler_434_khz": -9882, "doppler_144_khz": -3293},
{"time_sec": 553, "doppler_434_khz": -9886, "doppler_144_khz": -3295},
{"time_sec": 554, "doppler_434_khz": -9888, "doppler_144_khz": -3295},
{"time_sec": 555, "doppler_434_khz": -9890, "doppler_144_khz": -3296},
{"time_sec": 556, "doppler_434_khz": -9892, "doppler_144_khz": -3297},
{"time_sec": 557, "doppler_434_khz": -9894, "doppler_144_khz": -3297},
{"time_sec": 558, "doppler_434_khz": -9898, "doppler_144_khz": -3299},
{"time_sec": 559, "doppler_434_khz": -9899, "doppler_144_khz": -3299},
{"time_sec": 560, "doppler_434_khz": -9901, "doppler_144_khz": -3300},
{"time_sec": 561, "doppler_434_khz": -9903, "doppler_144_khz": -3300},
{"time_sec": 562, "doppler_434_khz": -9906, "doppler_144_khz": -3301},
{"time_sec": 563, "doppler_434_khz": -9908, "doppler_144_khz": -3302},
{"time_sec": 564, "doppler_434_khz": -9910, "doppler_144_khz": -3303},
{"time_sec": 565, "doppler_434_khz": -9911, "doppler_144_khz": -3303},
{"time_sec": 566, "doppler_434_khz": -9913, "doppler_144_khz": -3304},
{"time_sec": 567, "doppler_434_khz": -9916, "doppler_144_khz": -3305},
{"time_sec": 568, "doppler_434_khz": -9918, "doppler_144_khz": -3305},
{"time_sec": 569, "doppler_434_khz": -9919, "doppler_144_khz": -3306},
{"time_sec": 570, "doppler_434_khz": -9921, "doppler_144_khz": -3306},
{"time_sec": 571, "doppler_434_khz": -9923, "doppler_144_khz": -3307},
{"time_sec": 572, "doppler_434_khz": -9925, "doppler_144_khz": -3308},
{"time_sec": 573, "doppler_434_khz": -9926, "doppler_144_khz": -3308},
{"time_sec": 574, "doppler_434_khz": -9928, "doppler_144_khz": -3309},
{"time_sec": 575, "doppler_434_khz": -9930, "doppler_144_khz": -3309},
{"time_sec": 576, "doppler_434_khz": -9932, "doppler_144_khz": -3310},
{"time_sec": 577, "doppler_434_khz": -9933, "doppler_144_khz": -3310},
{"time_sec": 578, "doppler_434_khz": -9934, "doppler_144_khz": -3311},
{"time_sec": 579, "doppler_434_khz": -9936, "doppler_144_khz": -3311},
{"time_sec": 580, "doppler_434_khz": -9938, "doppler_144_khz": -3312},
{"time_sec": 581, "doppler_434_khz": -9939, "doppler_144_khz": -3312},
{"time_sec": 582, "doppler_434_khz": -9940, "doppler_144_khz": -3313},
{"time_sec": 583, "doppler_434_khz": -9942, "doppler_144_khz": -3313},
{"time_sec": 584, "doppler_434_khz": -9944, "doppler_144_khz": -3314},
{"time_sec": 585, "doppler_434_khz": -9945, "doppler_144_khz": -3314},
{"time_sec": 586, "doppler_434_khz": -9946, "doppler_144_khz": -3315},
{"time_sec": 587, "doppler_434_khz": -9947, "doppler_144_khz": -3315},
{"time_sec": 588, "doppler_434_khz": -9949, "doppler_144_khz": -3316},
{"time_sec": 589, "doppler_434_khz": -9950, "doppler_144_khz": -3316},
{"time_sec": 590, "doppler_434_khz": -9951, "doppler_144_khz": -3316},
{"time_sec": 591, "doppler_434_khz": -9952, "doppler_144_khz": -3317},
{"time_sec": 592, "doppler_434_khz": -9953, "doppler_144_khz": -3317},
{"time_sec": 593, "doppler_434_khz": -9955, "doppler_144_khz": -3318},
{"time_sec": 594, "doppler_434_khz": -9956, "doppler_144_khz": -3318},
{"time_sec": 595, "doppler_434_khz": -9957, "doppler_144_khz": -3318},
{"time_sec": 596, "doppler_434_khz": -9958, "doppler_144_khz": -3319},
{"time_sec": 597, "doppler_434_khz": -9960, "doppler_144_khz": -3319},
{"time_sec": 598, "doppler_434_khz": -9961, "doppler_144_khz": -3320},
{"time_sec": 599, "doppler_434_khz": -9961, "doppler_144_khz": -3320},
{"time_sec": 600, "doppler_434_khz": -9962, "doppler_144_khz": -3320},
{"time_sec": 601, "doppler_434_khz": -9963, "doppler_144_khz": -3320},
{"time_sec": 602, "doppler_434_khz": -9965, "doppler_144_khz": -3321},
{"time_sec": 603, "doppler_434_khz": -9965, "doppler_144_khz": -3321},
{"time_sec": 604, "doppler_434_khz": -9966, "doppler_144_khz": -3321},
{"time_sec": 605, "doppler_434_khz": -9967, "doppler_144_khz": -3322},
{"time_sec": 606, "doppler_434_khz": -9968, "doppler_144_khz": -3322},
{"time_sec": 607, "doppler_434_khz": -9969, "doppler_144_khz": -3322},
{"time_sec": 608, "doppler_434_khz": -9970, "doppler_144_khz": -3323},
{"time_sec": 609, "doppler_434_khz": -9970, "doppler_144_khz": -3323},
{"time_sec": 610, "doppler_434_khz": -9972, "doppler_144_khz": -3323},
{"time_sec": 611, "doppler_434_khz": -9972, "doppler_144_khz": -3323},
{"time_sec": 612, "doppler_434_khz": -9973, "doppler_144_khz": -3324},
{"time_sec": 613, "doppler_434_khz": -9974, "doppler_144_khz": -3324},
{"time_sec": 614, "doppler_434_khz": -9974, "doppler_144_khz": -3324},
{"time_sec": 615, "doppler_434_khz": -9975, "doppler_144_khz": -3324},
{"time_sec": 616, "doppler_434_khz": -9976, "doppler_144_khz": -3325},
{"time_sec": 617, "doppler_434_khz": -9976, "doppler_144_khz": -3325},
{"time_sec": 618, "doppler_434_khz": -9977, "doppler_144_khz": -3325},
{"time_sec": 619, "doppler_434_khz": -9978, "doppler_144_khz": -3325},
{"time_sec": 620, "doppler_434_khz": -9978, "doppler_144_khz": -3325},
{"time_sec": 621, "doppler_434_khz": -9979, "doppler_144_khz": -3326},
{"time_sec": 622, "doppler_434_khz": -9979, "doppler_144_khz": -3326},
{"time_sec": 623, "doppler_434_khz": -9980, "doppler_144_khz": -3326},
{"time_sec": 624, "doppler_434_khz": -9981, "doppler_144_khz": -3326},
{"time_sec": 625, "doppler_434_khz": -9981, "doppler_144_khz": -3326},
{"time_sec": 626, "doppler_434_khz": -9982, "doppler_144_khz": -3327},
{"time_sec": 627, "doppler_434_khz": -9982, "doppler_144_khz": -3327},
{"time_sec": 628, "doppler_434_khz": -9983, "doppler_144_khz": -3327},
{"time_sec": 629, "doppler_434_khz": -9983, "doppler_144_khz": -3327},
{"time_sec": 630, "doppler_434_khz": -9984, "doppler_144_khz": -3327},
{"time_sec": 631, "doppler_434_khz": -9984, "doppler_144_khz": -3327},
{"time_sec": 632, "doppler_434_khz": -9985, "doppler_144_khz": -3328},
{"time_sec": 633, "doppler_434_khz": -9985, "doppler_144_khz": -3328},
{"time_sec": 634, "doppler_434_khz": -9985, "doppler_144_khz": -3328},
{"time_sec": 635, "doppler_434_khz": -9986, "doppler_144_khz": -3328},
{"time_sec": 636, "doppler_434_khz": -9986, "doppler_144_khz": -3328},
{"time_sec": 637, "doppler_434_khz": -9986, "doppler_144_khz": -3328},
{"time_sec": 638, "doppler_434_khz": -9987, "doppler_144_khz": -3328},
{"time_sec": 639, "doppler_434_khz": -9987, "doppler_144_khz": -3328},
{"time_sec": 640, "doppler_434_khz": -9987, "doppler_144_khz": -3328},
{"time_sec": 641, "doppler_434_khz": -9988, "doppler_144_khz": -3329},
{"time_sec": 642, "doppler_434_khz": -9988, "doppler_144_khz": -3329},
{"time_sec": 643, "doppler_434_khz": -9988, "doppler_144_khz": -3329},
{"time_sec": 644, "doppler_434_khz": -9988, "doppler_144_khz": -3329},
{"time_sec": 645, "doppler_434_khz": -9988, "doppler_144_khz": -3329},
{"time_sec": 646, "doppler_434_khz": -9989, "doppler_144_khz": -3329},
{"time_sec": 647, "doppler_434_khz": -9989, "doppler_144_khz": -3329},
{"time_sec": 648, "doppler_434_khz": -9989, "doppler_144_khz": -3329},
{"time_sec": 649, "doppler_434_khz": -9989, "doppler_144_khz": -3329},
{"time_sec": 650, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 651, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 652, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 653, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 654, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 655, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 656, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 657, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 658, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 659, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 660, "doppler_434_khz": -9990, "doppler_144_khz": -3329},
{"time_sec": 661, "doppler_434_khz": -9990, "doppler_144_khz": -3329}
]
}
print("CubeSatSim v2.2 frequency.py starting...")
try:
tx_value = '0'
rx_value = '0'
sq = '0'
tx = '434.9000'
rx = '435.0000'
txr = '144.9000'
sim_mode = False
sim_config = False
doppler_mode = "off"
debug_mode = True
try:
file = open("/home/pi/CubeSatSim/.mode")
mode = file.read(1)
except:
mode = 'f'
if (debug_mode == 1):
print("Can't open .mode file, defaulting to FSK")
file.close()
print("Mode is: ")
print(mode)
try:
file = open("/home/pi/CubeSatSim/sim.cfg")
config = file.readline().split()
if len(config) > 6:
txf = float(config[6])
tx = "{:.4f}".format(txf)
######
if (mode == 'e'):
txrf = (txf - 290.0) # - 0.1 # Cross Band Repeater mode transmit frequency in 2m band
txr = "{:.4f}".format(txrf)
print("Transmit frequency: ",txr)
else:
print("Transmit frequency: ",tx)
######
print("Transmit frequency: ",tx)
if len(config) > 7:
rxf = float(config[7])
rx = "{:.4f}".format(rxf)
print(rx)
if len(config) > 9:
rxpl = float(config[9])
# print(rxpl)
# print( "{:.0f}".format(rxpl))
rxpl_value = "{:.0f}".format(rxpl)
print(rxpl_value)
if len(config) > 10:
txpl = float(config[10])
# print(txpl)
# print( "{:.0f}".format(txpl))
txpl_value = "{:.0f}".format(txpl)
print(txpl_value)
if len(config) > 13:
if config[13] == 'sim':
doppler_mode = 'sim'
print("Simulated Doppler frequency shift is enabled.")
elif config[13] == 'rig':
doppler_mode = 'rig'
print("rigctl Doppler frequency shift is enabled.")
else:
doppler_mode = 'off'
print("Doppler frequency shift is disabled.")
else:
doppler_mode = 'off'
print("Doppler frequency shift is disabled.")
print(config)
print
# print(callsign)
print(sq)
# if sq == '8':
# print("squelch set to 8, no command input!")
# no_command = True
# else:
no_command = False
print(no_command)
except Exception as e:
print(f"An error occurred: {e}")
if (debug_mode == 1):
print("Can't read sim.cfg file")
file.close()
except Exception as e:
print(f"An error occurred: {e}")
if (doppler_mode == 'off'):
tx_freq_hz = txf * 1e6
rx_freq_hz = rxf * 1e6
# check_frequency()
print("writing sim.cfg frequency to freq.txt")
with open("/home/pi/CubeSatSim/freq.txt", "w") as file:
file.write(f"{tx_freq_hz:.0f} {rx_freq_hz:.0f}")
while True:
sleep(1)
if (doppler_mode == 'sim'):
print("Sim mode")
#####
if (mode == 'e'):
tx_doppler_start_hz = txrf * 1e6
else:
tx_doppler_start_hz = txf * 1e6
#####
# tx_doppler_start_hz = txf * 1e6
tx_doppler_shift_hz = 0
print(f"Tx center frequency: {tx_doppler_start_hz}")
rx_doppler_start_hz = rxf * 1e6
rx_doppler_shift_hz = 0
print(f"Rx center frequency: {rx_doppler_start_hz}")
TARGET_PASS = 88 # Maximum elevation profile
doppler_table = iss_doppler_passes[TARGET_PASS]
print(f"Pass Max Elevation: {TARGET_PASS}°")
start_time = time.perf_counter()
current_index = 0;
while True:
relative_time = (time.perf_counter() - start_time)
# index = int(relative_time/10) % 37
index = int(relative_time)
if (index > current_index):
current_index = index
index = index % 661
print(f"relative time: {relative_time:.1f} seconds after start is AOS index: {index}")
table_row = doppler_table[index]
rx_doppler_shift_hz = table_row["doppler_434_khz"] # * 1000
if (mode == 'e'):
tx_doppler_shift_hz = table_row["doppler_144_khz"] # * 1000
else:
tx_doppler_shift_hz = rx_doppler_shift_hz
tx_doppler_freq_hz = tx_doppler_start_hz + tx_doppler_shift_hz
rx_doppler_freq_hz = rx_doppler_start_hz + rx_doppler_shift_hz
check_frequency()
print(f"Tx Doppler shift: {tx_doppler_freq_hz:.0f}")
print(f"Rx Doppler shift: {rx_doppler_freq_hz:.0f}")
with open("/home/pi/CubeSatSim/freq.txt", "w") as file:
file.write(f"{tx_doppler_freq_hz:.0f} {rx_doppler_freq_hz:.0f}")
sleep(1)
if (doppler_mode == 'rig'):
print("rig mode")
while True:
system("sudo killall -9 ft857d &>/dev/null")
system("sudo killall -9 socat &>/dev/null")
system("sudo killall -9 rigctld &>/dev/null")
print("Starting virtual serial ports /tmp/vttyA and /tmp/vttyB")
system("socat -d -d PTY,raw,echo=0,link=/tmp/vttyA PTY,raw,echo=0,link=/tmp/vttyB &")
sleep(1.0)
print("Starting CubeSatSim FT857 emulation")
system("/home/pi/FT857d/examples/FT857d/ft857d &")
sleep(1.0)
print("Starting rigctl emulating FT857 rig using virtual serial port /tmp/vttyB")
system("rigctld -m 1022 -r /tmp/vttyB -t 4532 -vvv")
print("rigctld ended")

@ -0,0 +1,5 @@
#!/bin/bash
echo "Starting frequency control"
python3 /home/pi/CubeSatSim/frequency.py

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Exec=/home/pi/CubeSatSim/groundstation/sdrpp.sh
Name=SDRpp
Comment=SDRpp
Icon=/home/pi/Icons/sdrpp.png
Path=/home/pi
Terminal=true
Categories=HamRadio
Keywords=Ham Radio;SDR

@ -9,6 +9,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null

@ -2,7 +2,7 @@
Name=APRS Decode using Direwolf
GenericName=Decodes APRS using rtl_fm and Direwolf
Comment=APRS signals
Exec=/home/pi/CubeSatSim/groundstation/aprs.sh
Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/packet.sh"
Icon=/home/pi/Icons/aprs.png
Terminal=true
Type=Application

@ -3,12 +3,16 @@
sudo modprobe snd-aloop
sudo systemctl stop openwebrx
sudo systemctl stop openwebrx &>/dev/null
sudo systemctl stop rtl_tcp
sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null
@ -78,7 +82,7 @@ echo -e "Auto decoding APRS packets on $frequency Hz"
#sudo rtl_fm -f 144.39M -s 22050 -g 48 - | multimon-ng -a AFSK1200 -A -t raw -
direwolf -r 48000 -t 0 &
direwolf -c /home/pi/CubeSatSim/groundstation/direwolf.conf -r 48000 -t 0 &
sleep 5
@ -87,6 +91,7 @@ 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
rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1
#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1
rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1
sleep 5

@ -0,0 +1,93 @@
from rtlsdr import RtlSdr
import numpy as np
import matplotlib.pyplot as plt
import sys
if __name__ == "__main__":
graph = 'n'
center_frequency = 434.7e6
if (len(sys.argv)) > 0:
# print("There are arguments!")
center_frequency = float(sys.argv[1]) - 200e3
if (center_frequency == 0):
center_frequency = 434.7e6
if (len(sys.argv)) > 1:
# print("There are more arguments")
if (sys.argv[2] == 'g') or (sys.argv[2] == '-g'):
graph = 'y'
sampling_rate = 1024e3 # 250e3 # Hz
duration = 65536/sampling_rate # 1 # seconds
try:
sdr = RtlSdr()
# configure device
sdr.sample_rate = sampling_rate # 250e3 # 2.4e6
#center_frequency = 434.8e6
sdr.center_freq = center_frequency
sdr.gain = 47
sdr.direct_sampling = False
# signal = sdr.read_samples(64*1024) #256
signal = sdr.read_samples(duration*sampling_rate).real #256
# print(f"Center frequency is {center_frequency}")
sdr.close()
# Compute the FFT
fft_result = np.fft.fft(signal)
# Calculate the frequencies corresponding to the FFT output
n = len(signal)
frequencies = np.fft.fftfreq(n, d=1/sampling_rate)
# Take the absolute value for amplitude spectrum and consider only the positive frequencies
positive_frequencies_indices = np.where(frequencies >= 0)
positive_frequencies = frequencies[positive_frequencies_indices]
amplitude_spectrum = 2/n * np.abs(fft_result[positive_frequencies_indices]) # Normalize for amplitude
if (graph == 'y'):
# Plotting the results
t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
plt.figure(figsize=(12, 6))
plt.subplot(1, 2, 1)
plt.plot(t, signal)
plt.title('Time Domain Signal')
plt.xlabel('Time (s)')
plt.ylabel('Amplitude')
plt.subplot(1, 2, 2)
plt.stem(positive_frequencies, amplitude_spectrum, markerfmt=" ", basefmt="-b")
plt.title('Frequency Domain (FFT)')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Amplitude')
plt.grid(True)
plt.tight_layout()
plt.show()
# print(amplitude_spectrum)
x = amplitude_spectrum
# print(x)
min_value = min(x)
max_value = max(x) * 100
#freq_min = np.argmax(min_value)
# print(np.argmax(x))
# print(np.argmax(x)*(150e3 - 10e3)/(9770 - 709))
# print(sampling_rate)
# print(center_frequency)
offset = (np.argmax(x)*(150e3 - 10e3)/(9770 - 709))
freq_max = center_frequency + offset + 2000
except: # if no RTL-SDR or in use, stop scanning with high max value and center frequency
max_value = 100
freq_max = center_frequency + 200e3 # should be 434900000
print(f" {freq_max:.0f} {max_value:.0f}")

@ -1,5 +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
Name=Browser with WebSDR
Exec=x-www-browser http://localhost:8073/

@ -1,137 +1,87 @@
[
{
"name": "ISS APRS",
"frequency": 145825000,
"modulation": "nfm"
},
{
"name": "ISS SSTV/Voice",
"frequency": 145800000,
"modulation": "nfm"
},
{
"name": "ARISS Repeater Downlink",
"frequency": 437800000,
"modulation": "nfm"
},
{
"name": "AO-27",
"frequency": 436795000,
"modulation": "nfm"
},
{
"name": "AO-73",
"frequency": 145815000,
"modulation": "usb"
},
{
"name": "Fox-1B AO-91",
"frequency": 145960000,
"modulation": "nfm"
},
{
"name": "Fox-1D AO-92",
"frequency": 145880000,
"modulation": "nfm"
},
{
"name": "HuskySat-1 HO-107",
"frequency": 435800000,
"modulation": "usb"
},
{
"name": "Fox-1E",
"frequency": 435750000,
"modulation": "usb"
},
{
"name": "MAX VALIER",
"frequency": 145860000,
"modulation": "usb"
},
{
"name": "NOAA WX Radio 1",
"frequency": 162400000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 2",
"frequency": 162425000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 3",
"frequency": 162450000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 4",
"frequency": 162475000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 5",
"frequency": 162500000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 6",
"frequency": 162525000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 7",
"frequency": 162550000,
"modulation": "nfm"
},
{
"name": "CAS-4A",
"frequency": 145855000,
"modulation": "usb"
},
{
"name": "CAS-4B",
"frequency": 145910000,
"modulation": "usb"
},
{
"name": "XW-2A",
"frequency": 145660000,
"modulation": "usb"
},
{
"name": "XW-2B",
"frequency": 145725000,
"modulation": "usb"
},
{
"name": "XW-2C",
"frequency": 145790000,
"modulation": "usb"
},
{
"name": "XW-2F",
"frequency": 145975000,
"modulation": "usb"
},
{
"name": "NOAA-19",
"frequency": 137100000,
"modulation": "nfm"
},
{
"name": "NOAA-18",
"frequency": 137912500,
"modulation": "nfm"
},
{
"name": "NOAA-15",
"frequency": 137620000,
"modulation": "nfm"
},
{
"name": "CubeSatSim",
"frequency": 434900000,
"modulation": "packet"
}
{
"name": "NOAA WX Radio 1",
"frequency": 162400000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 2",
"frequency": 162425000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 3",
"frequency": 162450000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 4",
"frequency": 162475000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 5",
"frequency": 162500000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 6",
"frequency": 162525000,
"modulation": "nfm"
},
{
"name": "NOAA WX Radio 7",
"frequency": 162550000,
"modulation": "nfm"
},
{
"name": "CubeSatSim Cross Band Repeater",
"frequency": 144900000,
"modulation": "nfm"
},
{
"name": "CubeSatSim",
"frequency": 434900000,
"modulation": "sstv"
},
{
"name": "CubeSatSim RX",
"frequency": 435000000,
"modulation": "nfm"
},
{
"name": "ISS SSTV/Voice",
"frequency": 145800000,
"modulation": "nfm"
},
{
"name": "ISS APRS",
"frequency": 145825000,
"modulation": "packet"
},
{
"name": "ISS Voice Repeater",
"frequency": 437800000,
"modulation": "nfm"
},
{
"name": "AO-91",
"frequency": 145960000,
"modulation": "nfm"
},
{
"name": "AO-73",
"frequency": 145970000,
"modulation": "nfm"
},
{
"name": "ISS U/V",
"frequency": 145800000,
"modulation": "nfm"
},
{
"name": "AO-7 Mode B",
"frequency": 145950000,
"modulation": "nfm"
}
]

@ -1,4 +1,4 @@
[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
Exec=x-www-browser http://127.0.0.1:8073

@ -0,0 +1,41 @@
#!/bin/bash
# script to send APRS or DTMR commands to a CubeSatSim
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
if [ "$1" != "n" ]; then
echo "You are not in Transmit Commands mode"
sleep 10
exit
fi
sudo killall -9 zenity &>/dev/null
echo
autotune=0
mode=$(zenity --timeout=20 --list 2>/dev/null --width=300 --height=380 --title="Transmit Command" --text="Choose the command to transmit" --column="Mode" --column="Result" a "APRS Mode" f "FSK Mode" b "BPSK Mode" s "SSTV Mode" m "CM Mode" e "Repeater Mode" j "FUNcube Mode" G "PacSatSim Mode" o "Beacon On/Off")
# echo $mode
if [ -z "$mode" ]; then
echo "No choice made."
sleep 10
exit
fi
/home/pi/CubeSatSim/config -$mode
sleep 10

@ -8,6 +8,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null

@ -3,7 +3,7 @@ Type=Application
Exec=/home/pi/CubeSatSim/groundstation/cubicsdr.sh
Name=SDR FM Broadcast
Comment=CubicSDR FM Broadcast
Icon=/home/pi/Downloads/cubicsdr.png
Icon=/home/pi/Icons/cubicsdr.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -9,19 +9,23 @@ echo "Note: Select Generic RTL2832 device then click Start to begin"
echo
sudo systemctl stop openwebrx
sudo systemctl stop openwebrx &>/dev/null
sudo killall -9 java &>/dev/null
sudo systemctl stop rtl_tcp
sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 aplay &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 qsstv &>/dev/null
@ -39,11 +43,28 @@ sudo killall -9 sdrpp &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sudo killall -9 rtl_fm &>/dev/null
zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select <i>Generic RTL2832U</i> device then click <b>Start</b> to begin.\n\nThen click on a signal in the watefall to listen." &
sleep 5
setsid CubicSDR
sleep 10
#$SHELL
#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
zenity --info --width=650 --height=140 --title="Instructions" --text="When CubicSDR opens, select <i>Generic RTL2832U</i> device then click <b>Start</b> to begin.\n\nThen click on a signal in the watefall to listen." &
sleep 5

@ -1 +1 @@
ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=b1,DEV=0
ADEVICE plughw:CARD=Loopback,DEV=1 default

@ -0,0 +1,9 @@
CHANNEL 0
MODEM 1200
KISSPORT 8100
AGWPORT 8002
DWAIT 20
SLOTTIME 10
PERSIST 63
TXDELAY 30
FULLDUP OFF

@ -5,7 +5,7 @@ echo "Script to run FUNcube CubeSatSim Telemetry"
echo
echo "The Chromium browser will load in a few seconds with fctelem."
echo "The browser will load in a few seconds with fctelem."
echo "You can also use another web browser if you are on the same network as your Pi."
@ -24,6 +24,16 @@ echo "Note: you need to be on the Wifi network: $ssid"
echo
if [[ $(gpio -v | grep "Pi 4") ]] && [[ ! $(sudo raspi-config nonint get_browser | grep "chromium") ]] ; then
echo "Since Pi 4, changing default browser to Chromium"
sudo raspi-config nonint do_browser chromium
fi
if [[ $(gpio -v | grep "Pi 5") ]] && [[ ! $(sudo raspi-config nonint get_browser | grep "firefox") ]] ; then
echo "Since Pi 5, changing default browser to Firefox"
sudo raspi-config nonint do_browser firefox
fi
sudo killall -9 fctelem &>/dev/null
sudo killall -9 python3 &>/dev/null
@ -34,6 +44,8 @@ sudo killall -9 python3 &>/dev/null
#pkill -o chromium &>/dev/null
#pkill -o firefox &>/dev/null
#sudo killall -9 rtl_tcp &>/dev/null
#sudo killall -9 CubicSDR &>/dev/null
@ -80,8 +92,9 @@ else
echo
fi
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=180 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Other "Choose another frequency")
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="FUNcube Telem Decoding" --text="Choose the frequency for FUNcube decoding:" --column="kHz" --column="Use" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" Other "Choose another frequency")
echo $frequency
@ -96,6 +109,11 @@ if [ "$frequency" = "434900" ]; then
frequency=434900000
elif [ "$frequency" = "Auto-tune" ]; then
frequency=434900000
autotune=1
elif [ "$frequency" = "Other" ]; then
echo
@ -110,6 +128,39 @@ elif [ "$frequency" = "Other" ]; then
fi
if [ "$autotune" = "1" ]; then
threshold=1
delay=5
retries=5
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of" $threshold "or after" $retries "retries"
tries=0
confidence=0
delay=$((delay-2)) # subtract 2 second built in delay
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence:" $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency:" $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
sleep 5
fi
echo "Frequency is" $frequency
echo
echo "If your CubeSatSim is transmitting in FUNcube mode (mode 7) you should get some frames after 30 seconds"
@ -135,7 +186,8 @@ cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg ./image_file.jpeg
python3 -m http.server 8002 &
setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8002 &>/dev/null &
#setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8002 &>/dev/null &
setsid x-www-browser http://127.0.0.1:8002/
cd /home/pi/fctelem

@ -2,7 +2,7 @@
Type=Application
Exec=/home/pi/CubeSatSim/groundstation/fox-download.sh
Name=FoxTelem Download
Comment=FIAB-v3
Comment=FIAB-v4
Icon=/home/pi/Icons/FoxTelemDownload.png
Path=/home/pi
Terminal=true

@ -2,8 +2,8 @@
Type=Application
Exec=/home/pi/CubeSatSim/groundstation/fox-profile.sh
Name=Change FoxTelem Profile
Comment=FIAB-v3
Icon=/home/pi/Downloads/foxtelem.png
Comment=FIAB-v4
Icon=/home/pi/Icons/foxtelem.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -5,6 +5,8 @@ echo "Startup script to run FoxTelem for FIAB v4"
echo
source /home/pi/venv/bin/activate
sudo killall -9 FoxTelem &>/dev/null
sudo killall -9 zenity &>/dev/null
@ -12,7 +14,7 @@ sudo killall -9 zenity &>/dev/null
FILE=/home/pi/FoxTelemetryData/.foxprofile
if [ ! -f "$FILE" ]; then
profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Fox satellites" "CubeSatSim" "AMSAT CubeSat Simulator")
profile=$(zenity --text="Choose your default FoxTelem profile:" --list 2>/dev/null --width=410 --height=120 --title="Set FoxTelem Profile" --column="Profile" --column="Receive and decode telemetry from" Fox-in-a-Box "AMSAT Satellites" "CubeSatSim" "AMSAT CubeSat Simulator")
echo $profile

@ -5,6 +5,12 @@ echo "Startup script to run FoxTelem for FIAB v4"
echo
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
echo $1
if [ "$1" != "P" ] ; then
sudo killall -9 FoxTelem &>/dev/null
FILE=/home/pi/FoxTelemetryData/.foxprofile
@ -36,4 +42,10 @@ sleep 10
fi
else
echo "Don't run FoxTelem since PacSat Ground Station mode is set"
# /home/pi/CubeSatSim/groundstation/pacsat-run.sh
fi
#$SHELL

@ -5,12 +5,16 @@ echo "Script to run FoxTelem for ARISS Radio Pi"
echo
sudo systemctl stop openwebrx
sudo systemctl stop openwebrx &>/dev/null
sudo systemctl stop rtl_tcp
sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
@ -23,12 +27,15 @@ sudo killall -9 sdrpp &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 aplay &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sudo killall -9 rtl_fm &>/dev/null
sleep 5

@ -2,8 +2,8 @@
Type=Application
Exec=/home/pi/CubeSatSim/groundstation/fox-run.sh
Name=FoxTelem
Comment=FIAB-v3
Icon=/home/pi/Downloads/foxtelem.png
Comment=FIAB-v4
Icon=/home/pi/Icons/foxtelem.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -1,9 +1,9 @@
[Desktop Entry]
Type=Application
Exec=/usr/bin/gpredict
Exec=/home/pi/CubeSatSim/groundstation/gpredict.sh
Name=Gpredict
Comment=ISS and Satellite Tracking for ARISS Radio Pi
Icon=/home/pi/Downloads/gpredict.png
Icon=/home/pi/Icons/gpredict.png
Path=/home/pi
Terminal=false
Categories=HamRadio

@ -0,0 +1,21 @@
#!/bin/bash
#
if [ ! $(systemctl get-default | grep graphical) ]; then
echo "Graphical User Interface not running!"
echo
echo "Do you want to reboot and switch to GUI so you can run Gpredict?"
read answer
if [ "$answer" = "y" ] || [ "$answer" = "yes" ]; then
echo "Rebooting!"
sudo raspi-config nonint do_boot_behaviour B4
sudo reboot now
else
echo "You can run Gpredict next time you run the GUI."
exit
fi
fi
nohup /usr/bin/gpredict </dev/null >/dev/null 2>&1 &

@ -118,6 +118,16 @@ if (latitude != 0) and (longitude != 0):
system(longSedStr)
print("\nKLAtracker configuration updated with your latitude and longitude")
latSedStr = 'sed -i "s/latitude=.*/latitude=' + str(latitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties'
#print (latSedStr)
system(latSedStr)
longSedStr = 'sed -i "s/longitude=.*/longitude=' + str(longitude) + '/g" /home/pi/PacSatGround/PacSatGround.properties'
#print (longSedStr)
system(longSedStr)
print("\nPacsat configuration updated with your latitude and longitude")
receiver_gpsSedStr = 'sudo sed -i "s/ ' + dquote + 'lat' + dquote + ': .*/ ' + dquote + 'lat' + dquote + ': ' + str(latitude) + ',/g" /var/lib/openwebrx/settings.json'
#print (receiver_gpsSedStr)

@ -12,4 +12,3 @@ python3 /home/pi/CubeSatSim/groundstation/loc-foxtelem.py
#/usr/bin/gpredict
nohup /usr/bin/gpredict </dev/null >/dev/null 2>&1 &

@ -12,8 +12,12 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 aplay &>/dev/null
@ -37,7 +41,9 @@ sudo /etc/init.d/alsa-utils start
echo
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=360 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" APRS "Test APRS decoding with CubeSatSim WAV file")
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=400 --title="Packet Decoding with Direwolf" --text="Choose the frequency for packet decoding" --column="kHz" --column="Application" 144390 "APRS US 2m" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" 144800 "APRS European 2m" 145175 "APRS Australian 2m" Other "Choose another frequency" 145825 "APRS on ISS" APRS "Test APRS decoding with CubeSatSim WAV file")
#echo $frequency
@ -75,6 +81,11 @@ elif [ "$choice" = "2" ] || [ "$frequency" = "434900" ] ; then
echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets."
echo
elif [ "$frequency" = "Auto-tune" ] ; then
frequency=434900000
autotune=1
elif [ "$choice" = "3" ] || [ "$frequency" = "144800" ]; then
frequency=144800000
@ -155,7 +166,41 @@ echo
#fi
sleep 5
#sleep 5
if [ "$autotune" = "1" ]; then
threshold=1
delay=1
retries=30
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of " $threshold " or after " $retries " retries"
tries=0
confidence=0
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
# sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence: " $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency: " $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
echo
echo "If your CubeSatSim is transmitting in APRS mode (mode 1) then you should see packets."
echo
fi
value=`aplay -l | grep "Loopback"`
echo "$value" > /dev/null
@ -166,5 +211,4 @@ rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t r
rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1
sleep 5

@ -0,0 +1,208 @@
#!/bin/bash
# script to run FoxTelem
echo "Script to configure the Pacsat Ground Station for FIAB v4"
echo
#source /home/pi/venv/bin/activate
sudo killall -9 java &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo killall -9 direwolf &>/dev/null
#FILE=/home/pi/.pacsatprofile
#if [ ! -f "$FILE" ]; then
# profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title=" Ground Station Choice" --column="Choice" --column="Result" "" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat")
# echo $profile
echo "Here are the configuration choices:"
echo
echo " 1. Pacsat Ground Station Configuration"
echo
echo " 2. Pacsat Ground Station Simulation Configuration"
echo
echo " 3. Set Frequencies"
echo
echo " 4. Reset Pacsat Satellite"
echo
echo "Which do you choose? Enter 1 - 4"
echo
read -r ANS
if [ -z "$ANS" ]; then
echo "No choice made. Exiting."
sleep 3
exit
fi
if [ "$ANS" = "1" ] || [ "$ANS" = "2" ] ; then
if [ "$ANS" = "1" ] ; then
echo "Here are your Pacsat Ground Station Configuration choices:"
else
echo "Here are your Pacsat Ground Station Simulation Configuration choices:"
fi
echo
echo " 1. Pacsat Ground Station Callsign"
echo
echo " 2. Set Remote Pacsat Satellite Callsign in Ground Station configuration"
echo
echo " 3. Reset Pacsat Ground Station Configuration"
echo
read -r CH
if [ -z "$CH" ]; then
echo "No choice made. Exiting."
sleep 3
exit
fi
if [ "$CH" = "1" ] ; then
echo
if [ "$ANS" = "1" ] ; then
oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties)
else
oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGroundLoop/PacSatGround.properties)
fi
echo "Callsign in PacSatGround.properties is "
echo $oldcallsign
echo "Enter new callsign in all capitals: "
echo
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $oldcallsign
else
echo "Configured callsign is "
echo $callsign
if [ ! "$callsign" = "$oldcallsign" ] ; then
if [ "$ANS" = "1" ] ; then
sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties
cat /home/pi/PacSatGround/PacSatGround.properties
else
sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGroundLoop/PacSatGround.properties
cat /home/pi/PacSatGroundLoop/PacSatGround.properties
fi
fi
fi
elif [ "$CH" = "2" ] ; then
echo "You have chosen to set the remote CubeSatSim Pacsat Satellite callsign in ground station configuration"
echo
PROPERTIES=/home/pi/PacSatGround/spacecraft/PacSatSim.properties
PROPERTIES_L=/home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties
if [ "$ANS" = "1" ] ; then
oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' $PROPERTIES )
else
oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' $PROPERTIES_L )
fi
echo "Current value of remote Pacsat callsign is"
echo $oldcallsign
echo
echo "Enter new callsign in all capitals: "
echo
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $oldcallsign
else
if [ "$ANS" = "1" ] ; then
sudo sed -i "s/$oldcallsign/$callsign/g" $PROPERTIES
else
sudo sed -i "s/$oldcallsign/$callsign/g" $PROPERTIES_L
fi
echo
echo "Changing callsign to "
echo $callsign
echo
echo "You will see the change next time you run the Pacsat Ground Station"
echo "You can close this window"
fi
elif [ "$CH" = "3" ] ; then
echo "You have chosen to reset the Pacsat Ground Station Configuration"
echo
# echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft"
# echo
if [ "$ANS" = "1" ] ; then
sudo rm -r /home/pi/PacSatGround
# cd
# sudo rm PacSatGround.zip
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p-s/spacecraft/PacSatGround_0.46o/PacSatGround.zip
# unzip PacSatGround.zip -d PacSatGround
# sudo rm PacSatGround.zip
else
sudo rm -r /home/pi/PacSatGroundLoop
# cd
# sudo rm PacSatGround.zip
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b-p-s/spacecraft/PacSatGround_0.46o/PacSatGround.zip
# unzip PacSatGround.zip -d PacSatGroundLoop
# sudo rm PacSatGround.zip
fi
echo "You can close this window now"
else
echo "Please choose an option 1-3"
echo
fi
elif [ "$ANS" = "3" ] ; then
echo "You have chosen to set the Frequency of the Pacsat Ground Station"
echo
/home/pi/CubeSatSim/config -F
echo "You can close this window now"
elif [ "$ANS" = "4" ] ; then
echo "You have chosen to reset the Pacsat Satellite"
echo
/home/pi/CubeSatSim/config -k
else
echo "Please enter only 1 to 4"
fi
# sleep 10
#$SHELL

@ -0,0 +1,90 @@
#!/bin/bash
# script to run FoxTelem
echo "Startup script to run the Pacsat Ground Station"
echo
# source /home/pi/venv/bin/activate
sudo killall -9 java &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 aplay &>/dev/null
if [ ! $(systemctl get-default | grep graphical) ]; then
echo "Graphical User Interface not running!"
echo
echo "Do you want to reboot and switch to GUI so you can run the Pacsat Ground Station"
read answer
if [ "$answer" = "y" ] || [ "$answer" = "yes" ]; then
echo "Rebooting!"
sudo raspi-config nonint do_boot_behaviour B4
sudo reboot now
else
echo "You can run the Pacsat Ground Station next time you run the GUI."
exit
fi
fi
#FILE=/home/pi/.pacsatprofile
#if [ ! -f "$FILE" ]; then
profile=$(zenity --timeout=10 --text="Choose what you want to do:" --list 2>/dev/null --width=410 --height=220 --title="Pacsat Ground Station" --column="Choice" --column="Result" "Pacsat" "Run Pacsat Ground Station" "Configure" "Configure the Pacsat Ground Station" "Simulate" "Run a Locally Simulated Pacsat")
echo $profile
if [ -z "$profile" ]; then
echo "No choice made. Default to Pacsat Ground Station."
profile="Pacsat"
fi
if [ "$ANS" = "1" ] || [ "$profile" = "Pacsat" ] ; then
echo "You have chosen to run the Pacsat Ground Station"
# echo "p" > /home/pi/.pacsatprofile
echo
/home/pi/CubeSatSim/groundstation/pacsat.sh
elif [ "$ANS" = "2" ] || [ "$profile" = "Configure" ] ; then
echo "You have chosen to configure the Pacsat Ground Station"
echo
/home/pi/CubeSatSim/groundstation/pacsat-config.sh
elif [ "$ANS" = "3" ] || [ "$profile" = "Simulate" ] ; then
sudo systemctl stop transmit
echo "You have chosen the Pacsat Ground Station with Local Simulated Satellite"
sleep 1
/usr/bin/x-terminal-emulator --geometry=120x40 -e "bash /home/pi/CubeSatSim/pacsatsim.sh l"
sleep 1
/home/pi/CubeSatSim/groundstation/pacsat.sh l
else
echo "Please enter only 1 or 2 or 3"
fi
# sudo killall -9 direwolf &>/dev/null
sleep 10
#$SHELL

@ -0,0 +1,10 @@
[Desktop Entry]
Name=Pacsat Ground Station
GenericName=Pacsat Ground Station
Comment=Pacsat
Exec=/usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/groundstation/pacsat-run.sh"
Icon=/home/pi/Icons/pacsat.png
Terminal=true
Type=Application
Categories=HamRadio;
Keywords=APRS;

@ -0,0 +1,371 @@
#!/bin/bash
function start-rtl {
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
#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -r 48000 -t raw -f S16_LE -c 1
# rtl_fm -g 12 -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 &
rtl_fm -M fm -f $frequency -s 48k | aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1 &
}
# script to auto decode packets using Direwolf and FM TXC and run Pacsat Ground Station
sudo pkill -f "/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf"
loopback=0
vox=0
#rpitx=0
#card=0
#pwm=0
if [ "$1" = "l" ] ; then
loopback=1
elif [ "$1" = "v" ] ; then
vox=1
#elif [ "$1" = "c" ] ; then
# card=1
#else
# pwm=1
fi
if [[ $(lsusb | grep "RTL") ]] ; then
echo "RTL-SDR detected"
rtl=1
else
echo "No RTL-SDR detected"
rtl=0
# pwm=1
fi
if [[ $(arecord -l | grep "USB Audio Device") ]] ; then
echo "USB Sound Card detected"
soundcard=1
/home/pi/CubeSatSim/config -L -1
else
echo "No USB Sound Card detected"
soundcard=0
fi
gpio -g mode 12 up
if [[ $(gpio -g read 12 | grep 0) ]] ; then
echo "LPF is present"
lpf=1
else
echo "LPF not present"
lpf=0
fi
gpio -g mode 7 up
if [[ $(gpio -g read 7 | grep 0) ]] ; then
echo "TXC is present"
txc=1
else
echo "TXC not present"
txc=0
fi
card="Headphones"
if [[ $(gpio -v | grep "Pi 5") ]] ; then
# echo "Since Pi 5, setting TXC to LPF setting and using USB headphones"
# txc=$lpf
echo "Don't use TXC for Pi 5 for now"
txc=0
lpf=0
card="Device"
fi
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then
rpitx=1
elif [ "$txc" = "0" ] && [ "$lpf" = "1" ]; then
rpitx=1
else
rpitx=0
fi
if [ "$soundcard" = "0" ] && [ "$rtl" = "0" ]; then
echo "Won't work since can't receive with Sound Card or RTL-SDR"
sleep 10
exit
fi
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
MODE=$1
if [ ! "$MODE" = "P" ] && [ ! "$loopback" = "1" ] ; then
echo
echo "Changing to Pacsat Ground Station Mode."
echo "You might reboot"
echo
sleep 5
/home/pi/CubeSatSim/config -I
fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
callsign="$1"
txfrequency="$7e3"
rxfrequency="$8e3"
frequency="$8e6"
echo -n "Callsign is "
echo $callsign
if [ "$loopback" = "1" ] ; then
# if [ ! "$MODE" = "p" ] ; then
echo
echo "Switching to Pacsat mode for the Simulated Pacsat Satellite"
echo
/home/pi/CubeSatSim/config -G -n
# fi
if [ ! -d "/home/pi/PacSatGroundLoop" ] ; then
# if [ ! "$loopback" = "1" ] ; then # don't do this for now.
cd
sudo rm PacSatGroundLoop.zip &>/dev/null
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip
cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip .
unzip PacSatGround.zip -d PacSatGroundLoop
sudo rm PacSatGround.zip
mkdir PacSatGroundLoop/spacecraft
mv PacSatGroundLoop/PacSatGround/spacecraft/PacSatSim.properties PacSatGroundLoop/spacecraft/PacSatSim.properties
mv PacSatGroundLoop/PacSatGround/stp.dat PacSatGroundLoop/stp.dat
mv PacSatGroundLoop/PacSatGround/seq.dat PacSatGroundLoop/seq.dat
mv PacSatGroundLoop/PacSatGround/PacSatGround.properties PacSatGroundLoop/PacSatGround.properties
sudo sed -i 's/logfile_dir=\/home\/pi\/PacSatGround/logfile_dir=\/home\/pi\/PacSatGroundLoop/g' /home/pi/PacSatGroundLoop/PacSatGround.properties
FILE=/home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties
if [ -f "$FILE" ]; then
FILE2=/home/pi/PacSatGroundLoop/spacecraft/PacSatSim.properties
sudo rm $FILE2
cp $FILE $FILE2
else
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
fi
fi
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGroundLoop/PacSatGround.properties
else
echo -n "Transmit Frequency is "
echo $txfrequency
echo -n "Receive Frequency is "
echo $rxfrequency
sleep 2
echo
echo "Mode is Pacsat Ground Station"
echo
if [ ! -d "/home/pi/PacSatGround" ] ; then
cd
sudo rm PacSatGround.zip &>/dev/null
# wget https://github.com/alanbjohnston/CubeSatSim/raw/refs/heads/master-b/spacecraft/PacSatGround_0.46o/PacSatGround.zip
cp /home/pi/CubeSatSim/spacecraft/PacSatGround_0.46o/PacSatGround.zip .
unzip PacSatGround.zip
sudo rm PacSatGround.zip
FILE=/home/pi/Desktop/PacsatGround/spacecraft/PacSatSim.properties
if [ -f "$FILE" ]; then
FILE2=/home/pi/PacSatGround/spacecraft/PacSatSim.properties
sudo rm $FILE2
cp $FILE $FILE2
else
echo
echo "The first time you run the Ground Station, you will need to select Yes to override files, then put in your callsign"
sleep 10
fi
fi
sudo sed -i "s/TNC_TX_DELAY=.*$/TNC_TX_DELAY=750/g" /home/pi/PacSatGround/PacSatGround.properties
fi
sudo modprobe snd-aloop
sudo systemctl stop command >/dev/null 2>&1
sudo systemctl stop command >/dev/null 2>&1
sudo systemctl stop openwebrx >/dev/null 2>&1
sudo systemctl stop rtl_tcp >/dev/null 2>&1
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 java &>/dev/null
sudo killall -9 CubicSDR &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo usermod -a -G gpio pi
if [ "$loopback" = "1" ] ; then
echo "1: Using Audio Loopback, No Transmit or Receive"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="PTT GPIOD gpiochip0 17"
else
if [ "$lpf" = "1" ] ; then
if [ "$txc" = "1" ] && [ "$soundcard" = "1" ] ; then
if [ "$rpitx" = "1" ] ; then
echo "2: Using FM for Receive and rpitx for Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
echo "3: Using FM for Receive and Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=$card,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
fi
elif [ "$txc" = "1" ] && [ "$soundcard" = "0" ] ; then
if [ "$rtl" = "1" ]; then
if [ "$rpitx" = "1" ]; then
echo "2b: Using RTL-SDR for Receive and rpitx for Transmit"
start-rtl
# ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
echo "3b: RTL-SDR for Receive Only"
start-rtl
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="#PTT GPIOD gpiochip0 17"
fi
else
echo "Won't work since can't receive with Sound Card or RTL-SDR"
sleep 10
exit
fi
else
if [ "$rtl" = "1" ]; then
echo "4: Using RTL-SDR for Receive and rpitx for Transmit"
start-rtl
# ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1 plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
else
echo "5: Using Sound Card for Receive and rpitx for Transmit"
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
fi
fi
else
if [ "$txc" = "1" ] ; then
echo "6: Using FM for Receive Only"
ADEVICE="ADEVICE shared_mic plughw:CARD=$card,DEV=0"
PTT="#PTT GPIOD gpiochip0 -20"
else
if [ "$rtl" = "1" ] ; then
echo "7: Using RTL-SDR for Receive Only"
start-rtl
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=1"
PTT="#PTT GPIOD gpiochip0 17"
else
echo "8: Using USB Sound Card for Receive and Transmit with RTS PTT"
ADEVICE="ADEVICE plughw:CARD=Device,DEV=0"
PTT="PTT /dev/ttyUSB0 RTS"
fi
fi
fi
fi
DIREWOLF_CONF="/home/pi/CubeSatSim/groundstation/direwolf-pacsat-tmp.conf"
echo "$ADEVICE" > $DIREWOLF_CONF
echo "MYCALL $callsign-1" >> $DIREWOLF_CONF
echo "$PTT" >> $DIREWOLF_CONF
cat /home/pi/CubeSatSim/groundstation/direwolf/direwolf-pacsat.conf >> $DIREWOLF_CONF
echo
echo "$DIREWOLF_CONF"
echo
cat $DIREWOLF_CONF
echo
# direwolf -P+ -D1 -qd -r 48000 -c $DIREWOLF_CONF &
direwolf -D3 -qd -r 48000 -c $DIREWOLF_CONF &
cd /home/pi/Desktop/PacsatGround/
if [ "$loopback" = "1" ] ; then
setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGroundLoop" # removed &
else
setsid java -Xmx512M -jar PacSatGround.jar "/home/pi/PacSatGround" # removed &
fi
sleep 10
#echo "Stopping Pacsatsim"
#$SHELL

@ -23,6 +23,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 java &>/dev/null
sudo killall -9 rtl_fm &>/dev/null

@ -3,7 +3,7 @@ Type=Application
Exec=/home/pi/CubeSatSim/groundstation/rtl-tcp.sh
Name=RTL-TCP
Comment=RTL-TCP for SDR#
Icon=/home/pi/Downloads/SDRSharp.png
Icon=/home/pi/Icons/SDRSharp.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -23,13 +23,17 @@ echo "Note: you need to be on the Wifi network: $ssid"
echo
sudo systemctl stop openwebrx
sudo systemctl stop openwebrx &>/dev/null
sleep 2
pkill -o chromium &>/dev/null
sudo systemctl stop rtl_tcp
pkill -o firefox &>/dev/null
sudo systemctl stop rtl_tcp &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 java &>/dev/null
@ -45,10 +49,13 @@ sudo killall -9 qsstv &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 aplay &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sudo killall -9 rtl_fm &>/dev/null
sudo /bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")'

@ -3,7 +3,7 @@ Description=RTL-TCP
[Service]
TimeoutStopSec = 5
ExecStart=/bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I)'
ExecStart=/bin/sh -c 'rtl_tcp -a $(hostname -I|cut -f1 -d " ")'
WorkingDirectory=/home/pi
StandardOutput=inherit
StandardError=inherit

@ -0,0 +1,9 @@
[Unit]
Description=RTL TCP Socket
PartOf=rtltcp.service
[Socket]
ListenStream=[::]:1234
[Install]
WantedBy=sockets.target

@ -5,7 +5,7 @@ echo "Script to run Web SDR for ARISS Radio Pi"
echo
echo "The Chromium browser will load in a few seconds with OpenWebRX."
echo "The browser will load in a few seconds with OpenWebRX."
echo "You can also use another web browser if you are on the same network as your Pi."
@ -24,12 +24,26 @@ echo "Note: you need to be on the Wifi network: $ssid"
echo
if [[ $(gpio -v | grep "Pi 4") ]] && [[ ! $(sudo raspi-config nonint get_browser | grep "chromium") ]] ; then
echo "Since Pi 4, changing default browser to Chromium"
sudo raspi-config nonint do_browser chromium
fi
if [[ $(gpio -v | grep "Pi 5") ]]&& [[ ! $(sudo raspi-config nonint get_browser | grep "firefox") ]] ; then
echo "Since Pi 5, changing default browser to Firefox"
sudo raspi-config nonint do_browser firefox
fi
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 java &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 CubicSDR &>/dev/null
@ -38,13 +52,18 @@ sudo killall -9 sdrpp &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 aplay &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo systemctl stop rtl_tcp
sudo systemctl stop rtl_tcp &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
@ -52,7 +71,8 @@ sudo systemctl restart openwebrx
sleep 10
setsid chromium-browser --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars http://127.0.0.1:8073 &>/dev/null &
#setsid chromium-browser --password-store=basic --check-for-update-interval=1 --simulate-critical-update --noerrdialogs --disable-infobars --app=http://localhost:8073 &>/dev/null &
setsid x-www-browser http://localhost:8073/
sleep 10

@ -0,0 +1,49 @@
#!/bin/bash
# script to run sdrpp
echo "Script to run SDRpp for ARISS Radio Pi"
echo
sudo systemctl stop openwebrx
sudo killall -9 java &>/dev/null
sudo killall -9 sdrpp &>/dev/null
sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
sudo killall -9 direwolf &>/dev/null
#sudo killall -9 aplay &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 CubicSDR &>/dev/null
#sudo kill `ps -aux | grep cubicsdr-packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null
#sudo kill `ps -aux | grep packet | grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null
#sudo kill `ps -aux | grep sstv_decode_prompt| grep -v grep | awk '{ print $2 }'` &>/dev/null && killall inotifywait &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sleep 5
setsid sdrpp &
sleep 10
#$SHELL

@ -3,7 +3,7 @@ Type=Application
Exec=/home/pi/CubeSatSim/groundstation/loc.sh
Name=Set My Location
Comment=Set Location for Gpredict
Icon=/home/pi/Downloads/gpredict.png
Icon=/home/pi/Icons/gpredict.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -0,0 +1,808 @@
{
"version": 8,
"sdrs": {
"rtlsdr": {
"name": "RTL-SDR",
"type": "rtl_sdr",
"profiles": {
"70cm": {
"name": "70cm Ham Band 435 MHz (CubeSatSim)",
"center_freq": 435000000,
"rf_gain": 10.0,
"samp_rate": 2400000,
"start_freq": 434900000,
"start_mod": "nfm",
"tuning_step": 1000,
"direct_sampling": 0
},
"2m": {
"name": "WX Band 161 MHz",
"center_freq": 162400000,
"rf_gain": 29,
"samp_rate": 2048000,
"start_freq": 157000000,
"start_mod": "nfm"
},
"e59a4765-4139-4ab8-89c5-d8ac3343ba70": {
"name": "2m Ham Band 146 MHz (ISS)",
"center_freq": 145000000,
"samp_rate": 2400000,
"start_freq": 145000000,
"start_mod": "nfm",
"rf_gain": 42.0,
"direct_sampling": 0
},
"faf80b0b-1a96-4a9b-96fa-ce40b109c7e0": {
"name": "70cm Ham Band 438 MHz (ISS)",
"rf_gain": 29.0,
"center_freq": 438000000,
"samp_rate": 2400000,
"start_freq": 437800000,
"start_mod": "nfm"
},
"a4fd4a5d-d2d0-4949-87e2-bda83cd83a37": {
"name": "FM Band 95 MHz",
"rf_gain": 29.0,
"center_freq": 95000000,
"samp_rate": 2400000,
"start_freq": 94000000,
"start_mod": "wfm"
},
"ce2bca29-78cb-45d8-ab46-8dea3135981c": {
"name": "10m Ham Band 28 MHz",
"rf_gain": 29.0,
"center_freq": 28000000,
"samp_rate": 2400000,
"start_freq": 28000000,
"start_mod": "usb",
"direct_sampling": 0
},
"d6cdbf2d-74e4-4cac-aaa8-e793103a8e89": {
"name": "6m Ham Band 51 MHz",
"rf_gain": 29.0,
"center_freq": 51000000,
"samp_rate": 2400000,
"start_freq": 51000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"e2aba387-1d3b-4ca8-b280-e119282b8812": {
"name": "90 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 90000000,
"samp_rate": 2400000,
"start_freq": 90000000,
"start_mod": "wfm"
},
"f700b99d-3c51-4524-b151-a0809b868ecc": {
"name": "92 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 92000000,
"samp_rate": 2400000,
"start_freq": 92000000,
"start_mod": "wfm"
},
"dc6af94f-d607-4fee-a522-7f375f66a62c": {
"name": "94 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 94000000,
"samp_rate": 2400000,
"start_freq": 94000000,
"start_mod": "wfm"
},
"6887e85a-a4dc-4245-810f-99801fc5e824": {
"name": "96 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 96000000,
"samp_rate": 2400000,
"start_freq": 96000000,
"start_mod": "wfm"
},
"a2182ed6-70a8-4377-b233-ac6f8ccc91d7": {
"name": "98 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 96000000,
"samp_rate": 2400000,
"start_freq": 96000000,
"start_mod": "wfm"
},
"57e38353-fb86-4935-899b-e365228b8ae5": {
"name": "100 MHz FM Band",
"center_freq": 100000000,
"samp_rate": 2400000,
"start_freq": 100000000,
"start_mod": "wfm"
},
"5e9ec6dd-905d-4781-bd13-9cb702f58e84": {
"name": "102 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 102000000,
"samp_rate": 2400000,
"start_freq": 102000000,
"start_mod": "wfm"
},
"ef2c703c-2e22-4e87-82b5-581420d704bd": {
"name": "104 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 104000000,
"samp_rate": 2400000,
"start_freq": 104000000,
"start_mod": "wfm"
},
"34cc3ddf-8018-4288-acb9-29e6940bc37e": {
"name": "106 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 106000000,
"samp_rate": 2400000,
"start_freq": 106000000,
"start_mod": "wfm"
},
"b4693683-ccf5-474d-a2d9-9a47b0a18ee2": {
"name": "108 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 108000000,
"samp_rate": 2400000,
"start_freq": 108000000,
"start_mod": "wfm"
},
"34224d77-7b61-467c-b78f-18c7f3af1a0c": {
"name": "110 MHz FM Band",
"rf_gain": 29.0,
"center_freq": 110000000,
"samp_rate": 2400000,
"start_freq": 110000000,
"start_mod": "wfm"
},
"8dd82d97-73db-4fa7-ac41-263c3026ea1d": {
"name": "112 MHz",
"rf_gain": 29.0,
"center_freq": 112000000,
"samp_rate": 2400000,
"start_freq": 112000000,
"start_mod": "nfm"
},
"79304b30-f10d-469e-9617-50a19bfdb435": {
"name": "114 MHz",
"rf_gain": 29.0,
"center_freq": 114000000,
"samp_rate": 2400000,
"start_freq": 114000000,
"start_mod": "nfm"
},
"c00bf096-27b8-4262-832c-df1a308d7eb9": {
"name": "116 MHz",
"rf_gain": 29.0,
"center_freq": 116000000,
"samp_rate": 2400000,
"start_freq": 116000000,
"start_mod": "nfm"
},
"669d25a6-6c15-4131-a330-3c33dd2147f0": {
"name": "118 Mhz Air Band",
"rf_gain": 29.0,
"center_freq": 118000000,
"samp_rate": 2400000,
"start_freq": 118000000,
"start_mod": "am"
},
"948248fa-43d9-4e7d-bf86-afaadd391779": {
"name": "120 MHz Air Band",
"rf_gain": 29.0,
"center_freq": 120000000,
"samp_rate": 2400000,
"start_freq": 120000000,
"start_mod": "am"
},
"b634273b-8fc8-4e87-b5c4-e6226d4be0ac": {
"name": "122 MHz Air Band",
"rf_gain": 42.0,
"center_freq": 122000000,
"samp_rate": 2400000,
"start_freq": 121000000,
"start_mod": "nfm"
},
"c55289a2-8286-4a3d-a505-37ba2867571a": {
"name": "124 Mhz Air Band",
"rf_gain": 42.0,
"center_freq": 124000000,
"samp_rate": 2400000,
"start_freq": 124000000,
"start_mod": "am"
},
"4fe488b7-f369-43ba-bb49-91e1a185be7a": {
"name": "126 MHz Air Band",
"rf_gain": 29.0,
"center_freq": 126000000,
"samp_rate": 2400000,
"start_freq": 126000000,
"start_mod": "am"
},
"e79639a2-1384-4e92-8e46-f6e5670ec9fd": {
"name": "128 MHz Air Band",
"rf_gain": 42.0,
"center_freq": 128000000,
"samp_rate": 2400000,
"start_freq": 128000000,
"start_mod": "am"
},
"319f3fb2-b98a-4620-85a7-a99d5a722bd5": {
"name": "130 MHz Air Band",
"rf_gain": 42.0,
"center_freq": 130000000,
"samp_rate": 2400000,
"start_freq": 130000000,
"start_mod": "am"
},
"63c5c2ce-07de-496c-81f6-b188a7adbf39": {
"name": "132 MHz Air Band",
"rf_gain": 42.0,
"center_freq": 132000000,
"samp_rate": 2400000,
"start_freq": 132000000,
"start_mod": "am"
},
"386bdc7b-eb10-4e05-972a-69d730a23cd8": {
"name": "134 MHz Air Band",
"rf_gain": 29.0,
"center_freq": 134000000,
"samp_rate": 2400000,
"start_freq": 134000000,
"start_mod": "am"
},
"ae8ea8b1-23de-45ef-b8c4-3b83a188e65d": {
"name": "136 MHz Air Band",
"rf_gain": 42.0,
"center_freq": 136000000,
"samp_rate": 2400000,
"start_freq": 136000000,
"start_mod": "am"
},
"c0b1a28c-5e07-400a-a5f3-07c62db27587": {
"name": "138 MHz NOAA Weather Satellite Band",
"rf_gain": 42.0,
"center_freq": 138000000,
"samp_rate": 2400000,
"start_freq": 138000000,
"start_mod": "nfm"
},
"20f7ce56-fd85-4b3e-8fac-94cbe9ba0e1d": {
"name": "140 MHz ",
"rf_gain": 42.0,
"center_freq": 140000000,
"samp_rate": 2400000,
"start_freq": 140000000,
"start_mod": "nfm"
},
"882079f8-5697-428a-ae9d-bcc091269c7f": {
"name": "142 MHz ",
"rf_gain": 42.0,
"center_freq": 142000000,
"samp_rate": 2400000,
"start_freq": 142000000,
"start_mod": "nfm"
},
"da1b3f12-2eba-40e9-8c62-33493adf74b3": {
"name": "144 MHz 2m Ham Band",
"rf_gain": 42.0,
"center_freq": 144000000,
"samp_rate": 2400000,
"start_freq": 144000000,
"start_mod": "nfm"
},
"8d9cf1e1-44c5-41c4-bcea-7b1c69446e62": {
"name": "146 MHz 2m Ham Band",
"rf_gain": 42.0,
"center_freq": 146000000,
"samp_rate": 2400000,
"start_freq": 146000000,
"start_mod": "nfm"
},
"eec8aa0d-3485-43d2-baa4-82f7d9e14df6": {
"name": "148 MHz 2m Ham Band",
"rf_gain": 42.0,
"center_freq": 148000000,
"samp_rate": 2400000,
"start_freq": 148000000,
"start_mod": "nfm"
},
"bf66a908-1988-4aec-b998-06e2bc7d0a84": {
"name": "150 MHz",
"rf_gain": 42.0,
"center_freq": 150000000,
"samp_rate": 2400000,
"start_freq": 150000000,
"start_mod": "nfm"
},
"0389f270-b919-4aae-a313-f73697059f70": {
"name": "152 MHz",
"rf_gain": 42.0,
"center_freq": 152000000,
"samp_rate": 2400000,
"start_freq": 152000000,
"start_mod": "nfm"
},
"6ef9d955-76aa-46c0-8463-2c23def5e37b": {
"name": "154 MHz",
"rf_gain": 42.0,
"center_freq": 154000000,
"samp_rate": 2400000,
"start_freq": 154000000,
"start_mod": "nfm"
},
"5d0a64c7-3bce-408e-94d9-c8315bef7540": {
"name": "156 MHz",
"rf_gain": 42.0,
"center_freq": 156000000,
"samp_rate": 2400000,
"start_freq": 156000000,
"start_mod": "nfm"
},
"5b869cae-ffa7-4554-96af-7acd497bbaf3": {
"name": "158 MHz",
"rf_gain": 42.0,
"center_freq": 158000000,
"samp_rate": 2400000,
"start_freq": 158000000,
"start_mod": "nfm"
},
"0de7c5d4-14fc-4655-9a81-2bcebb2f4147": {
"name": "160 MHz",
"rf_gain": 42.0,
"center_freq": 160000000,
"samp_rate": 2400000,
"start_freq": 160000000,
"start_mod": "nfm"
},
"8ca54821-8b80-4938-a35c-9fe25e2320d1": {
"name": "162 MHz",
"rf_gain": 42.0,
"center_freq": 162000000,
"samp_rate": 2400000,
"start_freq": 162000000,
"start_mod": "nfm"
},
"f74d262d-9e98-4030-86b2-45676121ff1e": {
"name": "164 MHz",
"rf_gain": 42.0,
"center_freq": 164000000,
"samp_rate": 2400000,
"start_freq": 164000000,
"start_mod": "nfm"
},
"bfc9c686-6c06-4de2-b1d5-c8f012131042": {
"name": "168 MHz",
"rf_gain": 42.0,
"center_freq": 168000000,
"samp_rate": 2400000,
"start_freq": 167000000,
"start_mod": "nfm"
},
"5468e597-d529-42fe-9fcf-0ff4fa9e2d06": {
"name": "170 MHz",
"rf_gain": 42.0,
"center_freq": 170000000,
"samp_rate": 2400000,
"start_freq": 170000000,
"start_mod": "nfm"
},
"e124cc6e-7177-4d5f-ae5b-2ec6a6fa2956": {
"name": "172 MHz",
"rf_gain": 42.0,
"center_freq": 172000000,
"samp_rate": 2400000,
"start_freq": 172000000,
"start_mod": "nfm"
},
"1ce0f3ed-4763-4f00-916a-4f72d29ba410": {
"name": "174 MHz ",
"rf_gain": 42.0,
"center_freq": 174000000,
"samp_rate": 2400000,
"start_freq": 174000000,
"start_mod": "nfm"
},
"639b1496-a2b9-4a42-ad28-3cda89fbe2fb": {
"name": "420 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 420000000,
"samp_rate": 2400000,
"start_freq": 420000000,
"start_mod": "nfm"
},
"bbc9b57e-ea86-43ef-be65-cb2337615ae5": {
"name": "422 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 422000000,
"samp_rate": 2400000,
"start_freq": 422000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"3aed286d-7d13-4338-8621-d1c0dfdf3ac6": {
"name": "424 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 424000000,
"samp_rate": 2400000,
"start_freq": 424000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"9ae664b4-48f3-410a-8995-edc60127d746": {
"name": "426 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 426000000,
"samp_rate": 2400000,
"start_freq": 426000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"24d2467b-6740-42b5-8d3f-8f389fc0860b": {
"name": "428 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 428000000,
"samp_rate": 2400000,
"start_freq": 428000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"debbc3ab-081d-41e7-80fe-7d564838154e": {
"name": "430 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 430000000,
"samp_rate": 2400000,
"start_freq": 430000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"649233e0-fc85-415d-b88e-94750f49ca4b": {
"name": "432 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 432000000,
"samp_rate": 2400000,
"start_freq": 432000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"bed3b482-fd3b-45ee-b924-200aa4223ace": {
"name": "434 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 434000000,
"samp_rate": 2400000,
"start_freq": 434000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"58dfac9e-6030-4bb3-ba28-465285baa25e": {
"name": "436 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 436000000,
"samp_rate": 2400000,
"start_freq": 436000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"4c293b84-cd43-495f-95a5-1fcabfe4e4c7": {
"name": "438 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 438000000,
"samp_rate": 2400000,
"start_freq": 438000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"0e763161-a0e8-411a-abe6-c1af13045f27": {
"name": "440 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 440000000,
"samp_rate": 2400000,
"start_freq": 440000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"6dda77d3-e859-41b7-9b0b-22c2dee47472": {
"name": "442 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 442000000,
"samp_rate": 2400000,
"start_freq": 442000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"285813ef-aa6d-433f-a316-074f47e02073": {
"name": "444 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 444000000,
"samp_rate": 2400000,
"start_freq": 444000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"e0842b63-6857-4554-874b-fad99e4db03a": {
"name": "446 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 446000000,
"samp_rate": 2400000,
"start_freq": 446000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"c7b21c80-cfef-42e8-a6fe-c5eea4556c7e": {
"name": "448 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 448000000,
"samp_rate": 2400000,
"start_freq": 448000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"d98b4d4a-8247-4a99-9fc7-89780e5e1fef": {
"name": "450 MHz 70cm Ham Band",
"rf_gain": 42.0,
"center_freq": 450000000,
"samp_rate": 2400000,
"start_freq": 450000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"a09a546f-c56f-41b5-ae34-c5511afbcef5": {
"name": "460 MHz",
"rf_gain": 42.0,
"center_freq": 460000000,
"samp_rate": 2400000,
"start_freq": 460000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"232b2ae6-88dd-4e58-b489-37f310e5e204": {
"name": "462 MHz FRS/GMRS",
"rf_gain": 42.0,
"center_freq": 462000000,
"samp_rate": 2400000,
"start_freq": 462000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"41db9b38-87d7-40a0-9f90-1f0c77c054d9": {
"name": "464 MHz FRS/GMRS",
"rf_gain": 42.0,
"center_freq": 464000000,
"samp_rate": 2400000,
"start_freq": 464000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"e9bb7781-eb9b-4314-b399-2d96c52716f0": {
"name": "466 MHz FRS/GMRS",
"rf_gain": 42.0,
"center_freq": 466000000,
"samp_rate": 2400000,
"start_freq": 466000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"5d9e07e8-eb42-4832-82c9-016f05d89027": {
"name": "468 MHz FRS/GMRS",
"rf_gain": 42.0,
"center_freq": 468000000,
"samp_rate": 2400000,
"start_freq": 468000000,
"start_mod": "nfm",
"direct_sampling": 0
},
"20m": {
"name": "20m",
"center_freq": 14150000,
"samp_rate": 384000,
"start_freq": 14070000,
"start_mod": "usb",
"tuning_step": "500",
"rf_gain": 42.0,
"direct_sampling": 1
},
"30m": {
"name": "30m",
"center_freq": 10125000,
"samp_rate": 192000,
"start_freq": 10142000,
"start_mod": "usb",
"tuning_step": "500",
"rf_gain": 42.0,
"direct_sampling": 1
},
"40m": {
"name": "40m",
"center_freq": 7100000,
"samp_rate": 256000,
"start_freq": 7070000,
"start_mod": "lsb",
"tuning_step": "500",
"rf_gain": 42.0,
"direct_sampling": 1
},
"80m": {
"name": "80m",
"center_freq": 3650000,
"samp_rate": 384000,
"start_freq": 3570000,
"start_mod": "lsb",
"tuning_step": "500",
"rf_gain": 42.0,
"direct_sampling": 1
},
"49m": {
"name": "49m Broadcast",
"center_freq": 6050000,
"samp_rate": 384000,
"start_freq": 6070000,
"start_mod": "am",
"tuning_step": "1000",
"rf_gain": 42.0,
"direct_sampling": 1
},
"c1982ce1-7504-455e-908c-dc097fa031a8": {
"name": "1090 MHz ADS-B Band",
"rf_gain": 42.0,
"center_freq": 1090000000,
"samp_rate": 2400000,
"start_freq": 1090000000,
"start_mod": "adsb",
"tuning_step": 1,
"direct_sampling": 0
},
"cb7f2f8e-e317-4a5e-9504-826dd3781791": {
"name": "978 MHz ADS-B Band",
"rf_gain": 42.0,
"center_freq": 978000000,
"samp_rate": 2400000,
"start_freq": 978000000,
"start_mod": "adsb",
"tuning_step": 1
}
}
},
"airspy": {
"name": "Airspy HF+",
"type": "airspyhf",
"rf_gain": "auto",
"profiles": {
"20m": {
"name": "20m",
"center_freq": 14150000,
"samp_rate": 384000,
"start_freq": 14070000,
"start_mod": "usb",
"tuning_step": "500"
},
"30m": {
"name": "30m",
"center_freq": 10125000,
"samp_rate": 192000,
"start_freq": 10142000,
"start_mod": "usb",
"tuning_step": "500"
},
"40m": {
"name": "40m",
"center_freq": 7100000,
"samp_rate": 256000,
"start_freq": 7070000,
"start_mod": "lsb",
"tuning_step": "500"
},
"80m": {
"name": "80m",
"center_freq": 3650000,
"samp_rate": 384000,
"start_freq": 3570000,
"start_mod": "lsb",
"tuning_step": "500"
},
"49m": {
"name": "49m Broadcast",
"center_freq": 6050000,
"samp_rate": 384000,
"start_freq": 6070000,
"start_mod": "am",
"tuning_step": "1000"
}
}
},
"sdrplay": {
"name": "SDRPlay device",
"type": "sdrplay",
"antenna": "Antenna A",
"rf_gain": "auto",
"profiles": {
"20m": {
"name": "20m",
"center_freq": 14150000,
"samp_rate": 500000,
"start_freq": 14070000,
"start_mod": "usb",
"tuning_step": "500"
},
"30m": {
"name": "30m",
"center_freq": 10125000,
"samp_rate": 250000,
"start_freq": 10142000,
"start_mod": "usb",
"tuning_step": "500"
},
"40m": {
"name": "40m",
"center_freq": 7100000,
"samp_rate": 500000,
"start_freq": 7070000,
"start_mod": "lsb",
"tuning_step": "500"
},
"80m": {
"name": "80m",
"center_freq": 3650000,
"samp_rate": 500000,
"start_freq": 3570000,
"start_mod": "lsb",
"tuning_step": "500"
},
"49m": {
"name": "49m Broadcast",
"center_freq": 6000000,
"samp_rate": 500000,
"start_freq": 6070000,
"start_mod": "am",
"tuning_step": "1000"
}
}
}
},
"receiver_name": "ARISS Radio Pi",
"receiver_location": "Budapest, Hungary",
"receiver_asl": 200,
"receiver_admin": "example@example.com",
"receiver_gps": {
"lat": 39.95233,
"lon": -75.16379
},
"photo_title": "Panorama of Budapest from Sch\u00f6nherz Zolt\u00e1n Dormitory",
"photo_desc": "",
"max_clients": 20,
"keep_files": 20,
"session_timeout": 0,
"usage_policy_url": "policy",
"allow_chat": true,
"allow_audio_recording": true,
"allow_center_freq_changes": false,
"magic_key": "memagic",
"receiver_keys": [],
"waterfall_scheme": "GoogleTurboWaterfall",
"fft_fps": 9,
"fft_size": 4096,
"fft_voverlap_factor": 0.3,
"waterfall_levels": {
"min": -88.0,
"max": -20.0
},
"waterfall_auto_levels": {
"min": 3.0,
"max": 10.0
},
"waterfall_auto_level_default_mode": false,
"waterfall_auto_min_range": 50,
"audio_compression": "adpcm",
"fft_compression": "adpcm",
"tuning_precision": 2,
"eibi_bookmarks_range": 0,
"repeater_range": 0,
"map_type": "google",
"google_maps_api_key": "",
"openweathermap_api_key": "",
"map_position_retention_time": 7200,
"map_ignore_indirect_reports": false,
"map_prefer_recent_reports": true,
"callsign_url": "https://www.qrzcq.com/call/{}",
"vessel_url": "https://www.vesselfinder.com/vessels/details/{}",
"flight_url": "https://flightaware.com/live/flight/{}",
"modes_url": "https://flightaware.com/live/modes/{}/redirect"
}

@ -15,6 +15,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 java &>/dev/null

@ -21,6 +21,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null

@ -4,10 +4,12 @@ echo "Script to decode SSTV using QSSTV with rtl_fm"
echo
sudo systemctl stop openwebrx
sudo systemctl stop openwebrx &>/dev/null
sudo modprobe snd-aloop
sudo killall -9 sdrpp &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_fm &>/dev/null
@ -16,10 +18,12 @@ sudo killall -9 aplay &>/dev/null
sudo killall -9 direwolf &>/dev/null
sudo systemctl stop rtl_tcp
sudo systemctl stop rtl_tcp &>/dev/null
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null
sudo killall -9 java &>/dev/null
@ -30,11 +34,16 @@ sudo killall -9 sdrpp &>/dev/null
sudo killall -9 zenity &>/dev/null
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
sudo killall -9 rtl_fm &>/dev/null
#echo "s" >> .mode
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=220 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file")
autotune=0
frequency=$(zenity --timeout=10 --list 2>/dev/null --width=410 --height=270 --title="SSTV Decoding using QSSTV" --text="Choose the frequency for SSTV decoding:" --column="kHz" --column="Use" 145800 "ISS" 434900 "CubeSatSim" Auto-tune "CubeSatSim Auto-tune" Other "Choose another frequency" SSTV "Test SSTV decoding with WAV file")
echo $frequency
@ -70,6 +79,11 @@ echo
echo "If your CubeSatSim is transmitting in SSTV mode (mode 4) you should get images."
echo "Note: if you see and hear an SSTV signal but don't get any images, the CubeSatSim signal might have a frequency offset. Try rebooting the CubeSatSim to fix."
elif [ "$frequency" = "Auto-tune" ]; then
frequency=434900000
autotune=1
elif [ "$choice" = "3" ] || [ "$frequency" = "Other" ]; then
echo
@ -115,14 +129,48 @@ echo
echo -e "Auto decoding SSTV on $frequency Hz"
sleep 2
#sleep 2
setsid qsstv &
sleep 5
#sleep 5
if [ "$autotune" = "1" ]; then
threshold=1
delay=5
retries=5
echo "Starting Auto-tune scanning"
echo "Scan will stop when confidence exceeds threshold value of" $threshold "or after" $retries "retries"
tries=0
confidence=0
delay=$((delay-2)) # subtract 2 second built in delay
while [ $tries -le $retries ] && [ "$confidence" -le "$threshold" ]; do
sleep $delay
source /home/pi/venv/bin/activate
python3 /home/pi/CubeSatSim/groundstation/auto-tune.py 434900000 n 2> null > /home/pi/CubeSatSim/groundstation/auto-tune.txt
# echo "auto-tune.txt"
# cat /home/pi/CubeSatSim/groundstation/auto-tune.txt
confidence=$(awk '{print $2}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune confidence:" $confidence
tries=$((tries+1))
done
if [ "$confidence" -gt "$threshold" ]; then
frequency=$(awk '{print $1}' /home/pi/CubeSatSim/groundstation/auto-tune.txt)
echo "Auto tune frequency:" $frequency
else
echo "Auto tune failed, frequency unchanged"
fi
echo
echo "If your CubeSatSim is transmitting in SSTV mode (mode 4) you should get images."
echo
#sudo systemctl restart cubesatsim
fi
#sudo systemctl restart cubesatsim
value=`aplay -l | grep "Loopback"`
echo "$value" > /dev/null

@ -21,6 +21,8 @@ sudo systemctl stop rtl_tcp
pkill -o chromium &>/dev/null
pkill -o firefox &>/dev/null
sudo killall -9 qsstv &>/dev/null
sudo killall -9 rtl_tcp &>/dev/null

@ -3,7 +3,7 @@ Type=Application
Exec=/home/pi/CubeSatSim/groundstation/sdr.sh
Name=Web SDR
Comment=openwebrx for Web SDR
Icon=/home/pi/Downloads/openwebrx.png
Icon=/home/pi/Icons/openwebrx.png
Path=/home/pi
Terminal=true
Categories=HamRadio

@ -0,0 +1,13 @@
[Hotspot]
# WiFi hotspot name
hotspot_ssid=CubeSat
# WiFi hotspot password - note: this password is stored in the clear!
hotspot_password=amsatcubesat
# WiFi hotspot always on regardless of pushbutton
hotspot_default=no
# Web Dashboard port number. If 80, no port needs to be entered in browser
# dashboard_port=80
# Web terminal setting during hotspot - note, there is no authentication for this!
web_term_hotspot=yes
# Web terminal setting during WiFi - note: there is no authentication for this!
web_term_wifi=no

1142
install

File diff suppressed because it is too large Load Diff

111
log

@ -2,16 +2,105 @@
echo -e "\nLog file script for CubeSatSim\n"
if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then
sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt
cat /home/pi/CubeSatSim/logt.txt
echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt"
elif [ "$1" = "-c" ]; then
sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt
cat /home/pi/CubeSatSim/logc.txt
echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt"
if [ "$1" = "-h" ] ; then
echo "Displays systemd logs for the chose process. The choices are:"
echo " -d cubesatsim (also no choice gives you this)"
echo " -t transmit"
echo " -c command and control"
echo " -p pacsat"
echo " -r frequency control"
echo " -f frequency display"
echo " -b pushbutton"
echo " -o OliveTin"
echo "Default is the log is dumpted to the screen and written to a file."
echo "If an additional r is included, the log is realtime, and exits with a Control-C"
echo
exit
fi
REALTIME=0
if [ "$2" = "r" ] ; then
REALTIME=1
fi
if [ "$REALTIME" = "1" ] ; then
echo "To exit, type Control-C"
echo
sleep 2
if [ "$1" = "-t" ] ; then
sudo journalctl -b all -af -u transmit # > /home/pi/CubeSatSim/logt.txt
# cat /home/pi/CubeSatSim/logt.txt
# echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt"
elif [ "$1" = "-c" ]; then
sudo journalctl -b all -af -u command # > /home/pi/CubeSatSim/logc.txt
# cat /home/pi/CubeSatSim/logc.txt
# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt"
elif [ "$1" = "-p" ]; then
sudo journalctl -b all -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt
# cat /home/pi/CubeSatSim/logp.txt
# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt"
elif [ "$1" = "-r" ]; then
sudo journalctl -b all -af -u frequency # > /home/pi/CubeSatSim/logr.txt
elif [ "$1" = "-f" ] ; then
echo "Transmit Receive"
while true; do
cat /home/pi/CubeSatSim/frequency.txt | tr -d '\n'
# echo
sleep 1
printf "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
done
elif [ "$1" = "-b" ]; then
sudo journalctl -b all -af -u pushbutton # > /home/pi/CubeSatSim/logb.txt
elif [ "$1" = "-o" ]; then
sudo journalctl -b all -af -u OliveTin # > /home/pi/CubeSatSim/logb.txt
else
sudo journalctl -b all -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt
# cat /home/pi/CubeSatSim/log.txt
# echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt"
fi
else
sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt
cat /home/pi/CubeSatSim/log.txt
echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt"
if [ "$1" = "-t" ] ; then
sudo rm /home/pi/CubeSatSim/logt.txt
sudo journalctl -b all -a -u transmit > /home/pi/CubeSatSim/logt.txt
cat /home/pi/CubeSatSim/logt.txt
echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt"
elif [ "$1" = "-c" ]; then
sudo rm /home/pi/CubeSatSim/logc.txt
sudo journalctl -b all -a -u command > /home/pi/CubeSatSim/logc.txt
cat /home/pi/CubeSatSim/logc.txt
echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt"
elif [ "$1" = "-p" ]; then
sudo rm /home/pi/CubeSatSim/logp.txt
sudo journalctl -b all -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt
cat /home/pi/CubeSatSim/logp.txt
echo -e "\nPacSat Log file also saved as /home/pi/CubeSatSim/logp.txt"
elif [ "$1" = "-r" ]; then
sudo rm /home/pi/CubeSatSim/logr.txt
sudo journalctl -b all -a -u frequency > /home/pi/CubeSatSim/logr.txt
cat /home/pi/CubeSatSim/logr.txt
echo -e "\nFrequency Log file also saved as /home/pi/CubeSatSim/logr.txt"
elif [ "$1" = "-f" ] ; then
cat /home/pi/CubeSatSim/frequency.txt
echo
elif [ "$1" = "-b" ]; then
sudo rm /home/pi/CubeSatSim/logb.txt
sudo journalctl -b all -a -u pushbutton > /home/pi/CubeSatSim/logb.txt
cat /home/pi/CubeSatSim/logb.txt
echo -e "\nPushbutton Log file also saved as /home/pi/CubeSatSim/logb.txt"
elif [ "$1" = "-o" ]; then
sudo rm /home/pi/CubeSatSim/logo.txt
sudo journalctl -b all -a -u OliveTin > /home/pi/CubeSatSim/logo.txt
cat /home/pi/CubeSatSim/logo.txt
echo -e "\nOliveTin Log file also saved as /home/pi/CubeSatSim/logo.txt"
else
sudo rm /home/pi/CubeSatSim/log.txt
sudo journalctl -b all -a -u cubesatsim > /home/pi/CubeSatSim/log.txt
cat /home/pi/CubeSatSim/log.txt
echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt"
fi
fi

252
main.c

@ -20,12 +20,13 @@
*/
#include "main.h"
#include <signal.h>
//#define HAB // uncomment to change APRS icon from Satellite to Balloon and only BAT telemetry
int main(int argc, char * argv[]) {
printf("\n\nCubeSatSim v2.2 starting...\n\n");
printf("\n\nCubeSatSim v2.3 starting...\n\n");
wiringPiSetup();
@ -42,11 +43,11 @@ int main(int argc, char * argv[]) {
// char * cfg_buf[100];
fscanf(config_file, "%s %d %f %f %s %d %s %s %s %d %d %s %d",
call, &reset_count, &lat_file, &long_file, sim_yes, &squelch, tx, rx, hab_yes, &rx_pl, &tx_pl, fail_yes, &fail_time);
fscanf(config_file, "%s %d %f %f %s %d %s %s %s %d %d %s %d %s",
call, &reset_count, &lat_file, &long_file, sim_yes, &squelch, tx, rx, hab_yes, &rx_pl, &tx_pl, fail_yes, &fail_time, doppler_mode);
fclose(config_file);
fprintf(stderr,"Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s %d %s %s %s %d %d %s %d\n",
call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time);
fprintf(stderr,"Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s %d %s %s %s %d %d %s %d %s\n",
call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time, doppler_mode);
fprintf(stderr, "Transmit on %s MHz Receive on %s MHz\n", tx, rx);
@ -125,7 +126,7 @@ int main(int argc, char * argv[]) {
FILE * sim_mode_auto = popen("touch /home/pi/CubeSatSim/sim_mode_auto", "r"); // store sim_mode_auto flag
pclose(sim_mode_auto);
} else {
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto > /dev/null 2>&1", "r"); // remove sim_mode_auto flag
pclose(sim_mode_auto);
}
@ -261,13 +262,28 @@ int main(int argc, char * argv[]) {
printf("Mode is Repeater\n");
} else if ( mode_string == 'n') {
mode = TXCOMMAND;
printf("Mode is Transmit Command\n");
} else {
printf("Mode is Transmit Command\n");
} else if ( mode_string == 'p') {
mode = PACSAT;
printf("Mode is Pacsat\n");
} else if ( mode_string == 'P') {
mode = PACSATGND;
printf("Mode is Pacsat Ground Station\n");
} else {
printf("Mode is BPSK\n");
}
}
}
/*
if ( mode == PACSAT) {
FILE * pacsat_file = popen("sudo systemctl restart pacsatsim", "r");
pclose(pacsat_file);
}
else {
FILE * pacsat_file = popen("sudo systemctl stop pacsatsim", "r");
pclose(pacsat_file);
}
*/
// Open telemetry file with STEM Payload Data
telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a");
if (telem_file == NULL)
@ -306,8 +322,8 @@ int main(int argc, char * argv[]) {
}
config_file = fopen("sim.cfg", "w");
fprintf(config_file, "%s %d %8.4f %8.4f %s %d %s %s %s %d %d %s %d",
call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time);
fprintf(config_file, "%s %d %8.4f %8.4f %s %d %s %s %s %d %d %s %d %s",
call, reset_count, lat_file, long_file, sim_yes, squelch, tx, rx, hab_yes, rx_pl, tx_pl, fail_yes, fail_time, doppler_mode);
// fprintf(config_file, "%s %d", call, reset_count);
fclose(config_file);
config_file = fopen("sim.cfg", "r");
@ -315,24 +331,45 @@ int main(int argc, char * argv[]) {
map[MINUS_X] = MINUS_Y;
map[PLUS_Z] = MINUS_X;
map[MINUS_Y] = PLUS_Z;
/*
if (access("/dev/i2c-11", W_OK | R_OK) >= 0) { // Test if I2C Bus 11 is present
printf("/dev/i2c-11 is present\n\n");
snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(11));
} else {
snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3);
}
// check for camera
// char cmdbuffer1[1000];
FILE * file4 = popen("vcgencmd get_camera", "r");
fgets(cmdbuffer, 1000, file4);
char camera_present[] = "supported=1 detected=1";
*/
snprintf(busStr, 10, "%d %d", i2c_bus1, i2c_bus3);
FILE * os_test = popen("cat /etc/os-release", "r");
fgets(cmdbuffer, 1000, os_test);
printf("os-release: %s\n", cmdbuffer);
char os_present[] = "bookworm";
// printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present));
camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF;
printf("Camera result:%s camera: %d \n", & cmdbuffer, camera);
pclose(file4);
int os_status = (strstr( (const char *)& cmdbuffer, os_present) != NULL) ? ON : OFF;
printf("os_status: %d\n", os_status);
pclose(os_test);
// check for camera
FILE *cam_test;
if (os_status == ON) { // bookworm
cam_test = popen("sudo rpicam-hello --list-cameras | grep 'No cameras available!'", "r");
fgets(cmdbuffer, 1000, cam_test);
char no_camera_present[] = "No cameras available!";
// printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present));
camera = (strstr( (const char *)& cmdbuffer, no_camera_present) != NULL) ? OFF : ON;
}
else // bullseye
{
cam_test = popen("vcgencmd get_camera", "r");
fgets(cmdbuffer, 1000, cam_test);
char camera_present[] = "supported=1 detected=1";
// printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present));
camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF;
}
printf("Camera result: %s camera: %d \n", & cmdbuffer, camera);
pclose(cam_test);
#ifdef DEBUG_LOGGING
printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera);
@ -379,7 +416,7 @@ int main(int argc, char * argv[]) {
if (sim_mode && payload && !sim_config) {
sim_mode = FALSE;
printf("Turning off Sim Mode since payload is present and Sim Mode not manually configured.\n");
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto > /dev/null 2>&1", "r"); // remove sim_mode_auto flag
pclose(sim_mode_auto);
}
} else {
@ -484,8 +521,9 @@ int main(int argc, char * argv[]) {
printf("\n FSK Mode, %d bits per frame, %d bits per second, %d ms per frame, %d ms sample period\n",
bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod);
} else if (mode == BPSK) {
} else if ((mode == BPSK) || (mode == PACSAT) || (mode == PACSATGND)) {
//// } else {
bitRate = 1200;
rsFrames = 3;
payloads = 6;
@ -507,8 +545,11 @@ int main(int argc, char * argv[]) {
frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms
printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n",
bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod);
if (mode == BPSK)
printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n",
bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod);
else
printf("\n dataLen: %d \n", dataLen);
sin_samples = S_RATE/freq_Hz;
// printf("Sin map: ");
@ -561,15 +602,8 @@ int main(int argc, char * argv[]) {
memset(sensor, 0, sizeof(sensor));
memset(other, 0, sizeof(other));
// if (((mode == FSK) || (mode == BPSK))) // && !sim_mode)
if (mode == FSK) { // && !sim_mode)
get_tlm_fox();
// get_tlm_fox();
}
if (mode == BPSK) { // && !sim_mode)
if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT) || (mode == PACSATGND)) // && !sim_mode)
get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored
// get_tlm_fox();
}
else if (mode == FC) // && !sim_mode)
get_tlm_fc(); // fill transmit buffer with reset count 0 packets that will be ignored
else if (mode == CW)
@ -586,11 +620,13 @@ int main(int argc, char * argv[]) {
strcat(pythonConfigStr, " c");
fprintf(stderr, "pythonConfigStr: %s\n", pythonConfigStr);
FILE *file2 = sopen(pythonVenv); // activate venv
file1 = sopen(pythonConfigStr); // python sensor polling function
fgets(cmdbuffer, 1000, file1);
fprintf(stderr, "pythonStr result: %s\n", cmdbuffer);
fprintf(stderr, "pythonStr INA219 read result: %s\n", cmdbuffer);
}
for (int i = 0; i < 9; i++) {
@ -667,7 +703,7 @@ int main(int argc, char * argv[]) {
char * token;
fputc('\n', file1);
fgets(cmdbuffer, 1000, file1);
// fprintf(stderr, "Python read Result: %s\n", cmdbuffer);
fprintf(stderr, "Python INA219 read Result: %s\n", cmdbuffer);
// serialPuts(uart_fd, cmdbuffer); // write INA data to Pico over serial
@ -699,7 +735,7 @@ int main(int argc, char * argv[]) {
if (sim_mode && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode
sim_mode = FALSE;
fprintf(stderr, "Turning off Sim Mode since battery sensor 2 is present\n");
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto > /dev/null 2>&1", "r"); // remove sim_mode_auto flag
pclose(sim_mode_auto);
}
}
@ -708,7 +744,7 @@ int main(int argc, char * argv[]) {
if (sim_mode && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode
sim_mode = FALSE;
fprintf(stderr, "Turning off Sim Mode since battery sensor is present\n");
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto > /dev/null 2>&1", "r"); // remove sim_mode_auto flag
pclose(sim_mode_auto);
}
}
@ -734,7 +770,7 @@ int main(int argc, char * argv[]) {
if (sim_mode && payload && !sim_config) {
sim_mode = FALSE;
printf("Turning off Sim Mode since payload is present and Sim Mode not manually configured.\n");
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto", "r"); // remove sim_mode_auto flag
FILE * sim_mode_auto = popen("sudo rm /home/pi/CubeSatSim/sim_mode_auto > /dev/null 2>&1", "r"); // remove sim_mode_auto flag
pclose(sim_mode_auto);
}
@ -1009,6 +1045,7 @@ int main(int argc, char * argv[]) {
}
if (sim_mode) { // simulated telemetry
printf("Simulated telemetry mode\n");
double time = ((long int)millis() - time_start) / 1000.0;
@ -1047,9 +1084,9 @@ int main(int argc, char * argv[]) {
// float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0));
// current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging;
current[map[BAT]] = rnd_float(320, 510) - charging;
current[map[BAT]] = rnd_float(320, 510) - charging;
printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]);
printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]);
batt -= (batt > 3.5) ? current[map[BAT]] / 300000 : current[map[BAT]] / 30000;
if (batt < 3.6) {
@ -1256,11 +1293,11 @@ int main(int argc, char * argv[]) {
sleep(rand_sleep);
// fprintf(stderr, "INFO: Sleeping for extra %d sec\n", rand_sleep);
} else if ((mode == FSK) || (mode == BPSK)) {// FSK or BPSK
} else if ((mode == FSK) || (mode == BPSK) || (mode == PACSAT) || (mode == PACSATGND)) {// FSK or BPSK
get_tlm_fox();
} else if ((mode == FC)) {
get_tlm_fc();
} else { // SSTV
} else { // SSTV or PACSATGND
// fprintf(stderr, "Sleeping\n");
sleep(30);
}
@ -1511,11 +1548,15 @@ void get_tlm(void) {
printf("\n\nTelemetry string is %s \n\n", str);
if (transmit) {
// if (is_safe_input(str))
// fprintf(stderr, "String is safe");
// else
// fprintf(stderr, "String is not safe");
FILE * file2 = popen(str, "r");
pclose(file2);
sleep(2);
digitalWrite(txLed, txLedOff);
sleep(2);
digitalWrite(txLed, txLedOff);
} else {
fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n");
@ -1530,6 +1571,19 @@ void get_tlm(void) {
return;
}
/*
int is_safe_input(const char *s) {
for (; *s; s++) {
if (!isdigit((unsigned char)*s)
&& !isupper((unsigned char)*s)
&& *s != '.' && *s != '-' && *s != '+'
&& *s != ' ' && *s != '\n' && *s != '_')
return 0;
}
return 1;
}
*/
// generates telemetry which is decoded by AMSAT's FoxTelem: https://www.amsat.org/foxtelem-software-for-windows-mac-linux/
// for more info about how we use FoxTelem see https://www.g0kla.com/foxtelem/amsat_telemetry_designers_handbook.pdf
@ -1541,6 +1595,8 @@ void get_tlm_fox() {
smaller = (int)(S_RATE / (2 * freq_Hz));
// if (mode == PACSAT)
// dataLen = 78;
short int b[dataLen];
short int b_max[dataLen];
short int b_min[dataLen];
@ -1610,7 +1666,10 @@ void get_tlm_fox() {
sampleTime = (unsigned int)millis();
} else
printf("first or second time - no sleep\n");
{
printf("first time - no sleep\n");
firstTime = OFF;
}
printf("++++ Loop time: %5.3f sec +++++\n", (millis() - loopTime) / 1000.0);
fflush(stdout);
@ -1621,7 +1680,6 @@ void get_tlm_fox() {
for (int count1 = 0; count1 < 8; count1++) {
if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1];
if (current[count1] < current_min[count1]) current_min[count1] = current[count1];
if (voltage[count1] > voltage_max[count1]) voltage_max[count1] = voltage[count1];
if (current[count1] > current_max[count1]) current_max[count1] = current[count1];
@ -1720,8 +1778,11 @@ void get_tlm_fox() {
encodeA(b, 9 + head_offset, battCurr);
encodeB(b, 10 + head_offset, (int)(sensor[TEMP] * 10 + 0.5)); // Temp
if (sensor[TEMP] > 0 )
encodeB(b, 10 + head_offset, (int)(sensor[TEMP] * 10 + 0.5)); // Temp
else
encodeB(b, 10 + head_offset, 0);
if (mode == FSK) {
encodeA(b, 12 + head_offset, posXv);
encodeB(b, 13 + head_offset, negXv);
@ -1789,7 +1850,11 @@ void get_tlm_fox() {
encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048);
// encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1] * 10 + 0.5) + 2048);
encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5));
if (sensor_max[TEMP] > 0)
encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5));
else
encodeB(b_max, 10 + head_offset, 0);
encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] * 10 + 0.5));
if (failureMode != FAIL_PAYLOAD) {
encodeA(b_max, 48 + head_offset, (int)(sensor_max[DTEMP] * 10 + 0.5) + 2048);
@ -1852,8 +1917,12 @@ void get_tlm_fox() {
encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048);
// encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1] * 10 + 0.5) + 2048);
encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5));
encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5));
if (sensor_min[TEMP] > 0)
encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5));
else
encodeB(b_min, 10 + head_offset, 0);
encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5));
if (failureMode != FAIL_PAYLOAD) {
encodeA(b_min, 48 + head_offset, (int)(sensor_min[DTEMP] * 10 + 0.5) + 2048);
@ -1914,7 +1983,10 @@ void get_tlm_fox() {
if (sensor[ALT] < 0) sensor[ALT] = 0.0;
encodeB(b, 34 + head_offset, (int)(sensor[ALT] / 10.0 + 0.5)); // Altitude
encodeA(b, 45 + head_offset, (int)(sensor[HUMI] * 10 + 0.5)); // in place of sensor1
encodeA(b, 39 + head_offset, (int)(other[TEMP] * 10 + 0.5));
if (other[TEMP] > 0)
encodeA(b, 39 + head_offset, (int)(other[TEMP] * 10 + 0.5));
else
encodeA(b, 39 + head_offset, 0);
encodeA(b, 36 + head_offset, Resets);
encodeB(b, 37 + head_offset, (int)(other[RSSI] + 0.5) + 2048);
@ -1979,20 +2051,23 @@ void get_tlm_fox() {
encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4);
encodeA(b, 53 + head_offset, groundCommandCount);
if (mode == BPSK) {
encodeA(b_max, 51 + head_offset, status);
if ((mode == BPSK) || (mode == PACSAT) || (mode == PACSATGND)) {
encodeA(b_max, 51 + head_offset, status);
encodeA(b_min, 51 + head_offset, status);
encodeB(b_max, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4);
encodeB(b_min, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4);
}
int tlm_skip = FALSE;
if (txAntennaDeployed == 0) {
txAntennaDeployed = 1;
printf("TX Antenna Deployed!\n");
tlm_skip = TRUE;
}
if (rxAntennaDeployed == 0) {
rxAntennaDeployed = 1;
printf("RX Antenna Deployed!\n");
tlm_skip = TRUE;
}
if (mode == BPSK) { // wod field experiments
@ -2001,8 +2076,38 @@ void get_tlm_fox() {
encodeA(b, 65 + head_offset, val >> 8);
encodeA(b, 63 + head_offset, 0x00);
encodeA(b, 62 + head_offset, 0x01);
encodeB(b, 74 + head_offset, 0xfff);
encodeB(b, 74 + head_offset, 0xfff);
}
if (((mode == PACSAT) || (mode == PACSATGND)) && (tlm_skip == FALSE))
{
FILE *telem_binary = fopen("/home/pi/CubeSatSim/tlm.bin", "wb");
if (telem_binary != NULL) {
int bytes_written = 4;
unsigned int now = (unsigned int)time(0);
fwrite(&now, sizeof(now), 1, telem_binary);
int count;
char byte;
printf("b is: \n");
for (count = 0; count < dataLen; count++) {
byte = b[count];
fwrite(&byte, 1, 1, telem_binary);
printf("%02X ", byte);
bytes_written++;
}
printf("\n");
printf("Writing %d bytes to tlm.bin\n", bytes_written + 4);
fclose(telem_binary);
}
else
printf("Error opening tlm.bin\n");
}
else
{ // extra bracket for some reason?
{
short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)];
short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)];
@ -2291,22 +2396,25 @@ void get_tlm_fox() {
// max -= 1;
}
/// if (sock_ret == -1) {
/// printf("Error: %s \n", strerror(errno));
/// socket_open = 0;
// transmitStatus = -1;
/// }
/// }
if (socket_open == 1)
firstTime = 0;
// else if (frames_sent > 0) //5)
// firstTime = 0;
}
} // extra bracket for some reason?
if (!transmit) {
fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n");
fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n");
}
/// if (socket_open == 1)
/// firstTime = 0;
// else if (frames_sent > 0) //5)
// firstTime = 0;
// if (firstTime && (mode == PACSAT))
// {
// firstTime = OFF;
// fprintf(stderr, "No longer first time\n");
// fflush(stdout);
// }
return;
}
@ -2334,6 +2442,7 @@ FILE *sopen(const char *program)
_exit(127);
}
/* parent */
signal(SIGCHLD, SIG_IGN);
close(fds[1]);
return fdopen(fds[0], "r+");
}
@ -2645,9 +2754,8 @@ if (setting == ON) {
FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r");
pclose(command);
fprintf(stderr,"Turning Safe Mode ON\n");
fprintf(stderr,"Turning Battery saver mode ON\n");
battery_saver_mode = ON;
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
fprintf(stderr,"Turning Battery saver mode ON\n");
if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT) || (mode == PACSATGND)) {
command = popen("echo 'reboot due to turning ON Safe Mode!' | wall", "r");
pclose(command);
command = popen("sudo reboot now", "r");
@ -2664,7 +2772,7 @@ if (setting == ON) {
pclose(command);
fprintf(stderr,"Turning Battery saver mode OFF\n");
battery_saver_mode = OFF;
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
if ((mode == AFSK) || (mode == SSTV) || (mode == CW) || (mode == PACSAT) || (mode == PACSATGND)) {
command = popen("echo 'reboot due to turning OFF Safe Mode!' | wall", "r");
pclose(command);
command = popen("sudo reboot now", "r");

@ -98,6 +98,7 @@ extern const unsigned char ALPHA_TO[];
// const unsigned char *CCodecAO40::encode(unsigned char *source_bytes, int byte_count);
void program_radio();
void socket_send(int length);
int is_safe_input(const char *s);
int socket_open = 0;
int sock = 0;
@ -125,7 +126,9 @@ FILE *image_file;
#define CW 5
#define FC 6
#define REPEATER 7
#define PACSAT 8
#define TXCOMMAND 12
#define PACSATGND 13
#define FAIL_COUNT 11
#define FAIL_NONE -1
@ -168,6 +171,7 @@ char sim_yes[10];
char hab_yes[10];
char fail_yes[10];
int fail_time = 60;
char doppler_mode[10];
int squelch = 3; // default squelch
char rx[12], tx[12];
int tx_pl = 0;
@ -200,7 +204,8 @@ char sensor_string[SENSOR_FIELDS][32];
int test_i2c_bus(int bus);
//const char pythonCmd[] = "python3 -u /home/pi/CubeSatSim/python/voltcurrent.py ";
const char pythonCmd[] = "python3 -u /home/pi/CubeSatSim/ina219.py ";
const char pythonVenv[] = "/home/pi/CubeSatSim/venv.sh";
const char pythonCmd[] = "/home/pi/venv/bin/python3 -u /home/pi/CubeSatSim/ina219.py ";
char pythonStr[100], pythonConfigStr[100], busStr[10];
int map[8] = {0, 1, 2, 3, 4, 5, 6, 7};
char src_addr[5] = "";

@ -0,0 +1,361 @@
#!/bin/bash
# script to run PacsatSim
loopback=0
vox=0
safe=0
card=0
pwm=0
reset=0
if [ "$1" = "l" ] ; then
loopback=1
elif [ "$1" = "v" ] ; then
vox=1
elif [ "$1" = "c" ] ; then
card=1
elif [ "$1" = "r" ] ; then
reset=1
else
pwm=1
fi
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then
safe=1
fi
if [[ $(arecord -l | grep "USB Audio Device") ]] ; then
echo "USB Sound Card detected"
soundcard=1
/home/pi/CubeSatSim/config -L -1
else
echo "No USB Sound Card detected"
soundcard=0
fi
gpio -g mode 7 up
if [[ $(gpio -g read 7 | grep 0) ]] ; then
echo "TXC is present"
txc=1
else
echo "TXC not present"
txc=0
fi
#timeout 1 rtl_test &> out.txt
#if [[ $(grep "No supported" out.txt) ]] ; then
# echo "No RTL-SDR detected"
# rtl=0
#else
# echo "RTL-SDR detected."
# rtl=1
#fi
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
callsign="$1"
txfrequency="$7e3"
rxfrequency="$8e3"
echo -n "PacSat callsign is "
echo $callsign
echo -n "Transmit Frequency is "
echo $txfrequency
echo -n "Receive Frequency is "
echo $rxfrequency
echo
sleep 2
# if [ "$reset" = "0" ] ; then
if [ ! -d "/home/pi/PacSat" ]; then
# if [ ! -d "/home/pi/PacSat" ]; then
# echo "Setting up PacSatSim default configuration"
# echo
# cd
# sudo rm pacsat-dir.zip
# mkdir /home/pi/PacSat
# mkdir /home/pi/PacSat/pacsat
# mkdir /home/pi/PacSat/pacsat/dir
## wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pacsat-dir.zip
# cp /home/pi/pi_pacsat/zip/pacsat-dir.zip .
# unzip pacsat-dir.zip
# sudo rm pacsat-dir.zip
# cd
# sudo rm /home/pi/pi_pacsat/Debug/pacsat.config
# sudo rm /home/pi/pi_pacsat/Debug/pacsat.state
# sudo rm /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat
# sudo rm pi_pacsat.zip
## wget https://github.com/alanbjohnston/pi_pacsat/releases/download/v0.2/pi_pacsat.zip
# cp /home/pi/pi_pacsat/zip/pi_pacsat.zip .
# unzip pi_pacsat.zip
# sudo rm pi_pacsat.zip
#
# sudo sed -i 's/dir_max_file_age_in_seconds=4320000/dir_max_file_age_in_seconds=60480000/g' /home/pi/pi_pacsat/Debug/pacsat.state
# sudo sed -i 's/ftl0_max_upload_age_in_seconds=432000/ftl0_max_upload_age_in_seconds=60480000/g' /home/pi/pi_pacsat/Debug/pacsat.state
# echo
#echo "pacsat.state:"
# cat /home/pi/pi_pacsat/Debug/pacsat.state
# echo
# fi
# else
echo "Resetting pi_pacsat to empty configuration"
echo
sudo rm -r /home/pi/PacSat
mkdir /home/pi/PacSat
mkdir /home/pi/PacSat/pacsat
mkdir /home/pi/PacSat/pacsat/dir
mkdir /home/pi/PacSat/pacsat/txt
cp /home/pi/CubeSatSim/Welcome_Message.txt /home/pi/PacSat/pacsat/txt/Welcome_Message.txt
mkdir /home/pi/PacSat/pacsat/img
cp /home/pi/CubeSatSim/sstv/sstv_image_tiny.jpg /home/pi/PacSat/pacsat/img/sstv_image_tiny.jpg
cd /home/pi/pi_pacsat/Debug
sudo rm pacsat_last_command_time.dat
sudo rm pacsat_upload_table.dat
sudo rm pacsat.state
echo "bit_rate=9600" > pacsat.config
echo "bbs_callsign=AMSAT-12" >> pacsat.config
echo "broadcast_callsign=AMSAT-11" >> pacsat.config
echo "digi_callsign=AMSAT-1" >> pacsat.config
echo "max_frames_in_tx_buffer=5" >> pacsat.config
echo "pb_open=1" > pacsat.state
echo "uplink_open=1" >> pacsat.state
echo "pb_max_period_for_client_in_seconds=60" >> pacsat.state
echo "uplink_max_period_for_client_in_seconds=60" >> pacsat.state
echo "dir_max_file_age_in_seconds=6048000" >> pacsat.state
echo
echo "pacsat.state:"
cat pacsat.state
echo
touch /home/pi/pi_pacsat/Debug/pacsat_upload_table.dat
# exit
fi
/home/pi/CubeSatSim/config -z
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
callsign="$1"
frequency="$7e3"
echo "Configured callsign is "
echo $callsign
oldcallsign=$(grep -oP '(?<=bbs_callsign=).*(?=-)' /home/pi/pi_pacsat/Debug/pacsat.config)
echo "Callsign in pacsat.config is "
echo $oldcallsign
if [ ! "$callsign" = "$oldcallsign" ] ; then
sudo sed -i "s/bbs_callsign=$oldcallsign/bbs_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config
sudo sed -i "s/broadcast_callsign=$oldcallsign/broadcast_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config
sudo sed -i "s/digi_callsign=$oldcallsign/digi_callsign=$callsign/g" /home/pi/pi_pacsat/Debug/pacsat.config
echo "New pacsat.confg is"
echo
cat /home/pi/pi_pacsat/Debug/pacsat.config
fi
sudo /etc/init.d/alsa-utils stop
sudo /etc/init.d/alsa-utils start
# export LD_LIBRARY_PATH=/mnt/usb-disk/ariss/lib:/usr/local/lib/iors_common:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
#sudo systemctl stop cubesatsim
#sudo systemctl stop transmit
#sudo systemctl stop command &>/dev/null
sudo modprobe snd-aloop
#sudo systemctl stop openwebrx
#sudo systemctl stop rtl_tcp &>/dev/null
#pkill -o chromium &>/dev/null
#sudo killall -9 rtl_fm &>/dev/null
#sudo killall -9 direwolf &>/dev/null
#udo killall -9 aplay &>/dev/null
#sudo killall -9 qsstv &>/dev/null
#sudo killall -9 rtl_tcp &>/dev/null
#sudo killall -9 java &>/dev/null
#sudo killall -9 CubicSDR &>/dev/null
#sudo killall -9 zenity &>/dev/null
sudo killall -9 pacsat_telem &>/dev/null
sudo killall -9 pi_pacsat &>/dev/null
echo
#choice=2
#fi
# frequency=434900000
echo
echo "If your Pacsat Ground Station is transmitting packets, you will see them here"
echo
#echo
#echo "Note that the 'Tuned to' frequency will be different from the chosen frequency due to the way SDRs work."
# echo -e "Auto decoding APRS Pacsat packets on $frequency Hz"
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 &
# /usr/bin/x-terminal-emulator --geometry=120x40 -e "/home/pi/CubeSatSim/pacsatsim-df.sh"
sudo usermod -a -G gpio pi
if [ "$loopback" = "1" ] ; then
echo "Using audio loopback"
ADEVICE="ADEVICE plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
MODE=$1
if [ ! "$MODE" = "P" ] ; then
/home/pi/CubeSatSim/config -I n
fi
# sudo /home/pi/CubeSatSim/pacsatsim-d.sh &
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-loopback.conf -t 0 &
elif [ "$safe" = "1" ] ; then
echo "Safe mode - battery saver"
# sudo /home/pi/CubeSatSim/pacsatsim-d.sh &
ADEVICE="ADEVICE shared_mic plughw:CARD=Loopback,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm-loopback.conf -t 0 &
# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &
# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f $frequency &
elif [ "$vox" = "1" ]; then
echo "Using Soundcard Audio TX and RX (VOX, no PTT)"
ADEVICE="ADEVICE plughw:CARD=Device,DEV=0"
PTT="PTT GPIOD gpiochip0 17"
# sudo /home/pi/CubeSatSim/pacsatsim-dj.sh &
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14-half.conf -t 0 &
elif [ "$pwm" = "1" ] ; then
echo "FM TXC using Soundcard input (JP13), PWM output"
ADEVICE="ADEVICE shared_mic plughw:CARD=Headphones,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-pwm.conf -t 0 &
else
echo "FM TXC using Soundcard input (JP13) and output (JP14)"
ADEVICE="ADEVICE shared_mic plughw:CARD=Device,DEV=0"
PTT="PTT GPIOD gpiochip0 -20"
# direwolf -P+ -D1 -qd -dp -r 48000 -c /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim-jp14.conf -t 0 &
fi
DIREWOLF_CONF="/home/pi/CubeSatSim/direwolf-pacsatsim-tmp.conf"
echo "$ADEVICE" > $DIREWOLF_CONF
echo "MYCALL $callsign-1" >> $DIREWOLF_CONF
echo "$PTT" >> $DIREWOLF_CONF
cat /home/pi/CubeSatSim/direwolf/direwolf-pacsatsim.conf >> $DIREWOLF_CONF
echo
echo "$DIREWOLF_CONF"
echo
cat $DIREWOLF_CONF
echo
#direwolf -P+ -D1 -qd -dp -r 48000 -c $DIREWOLF_CONF -t 0 &
direwolf -qd -r 48000 -c $DIREWOLF_CONF &
# arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &
## arecord -D plughw:CARD=Loopback,DEV=1 -f S16_LE -r 48000 -c 1 | csdr convert_s16_f | csdr gain_ff 4000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434900 &
## echo "Don't close the direwolf window or the Pacsatsim will stop running."
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
/home/pi/pacsat_telem/Debug/pacsat_telem -v -d /home/pi/PacSat/pacsat &
sleep 5
value=`aplay -l | grep "Loopback"`
echo "$value" > /dev/null
set -- $value
#rtl_fm -M fm -f $frequency -s 48k | tee >(aplay -D hw:${2:0:1},0,0 -r 48000 -t raw -f S16_LE -c 1) | aplay -D hw:0,0 -r 48000 -t raw -f S16_LE -c 1 &
cd /home/pi/pi_pacsat/Debug
./pi_pacsat -c pacsat.config -d /home/pi/PacSat
sleep 60

@ -0,0 +1,202 @@
#!/usr/bin/env python
# originally based on listen-for-shutdown.py from pi-power-button
import RPi.GPIO as GPIO
import subprocess
import time
import os
from time import sleep
import configparser
def read_config_ini():
global hotspot_ssid
global hotspot_password
global hotspot_default
global web_term_hotspot
global web_term_wifi
# global dashboard_port
try:
# Initialize the parser
config = configparser.ConfigParser()
# Read the file
config.read('/home/pi/CubeSatSim/hotspot.ini')
# Access the values like a dictionary
hotspot_ssid = config['Hotspot']['hotspot_ssid']
hotspot_password = config['Hotspot']['hotspot_password']
hotspot_default = config['Hotspot']['hotspot_default']
web_term_hotspot = config['Hotspot']['web_term_hotspot']
web_term_wifi = config['Hotspot']['web_term_wifi']
# dashboard_port = config.getint('Hotspot', 'dashboard_port')
print(f"SSID: {hotspot_ssid} Password: {hotspot_password} Hotspot Default: {hotspot_default} Term Hotspot: {web_term_hotspot} Term WiFi {web_term_wifi}") # : {dashboard_}")
except Exception as e:
print(f"An error occurred: {e}")
print(" failed, setting defaults")
hotspot_ssid = "CubeSat"
hotspot_password = "amsatcubesat"
hotspot_default = "no"
web_term_hotspot = "yes"
web_term_wifi = "no"
# dashboard_port = 80
def blink(times):
blink_time = 0.1
powerPin = 16
for i in range(times): # blink times
GPIO.output(powerPin, 0)
sleep(blink_time)
GPIO.output(powerPin, 1)
sleep(blink_time)
sleep(0.65)
def change_mode():
push_button = 26
powerPin = 16
txPin = 27
sleep(0.75)
if GPIO.input(push_button):
print("sudo reboot -h now", flush=True)
os.system("echo 'reboot due to push button!' | wall")
GPIO.setwarnings(False)
GPIO.setup(powerPin, GPIO.OUT)
GPIO.output(powerPin, 0);
os.system("sudo reboot now")
# subprocess.call(['reboot', '-h', 'now'], shell=False)
return
blink(1)
if GPIO.input(push_button):
print("switch to AFSK", flush=True)
os.system("echo 'switch to AFSK due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -a")
return
blink(2)
if GPIO.input(push_button):
print("switch to FSK", flush=True)
os.system("echo 'switch to FSK due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -f")
return
blink(3)
if GPIO.input(push_button):
print("switch to BPSK", flush=True)
os.system("echo 'switch to BPSK due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -b")
return
blink(4)
if GPIO.input(push_button):
print("switch to SSTV", flush=True)
os.system("echo 'switch to SSTV due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -s")
return
blink(5)
if GPIO.input(push_button):
print("switch to CW", flush=True)
os.system("echo 'switch to CW due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -m")
return
blink(6)
if GPIO.input(push_button):
print("switch to Repeater", flush=True)
os.system("echo 'switch to Repeater due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -e")
return
blink(7)
if GPIO.input(push_button):
print("switch to FunCube", flush=True)
os.system("echo 'switch to FunCube due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -j")
return
blink(8)
if GPIO.input(push_button):
print("switch to PacSat", flush=True)
os.system("echo 'switch to PacSat due to push button!' | wall")
os.system("/home/pi/CubeSatSim/config -G")
return
for i in range(3): # blink 3 times slowly
GPIO.output(powerPin, 0)
sleep(0.35)
GPIO.output(powerPin, 1)
sleep(0.35)
sleep(0.65)
if GPIO.input(push_button):
print("sudo shutdown -h now", flush=True)
os.system("echo 'shutdown due to push button!' | wall")
GPIO.setwarnings(False)
GPIO.setup(powerPin, GPIO.OUT)
subprocess.call(['shutdown', '-h', 'now'], shell=False)
return
for i in range(3): # blink two times even more slowly
GPIO.output(powerPin, 0)
sleep(0.7)
GPIO.output(powerPin, 1)
sleep(0.7)
sleep(0.7)
print("toggle command and control mode", flush=True)
try:
f = open("/home/pi/CubeSatSim/command_control", "r")
f.close()
print("command and control will be deactivated", flush=True)
os.system('sudo rm /home/pi/CubeSatSim/command_control')
os.system("echo 'command and control deactivated by push button!' | wall")
os.system('sudo systemctl restart command')
except:
print("command and control will be activated", flush=True)
os.system('touch /home/pi/CubeSatSim/command_control')
os.system("echo 'command and control activated by push button!' | wall")
os.system('sudo systemctl restart command')
sleep(1)
powerPin = 16
txPin = 27
push_button = 26
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(txPin, GPIO.OUT)
GPIO.output(txPin, 0)
GPIO.setup(powerPin, GPIO.OUT)
GPIO.output(powerPin, 0)
GPIO.setup(push_button, GPIO.IN, pull_up_down=GPIO.PUD_UP)
read_config_ini()
if not GPIO.input(push_button) or hotspot_default == "yes": # if pushbutton is held down during boot or configured as default
print("Activating WiFi access point!", flush=True)
GPIO.output(powerPin, 1)
sleep(0.1)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.3)
GPIO.output(powerPin, 0)
sleep(0.1)
GPIO.output(powerPin, 1)
sleep(0.3)
GPIO.output(powerPin, 0)
success = 1
count = 0
while (success != 0) and (count < 5):
result = subprocess.run(['nmcli', 'device', 'wifi', 'hotspot', 'con-name', 'Hotspot', 'ifname', 'wlan0', 'ssid', hotspot_ssid, 'password', hotspot_password], capture_output=True, text=True)
print(result, flush=True) #.stdout)
count = count + 1
success = result.returncode
sleep(1)
print(f"Starting Wi-Fi Hotspot with SSID: {hotspot_ssid} and password: {hotspot_password}")
result = subprocess.run(['nmcli', 'connection', 'show'], capture_output=True, text=True)
print(result, flush=True)
sleep(2)
if web_term_hotspot == "yes":
subprocess.Popen(['sudo', '-u', 'pi', 'ttyd', '-W', '-p', '8081', 'bash'])
print("Starting web terminal on port 8081")
elif web_term_wifi == "yes":
subprocess.Popen(['sudo', '-u', 'pi', 'ttyd', '-W', '-p', '8081', 'bash'])
print("Starting web terminal on port 8081")
GPIO.setup(powerPin, GPIO.OUT)
GPIO.output(powerPin, 1)
while (True):
sleep(1)
GPIO.wait_for_edge(push_button, GPIO.FALLING)
change_mode()
sleep(5)

@ -0,0 +1,15 @@
Pacsat Telemetry Decoder Properties
#Sat Nov 26 18:12:20 EST 2016
numberOfLookupTables=0
measurementsFileName=measurements.csv
model=1
layout0.filename=PACSAT_rttelemetry.csv
layout0.name=TLMI_LAYOUT
passMeasurementsFileName=passmeasurements.csv
name=PacSatSim
description=PacSatSim
numberOfLayouts=1
satId=3
catalogNumber=0
conversionCoefficients=pacsat-coef.csv
layoutsUseBits=True

@ -0,0 +1,20 @@
#PacSat Ground Station Properties
#Sun Feb 17 18:25:06 EST 2019
sequence_num=3
name=PacSatSim
digiCallsign=AMSAT-1
description=PacSatSim
broadcastCallsign=AMSAT-11
DIR_AGE=10
bbsCallsign=AMSAT-12
telemLayoutFile=PacSatSim.dat
telem_server=tlm.amsatfox.org
web_site_url=http://CubeSatSim.org
show_system_files_on_dir_tab=false
show_user_files=true
supports_file_upload=true
norad_id=30776
psf_header_check_sums=false
commandsFile=pacsat.commands
is_command_station=true
secret_key=ScKQLp2ZMvCaCTK5jAmOmKmA0JiSyJ6Y15+Yfg\=\=

@ -0,0 +1,41 @@
0,-,NONE,0,1,0,0,0,0,None,0,4096,None
1,-,Boolean,0,1,0,0,0,0,Boolean,0,1,A Boolean value that prints TRUE or FALSE
2,-,Counts,0,1,0,0,0,0,Counts,0,4096,An integer count value
3,-,Date,0,1,0,0,0,0,Date,0,4096,A Unix epoch date time integer
4,-,TXPower,0,1,0,0,0,0,None,0,4096,None
5,-,IHUSpeed,0,0.1,0,0,0,0,None,0,4096,None
6,-,RSSI_1,0,-1,0,0,0,0,Counts,0,4096,Signed 8 bit
7,-,Mode,0,0,0,0,0,0,Enum,0,4096,SAFE:CREW:TELEM:X BAND RPT:APRS:SSTV:FS
8,-,Battery,0,0.001,0,0,0,0,None,0,4096,Battery Voltage
9,-,IHUTemp,0,0.1,0,0,0,0,None,0,4096,None
10,-,Mode,0,1,0,0,0,0,None,0,4096,The spacecraft Mode
11,-,FS_BYTES_PER_BLK,0,128,0,0,0,0,Counts,0,4096,The number of bytes per block in RED FS
12,-,FS_FILE_NUMBER,-4,1,0,0,0,0,Counts,0,4096,The number of files in the FS excluding core OS folders
13,-,SHTC3Temp,-45,0.002670288,0,0,0,0,None,0,4096,SHTC3 Temperature sensor
14,-,SHTC3Humidity,0,0.001525879,0,0,0,0,None,0,4096,SHTC3 Humidity sensor
15,-,LPS22Pressure,0,0.000244141,0,0,0,0,None,0,4096,LPS22 Pressure sensor
16,-,LPS22Temp,0,0.01,0,0,0,0,None,0,4096,LPS22 Temperature of sensor
17,-,IMUTemp,0,0.00390625,0,0,0,0,None,0,4096,Temperature of IMU = raw/256
18,-,Acc,0,6.10E-05,0,0,0,0,Sint16,0,4096,Accelerometer is 2g full scale
19,-,Gyro,0,0.000976563,0,0,0,0,Sint16,0,4096,Gyro scale for 32dps
20,-,Mag,0,0.149975574,0,0,0,0,Sint16,0,4096,Mag is 4912 full scale
21,-,AntMode,0,0,0,0,0,0,Enum,0,4096,MANUAL:AUTO:ORBIT
22,-,ResetReason,0,0,0,0,0,0,Enum,0,4096,NONE:SHUTDOWN:REBOOT:RADIO:TNC:TNC LISTEN:RUN TWICE:RADIO REBOOT:TNC PS REBOOT:TNC REBOOT:SOFT:THERMAL
23,-,LogLevel,0,0,0,0,0,0,Enum,0,4096,NONE:ERROR:WARN:INFO
24,-,O2FromVolts,86.434,-0.0354,0,0,0,0,None,0,4096,O2 Conc from raw voltage as a percentage
25,-,SensorState,0,0,0,0,0,0,Enum,0,4096,OFF:ON:ERR
26,-,SPARE2,0,0,0,0,0,0,Counts,0,4096,SPARE
27,-,O2Conc,0,0.01,0,0,0,0,Sint16,0,4096,O2 concentration as percentage
28,-,SSTVMode,0,0,0,0,0,0,Enum,0,4096,MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW
29,-,DivideBy100,0,0.01,0,0,0,0,None,0,4096,Divide by 100
30,-,DivideBy100Offset,-20.48,0.01,0,0,0,0,None,0,4096,Divide by 100 with Offset
31,-,Offset,-2048,1,0,0,0,0,Counts,0,4096,Offset
32,-,DivideBy10Offset,-204.8,0.1,0,0,0,0,None,0,4096,Divide by 10 with Offset
33,-,Status,0,0,0,0,0,0,Enum,0,4096,OFF:ON
34,-,CommandStatus,0,0,0,0,0,0,Enum,0,4096,OFF:Carrier:DTMF/APRS
35,-,FailStatus,0,0,0,0,0,0,Enum,0,4096,OK:FAIL
36,-,AntStatus,0,0,0,0,0,0,Enum,0,4096,STOWED:DEPLOYED
37,-,Times10,0,10.0,0,0,0,0,Counts,0,4096,Multiply by 10
NOTES:,,,,,,,,,,,,
Serial,Ignore,name,a,b,c,d,e,f,format,low limit,high limit,Comment
Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5,,,,,,,,,,,
1 0 - NONE 0 1 0 0 0 0 None 0 4096 None
2 1 - Boolean 0 1 0 0 0 0 Boolean 0 1 A Boolean value that prints TRUE or FALSE
3 2 - Counts 0 1 0 0 0 0 Counts 0 4096 An integer count value
4 3 - Date 0 1 0 0 0 0 Date 0 4096 A Unix epoch date time integer
5 4 - TXPower 0 1 0 0 0 0 None 0 4096 None
6 5 - IHUSpeed 0 0.1 0 0 0 0 None 0 4096 None
7 6 - RSSI_1 0 -1 0 0 0 0 Counts 0 4096 Signed 8 bit
8 7 - Mode 0 0 0 0 0 0 Enum 0 4096 SAFE:CREW:TELEM:X BAND RPT:APRS:SSTV:FS
9 8 - Battery 0 0.001 0 0 0 0 None 0 4096 Battery Voltage
10 9 - IHUTemp 0 0.1 0 0 0 0 None 0 4096 None
11 10 - Mode 0 1 0 0 0 0 None 0 4096 The spacecraft Mode
12 11 - FS_BYTES_PER_BLK 0 128 0 0 0 0 Counts 0 4096 The number of bytes per block in RED FS
13 12 - FS_FILE_NUMBER -4 1 0 0 0 0 Counts 0 4096 The number of files in the FS excluding core OS folders
14 13 - SHTC3Temp -45 0.002670288 0 0 0 0 None 0 4096 SHTC3 Temperature sensor
15 14 - SHTC3Humidity 0 0.001525879 0 0 0 0 None 0 4096 SHTC3 Humidity sensor
16 15 - LPS22Pressure 0 0.000244141 0 0 0 0 None 0 4096 LPS22 Pressure sensor
17 16 - LPS22Temp 0 0.01 0 0 0 0 None 0 4096 LPS22 Temperature of sensor
18 17 - IMUTemp 0 0.00390625 0 0 0 0 None 0 4096 Temperature of IMU = raw/256
19 18 - Acc 0 6.10E-05 0 0 0 0 Sint16 0 4096 Accelerometer is 2g full scale
20 19 - Gyro 0 0.000976563 0 0 0 0 Sint16 0 4096 Gyro scale for 32dps
21 20 - Mag 0 0.149975574 0 0 0 0 Sint16 0 4096 Mag is 4912 full scale
22 21 - AntMode 0 0 0 0 0 0 Enum 0 4096 MANUAL:AUTO:ORBIT
23 22 - ResetReason 0 0 0 0 0 0 Enum 0 4096 NONE:SHUTDOWN:REBOOT:RADIO:TNC:TNC LISTEN:RUN TWICE:RADIO REBOOT:TNC PS REBOOT:TNC REBOOT:SOFT:THERMAL
24 23 - LogLevel 0 0 0 0 0 0 Enum 0 4096 NONE:ERROR:WARN:INFO
25 24 - O2FromVolts 86.434 -0.0354 0 0 0 0 None 0 4096 O2 Conc from raw voltage as a percentage
26 25 - SensorState 0 0 0 0 0 0 Enum 0 4096 OFF:ON:ERR
27 26 - SPARE2 0 0 0 0 0 0 Counts 0 4096 SPARE
28 27 - O2Conc 0 0.01 0 0 0 0 Sint16 0 4096 O2 concentration as percentage
29 28 - SSTVMode 0 0 0 0 0 0 Enum 0 4096 MartinM1:MartinM2:ScottieS1:ScottieS2:Robot36:PasokonP3:PasokonP5:PasokonP7:PD90:PD120:PD160:PD180:PD240:PD290:Robot8BW:Robot24BW
30 29 - DivideBy100 0 0.01 0 0 0 0 None 0 4096 Divide by 100
31 30 - DivideBy100Offset -20.48 0.01 0 0 0 0 None 0 4096 Divide by 100 with Offset
32 31 - Offset -2048 1 0 0 0 0 Counts 0 4096 Offset
33 32 - DivideBy10Offset -204.8 0.1 0 0 0 0 None 0 4096 Divide by 10 with Offset
34 33 - Status 0 0 0 0 0 0 Enum 0 4096 OFF:ON
35 34 - CommandStatus 0 0 0 0 0 0 Enum 0 4096 OFF:Carrier:DTMF/APRS
36 35 - FailStatus 0 0 0 0 0 0 Enum 0 4096 OK:FAIL
37 36 - AntStatus 0 0 0 0 0 0 Enum 0 4096 STOWED:DEPLOYED
38 37 - Times10 0 10.0 0 0 0 0 Counts 0 4096 Multiply by 10
39 NOTES:
40 Serial Ignore name a b c d e f format low limit high limit Comment
41 Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5 Echo value = a + bx + cx^2 + dx^3 + ex^4 + fx^5

@ -0,0 +1,37 @@
# This is a list of commands that can be sent to the spacecraft
# args are 16 bit except the special code 99099099 which is replaced with the unix time, or when special code MSB32BIT is used to combine two fields
LIST, namespaces, None, Operations, Telem, File System
LIST, IMAGE FOLDER, sstv_queue 1, sstv_queue 2, sstv_queue 3, sstv_queue 4, sstv_queue 5, sstv_queue 6, sstv_queue 7, sstv_queue 8, sstv_queue 9
LIST, FOLDER, bin, lib, config, PACSAT dir, upload queue, wod queue, log queue, text queue, sensor wod queue, data1, data2, data3, data4, data5, data6, data7, data8, data9
LIST, ENABLE, false, true
LIST, ROLL AT STARTUP, false, true
LIST, OVERWRITE, false, true
LIST, FSK, false, true
LIST, REMOVE ORPHAN FILES, false, true
LIST, STATE, stop, start
LIST, UPLINK MODE, Off, All stations, Command Stations Only
LIST, FILENAME, use id for file name, user file name
LIST, SHUTDOWN, reboot, shutdown
LIST, RESET, reboot
LIST, RATE, 1200, 9600
LIST, FEC, Off, On
LIST, FULL DUPLEX, false, true
LIST, LOG NAME, Log, WOD
LIST, LOG LEVEL, None, Error, Warnings, Info
# Name, Name space, cmd, arg0, arg1, arg2, arg3, argName0, argName1, argName2, argName3, confirm, use reset/uptime, description
#
# PACSAT
#
Pacsat Broadcast,3,1,0,0,0,0,State,Period(sec),Timeout(sec),NONE,false,false,Enable or disable the Pacsat Broadcast module. The directory entries and individual files will be broadcast based on commands from ground stations.
File Uploads,3,2,0,0,0,0,Uplink Mode,Period(sec),Timeout(sec),NONE,false,false,Enable or disable File Uploads. Limit file uploads to command stations that authenticate with a secret key.
Install File,3,3,0,0,0,0,FileId,MSB32BIT,Folder,NONE,false,false,Copy a file from the PACSAT Directory to a folder and name it with a 4 byte hex name that matches the id or the user filename.
Execute File,3,13,0,0,0,0,FileId,MSB32BIT,Arg1,Arg2,true,false,Execute a file on the ARISS-PI. The file must already be installed in the bin folder
Delete File,3,4,0,0,0,0,FileId,MSB32BIT,Folder,NONE,true,false,Delete a file on the ARISS-PI. Typically this leaves the original copy in the PACSAT dir. To delete the original copy specify the PACSAT Dir folder
Delete Folder Contents,3,5,0,0,0,0,Folder,Remove Orphan Files,NONE,NONE,true,false,Remove all files from the folder. The original files will remain in the PACSAT Directory unless deleted seperately. Orphan files are files in a folder without a corresponding Pacsat Dir file. NB: Deleting the entire Pacsat Dir is a desperate measure perhaps only useful in testing!
Default File Expiry Period,3,6,0,0,0,0,Period(days),NONE,NONE,NONE,false,false,Set the default expiry period for files without a specific expiry time. The new value will be applied to all files.
File Expiry Period,3,7,0,0,0,0,FileId,MSB32BIT,Date,MSB32BIT,false,false,Set the expiry date for a specific file`.
Directory Maintenence Period,3,8,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period between checks to each node in the directory for file expiry.
Uplink queue maintenance Period,3,9,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the entire uplink queue for expired files.
Int File Que Check Period,3,10,0,0,0,0,Period(s),NONE,NONE,NONE,false,false,Period to check the ingestion queues for newly generated internal files.
Max File Size,3,11,0,0,0,0,Size(kb),NONE,NONE,NONE,false,false,Maximum size for an uploaded file
Max Upload File Age,3,12,0,0,0,0,Age(days),NONE,NONE,NONE,false,false,Partially uploaded files not modified for more than this period will be removed from the upload queue.

@ -0,0 +1,18 @@
#Pacsat Telemetry Decoder Properties
#Fri Feb 6 18:12:20 EST 2026
numberOfLookupTables=0
measurementsFileName=measurements.csv
model=1
layoutsUseToCallsignAsType=true
numberOfLayouts=2
layout0.filename=PacSatSim_rttelemetry.csv
layout0.name=TLMP1
layout1.filename=PacSatSim_rttelemetry.csv
layout1.name=WOD
passMeasurementsFileName=passmeasurements.csv
name=CubeSatSim
description=PacSatSim
satId=3
catalogNumber=0
conversionCoefficients=PacSatSim-coef.csv
layoutsUseBits=True

@ -0,0 +1,21 @@
#PacSat Ground Station Properties
#Fri Feb 6 18:25:06 EST 2026
sequence_num=3
name=PacSatSim
digiCallsign=AMSAT-1
description=PacSatSim
broadcastCallsign=AMSAT-11
DIR_AGE=10
bbsCallsign=AMSAT-12
telemLayoutFile=PacSatSim.dat
telem_server=tlm.amsatfox.org
web_site_url=http://CubeSatSim.org
show_system_files_on_dir_tab=false
show_user_files=true
supports_file_upload=true
norad_id=30776
psf_header_check_sums=false
is_command_station=true
secret_key=Not-required
commandsFile=PacSatSim.commands
echo_to_stdout=true

@ -0,0 +1,13 @@
CurveName,a,bx,cx^2,dx^3,ex^4,fx^5,Description
cubesatsim_voltage,0,0.01,0,0,0,0,Converts voltages read from the INA219 sensors
cubesatsim_current,-2048,1,0,0,0,0,Converts positive and negative currents read from the INA219 sensors
cubesatsim_temperature,0,0.1,0,0,0,0,Converts temperature of Pi
cubesatsim_rotation,-2048,1,0,0,0,0,Converts positive and negative dps rotation
cubesatsim_acceleration,-20.48,0.01,0,0,0,0,Converts positive and negative g acceleration
cubesatsim_altitude,0,0.1,0,0,0,0,Converts altitude
cubesatsim_pressure,0,1,0,0,0,0,Converts pressure
cubesatsim_sensor1,0,1,0,0,0,0,Conversion of Sensor 1
cubesatsim_sensor2,-2048,1,0,0,0,0,Conversion of Sensor 2
cubesatsim_sensor3,-20.48,0.01,0,0,0,0,Conversion of Sensor 3
cubesatsim_rpm,-204.8,0.1,0,0,0,0,Conversion of calculated RPM
cubesatsim_rssi,-2048,1,0,0,0,0,Conversion of Received Signal Strength
1 CurveName a bx cx^2 dx^3 ex^4 fx^5 Description
2 cubesatsim_voltage 0 0.01 0 0 0 0 Converts voltages read from the INA219 sensors
3 cubesatsim_current -2048 1 0 0 0 0 Converts positive and negative currents read from the INA219 sensors
4 cubesatsim_temperature 0 0.1 0 0 0 0 Converts temperature of Pi
5 cubesatsim_rotation -2048 1 0 0 0 0 Converts positive and negative dps rotation
6 cubesatsim_acceleration -20.48 0.01 0 0 0 0 Converts positive and negative g acceleration
7 cubesatsim_altitude 0 0.1 0 0 0 0 Converts altitude
8 cubesatsim_pressure 0 1 0 0 0 0 Converts pressure
9 cubesatsim_sensor1 0 1 0 0 0 0 Conversion of Sensor 1
10 cubesatsim_sensor2 -2048 1 0 0 0 0 Conversion of Sensor 2
11 cubesatsim_sensor3 -20.48 0.01 0 0 0 0 Conversion of Sensor 3
12 cubesatsim_rpm -204.8 0.1 0 0 0 0 Conversion of calculated RPM
13 cubesatsim_rssi -2048 1 0 0 0 0 Conversion of Received Signal Strength

@ -0,0 +1,63 @@
62,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION
0,long,timestamp,32,Sec,0,NONE,0,0,0,timestamp,This is the unix time in seconds
1,int,Sensor 2,12,integer,2,Experiments,6,8,3,Sensor 2,STEM Payload Extra Sensor 2
2,int,Sensor 3,12,integer,2,Experiments,6,9,3,Sensor 3,STEM Payload Extra Sensor 3
3,float,BATT_V,12,V,29,Battery,4,1,3,Battery Voltage,INA219 Battery Voltage
4,float,SatelliteXAxisAcceleration,12,g,30,+X Panel,7,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around X Axis
5,float,SatelliteYAxisAcceleration,12,g,30,+Y Panel,8,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Y Axis
6,float,SatelliteZAxisAcceleration,12,g,30,+Z Panel,9,4,3,Acceleration,STEM Payload Board MPU6050 Acceleration around Z Axis
7,int,BATT_I,12,mA,31,Battery,4,2,3,Battery Current,INA219 Battery Current
8,float,Temperature,12,C,5,Experiments,6,2,3,BME280 Temp,BME280 STEM Payload sensor temperature
9,float,posXv,12,V,29,+X Panel,7,1,3,Voltage,INA219 +X solar panel Voltage
10,float,posYv,12,V,29,+Y Panel,8,1,3,Voltage,INA219 +Y solar panel Voltage
11,float,posZv,12,V,29,+Z Panel,9,1,3,Voltage,INA219 +Z solar panel Voltage
12,float,negXv,12,V,29,-X Panel,10,1,3,Voltage,INA219 -X solar panel Voltage
13,float,negYv,12,V,29,-Y Panel,11,1,3,Voltage,INA219 -Y solar panel Voltage
14,float,negZv,12,V,29,-Z Panel,12,1,3,Voltage,INA219 -Z solar panel Voltage
15,int,posXi,12,mA,31,+X Panel,7,2,3,Current,INA219 +X solar panel Current
16,int,posYi,12,mA,31,+Y Panel,8,2,3,Current,INA219 +Y solar panel Current
17,int,posZi,12,mA,31,+Z Panel,9,2,3,Current,INA219 +Z solar panel Current
18,int,negXi,12,mA,31,-X Panel,10,2,3,Current,INA219 -X solar panel Current
19,int,negYi,12,mA,31,-Y Panel,11,2,3,Current,INA219 -Y solar panel Current
20,int,negZi,12,mA,31,-Z Panel,12,2,3,Current,INA219 -Z solar panel Current
21,float,BATT2_V,12,V,29,Battery2,5,1,3,Battery2 Voltage,INA219 Battery2 Voltage
22,float,spin,12,rpm,32,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells
23,int,Pressure,12,hPa,2,Experiments,6,3,3,BME280 Pressure,BME280 STEM Payload sensor pressure
24,float,Altitude,12,m,37,Experiments,6,4,3,BME280 Altitude,BME280 STEM Payload sensor altitude
25,float,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count
26,float,rssi,12,dBm,31,Radio,1,1,3,RSSI,Received Signal Strength Indication
27,float,IHUcpuTemp,12,C,5,Computer Hardware,2,1,3,IHU Temp (Pi),Internal temperature of IHU from Pi
28,float,SatelliteXAxisAngularVelocity,12,dps,31,+X Panel,7,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around X Axis
29,float,SatelliteYAxisAngularVelocity,12,dps,31,+Y Panel,8,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Y Axis
30,float,SatelliteZAxisAngularVelocity,12,dps,31,+Z Panel,9,3,3,Rotation,STEM Payload Board MPU6050 Angular veolcity around Z Axis
31,float,Humidity,12,%,5,Experiments,6,5,3,BME280 Humidity,BME280 Humidity
32,int,BAT2_I,12,mA,31,Battery2,5,2,3,Battery2 Current,INA219 Battery2 Current
33,float,DiodeTemp,12,C,32,Experiments,6,6,3,Diode Temp,STEM Payload Diode Temperature
34,int,Sensor 1,12,integer,2,Experiments,6,7,3,Sensor 1,STEM Payload Extra Sensor 1
35,float,STEMPayloadStatus,1,-,35,Experiments,6,1,0,STEM Payload Status, STEM Payload STEM Payload board failure Indicator
36,float,SafeMode,1,-,33,Computer Software,3,2,0,Safe Mode, Safe Mode (Low Battery Voltage)
37,float,SimulatedTelemetry,1,-,33,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry Indicator
38,float,PayloadStatus1,1,-,35,NONE,6,8,0,Exp 3,STEM Payload status 1 failure indicator
39,float,I2CBus0Failure,1,-,35,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator
40,float,I2CBus1Failure,1,-,35,Computer Hardware,2,2,0,I2C Bus 1,I2C bus 1 failure indicator
41,float,I2CBus3Failure,1,-,35,Computer Hardware,2,3,0,I2C Bus 3,I2C bus 3 failure indicator
42,float,CameraFailure,1,-,35,Computer Hardware,2,4,0,Camera,Camera failure indicator
43,int,GroundCommands,4,-,2,Computer Software,3,3,0,Ground Commands,Number of ground commands received
44,float,RxAntenna,1,-,36,Radio,1,3,0,RX Antenna,Receive antenna status
45,float,TxAntenna,1,-,36,Radio,1,2,0,TX Antenna,Transmit antenna status
46,float,C2CStatus,2,-,34,Computer Software,3,5,0,Command Control, Command & Control Status
47,float,ICR3VProt,12,V,0,NONE,7,2,3,3V Prot,ICR 3V Proteted
48,float,ICR2dot5V,12,V,0,NONE,7,3,3,2.5V,ICR 2.5V
49,float,ICR2dot5VProt,12,V,0,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected
50,float,rf6,12,-,0,NONE,0,0,0,None,None
51,float,rf7,12,-,0,NONE,0,0,0,None,None
52,float,MuxTest,12,V,0,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR
53,float,LtVGACtl,12,V,0,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA)
54,float,pad,4,-,34,NONE,0,0,0,None,Unused
55,float,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance
56,float,pad1,1,-,0,NONE,0,0,0,NONE,Filler
57,float,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds
58,float,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information
59,float,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset
60,float,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset
61,float,pad2,27,-,0,NONE,0,0,0,NONE,Filler
1 62 TYPE FIELD BITS UNIT CONVERSION MODULE MODULE_NUM MODULE_LINE LINE_TYPE SHORT_NAME DESCRIPTION
2 0 long timestamp 32 Sec 0 NONE 0 0 0 timestamp This is the unix time in seconds
3 1 int Sensor 2 12 integer 2 Experiments 6 8 3 Sensor 2 STEM Payload Extra Sensor 2
4 2 int Sensor 3 12 integer 2 Experiments 6 9 3 Sensor 3 STEM Payload Extra Sensor 3
5 3 float BATT_V 12 V 29 Battery 4 1 3 Battery Voltage INA219 Battery Voltage
6 4 float SatelliteXAxisAcceleration 12 g 30 +X Panel 7 4 3 Acceleration STEM Payload Board MPU6050 Acceleration around X Axis
7 5 float SatelliteYAxisAcceleration 12 g 30 +Y Panel 8 4 3 Acceleration STEM Payload Board MPU6050 Acceleration around Y Axis
8 6 float SatelliteZAxisAcceleration 12 g 30 +Z Panel 9 4 3 Acceleration STEM Payload Board MPU6050 Acceleration around Z Axis
9 7 int BATT_I 12 mA 31 Battery 4 2 3 Battery Current INA219 Battery Current
10 8 float Temperature 12 C 5 Experiments 6 2 3 BME280 Temp BME280 STEM Payload sensor temperature
11 9 float posXv 12 V 29 +X Panel 7 1 3 Voltage INA219 +X solar panel Voltage
12 10 float posYv 12 V 29 +Y Panel 8 1 3 Voltage INA219 +Y solar panel Voltage
13 11 float posZv 12 V 29 +Z Panel 9 1 3 Voltage INA219 +Z solar panel Voltage
14 12 float negXv 12 V 29 -X Panel 10 1 3 Voltage INA219 -X solar panel Voltage
15 13 float negYv 12 V 29 -Y Panel 11 1 3 Voltage INA219 -Y solar panel Voltage
16 14 float negZv 12 V 29 -Z Panel 12 1 3 Voltage INA219 -Z solar panel Voltage
17 15 int posXi 12 mA 31 +X Panel 7 2 3 Current INA219 +X solar panel Current
18 16 int posYi 12 mA 31 +Y Panel 8 2 3 Current INA219 +Y solar panel Current
19 17 int posZi 12 mA 31 +Z Panel 9 2 3 Current INA219 +Z solar panel Current
20 18 int negXi 12 mA 31 -X Panel 10 2 3 Current INA219 -X solar panel Current
21 19 int negYi 12 mA 31 -Y Panel 11 2 3 Current INA219 -Y solar panel Current
22 20 int negZi 12 mA 31 -Z Panel 12 2 3 Current INA219 -Z solar panel Current
23 21 float BATT2_V 12 V 29 Battery2 5 1 3 Battery2 Voltage INA219 Battery2 Voltage
24 22 float spin 12 rpm 32 Computer Software 3 1 3 Spacecraft Spin Calculated spin rate using solar cells
25 23 int Pressure 12 hPa 2 Experiments 6 3 3 BME280 Pressure BME280 STEM Payload sensor pressure
26 24 float Altitude 12 m 37 Experiments 6 4 3 BME280 Altitude BME280 STEM Payload sensor altitude
27 25 float Resets 12 - 12 NONE 3 2 3 Reset Count Software Reset Count
28 26 float rssi 12 dBm 31 Radio 1 1 3 RSSI Received Signal Strength Indication
29 27 float IHUcpuTemp 12 C 5 Computer Hardware 2 1 3 IHU Temp (Pi) Internal temperature of IHU from Pi
30 28 float SatelliteXAxisAngularVelocity 12 dps 31 +X Panel 7 3 3 Rotation STEM Payload Board MPU6050 Angular veolcity around X Axis
31 29 float SatelliteYAxisAngularVelocity 12 dps 31 +Y Panel 8 3 3 Rotation STEM Payload Board MPU6050 Angular veolcity around Y Axis
32 30 float SatelliteZAxisAngularVelocity 12 dps 31 +Z Panel 9 3 3 Rotation STEM Payload Board MPU6050 Angular veolcity around Z Axis
33 31 float Humidity 12 % 5 Experiments 6 5 3 BME280 Humidity BME280 Humidity
34 32 int BAT2_I 12 mA 31 Battery2 5 2 3 Battery2 Current INA219 Battery2 Current
35 33 float DiodeTemp 12 C 32 Experiments 6 6 3 Diode Temp STEM Payload Diode Temperature
36 34 int Sensor 1 12 integer 2 Experiments 6 7 3 Sensor 1 STEM Payload Extra Sensor 1
37 35 float STEMPayloadStatus 1 - 35 Experiments 6 1 0 STEM Payload Status STEM Payload STEM Payload board failure Indicator
38 36 float SafeMode 1 - 33 Computer Software 3 2 0 Safe Mode Safe Mode (Low Battery Voltage)
39 37 float SimulatedTelemetry 1 - 33 Computer Software 3 4 0 Simulated Telemetry Simulated Telemetry Indicator
40 38 float PayloadStatus1 1 - 35 NONE 6 8 0 Exp 3 STEM Payload status 1 failure indicator
41 39 float I2CBus0Failure 1 - 35 NONE 2 2 0 I2C Bus 0 I2C bus 0 failure indicator
42 40 float I2CBus1Failure 1 - 35 Computer Hardware 2 2 0 I2C Bus 1 I2C bus 1 failure indicator
43 41 float I2CBus3Failure 1 - 35 Computer Hardware 2 3 0 I2C Bus 3 I2C bus 3 failure indicator
44 42 float CameraFailure 1 - 35 Computer Hardware 2 4 0 Camera Camera failure indicator
45 43 int GroundCommands 4 - 2 Computer Software 3 3 0 Ground Commands Number of ground commands received
46 44 float RxAntenna 1 - 36 Radio 1 3 0 RX Antenna Receive antenna status
47 45 float TxAntenna 1 - 36 Radio 1 2 0 TX Antenna Transmit antenna status
48 46 float C2CStatus 2 - 34 Computer Software 3 5 0 Command Control Command & Control Status
49 47 float ICR3VProt 12 V 0 NONE 7 2 3 3V Prot ICR 3V Proteted
50 48 float ICR2dot5V 12 V 0 NONE 7 3 3 2.5V ICR 2.5V
51 49 float ICR2dot5VProt 12 V 0 NONE 7 4 3 2.5V Prot ICR 2.5V Protected
52 50 float rf6 12 - 0 NONE 0 0 0 None None
53 51 float rf7 12 - 0 NONE 0 0 0 None None
54 52 float MuxTest 12 V 0 NONE 7 5 3 Sensor Power Sensor Power Voltage at the ICR
55 53 float LtVGACtl 12 V 0 NONE 1 4 3 VGA Control Control Voltage to the Variable Gain Amplifier (VGA)
56 54 float pad 4 - 34 NONE 0 0 0 None Unused
57 55 float IHUdiagData 32 - 18 NONE 3 2 0 Diagnostic Info Diagnostic Data on IHU Performance
58 56 float pad1 1 - 0 NONE 0 0 0 NONE Filler
59 57 float wodSize 8 000s 36 NONE 3 3 0 WOD Stored Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds
60 58 float swCmds 32 - 35 NONE 7 6 0 Diagnostic ICR Diagnostic information
61 59 float hwCmdCnt 6 - 1 NONE 7 7 0 HW Command Count Number of hardware commands since last reset
62 60 float swCmdCnt 6 - 1 NONE 7 8 0 SW Command Count Number of software commands since last reset
63 61 float pad2 27 - 0 NONE 0 0 0 NONE Filler

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,904 @@
// code for Pico or Pro Micro or STM32 on the CubeSat Simulator STEM Payload board
// works wih CubeSatSim software v1.3.2 or later
// extra sensors can be added in payload_extension.cpp file
// adds absolute orientation yaw, pitch, roll as Sensor 1, 2, and 3.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
//#include <MPU6050_tockn.h>
#include "MPU6050_6Axis_MotionApps20.h"
#if !defined(ARDUINO_ARCH_MBED_RP2040) // && defined(ARDUINO_ARCH_RP2040)
#include <EEPROM.h>
#endif
#if defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Arduino Mbed OS RP2040 Boards is used in Arduino IDE
#include <TinyGPS++.h>
TinyGPSPlus gps;
UART Serial2(8, 9, 0, 0);
#elif !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards in Arduino IDE
#include <TinyGPS++.h>
TinyGPSPlus gps;
bool check_for_wifi();
bool wifi = false;
int led_builtin_pin;
#else // if Sparkfun Pro Micro or STM32
#include <EEPROM.h>
#endif
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme;
//MPU6050 mpu6050(Wire);
MPU6050 mpu;
int const INTERRUPT_PIN = 6;
bool DMPReady = false;
uint8_t devStatus;
uint8_t MPUIntStatus; // Holds actual interrupt status byte from MPU
uint16_t packetSize; // Expected DMP packet size (default is 42 bytes)
uint8_t FIFOBuffer[64]; // FIFO storage buffer
Quaternion q; // [w, x, y, z] Quaternion container
VectorFloat gravity; // [x, y, z] Gravity vector
float ypr[3]; // [yaw, pitch, roll] Yaw/Pitch/Roll container and gravity vector
int16_t ax, ay, az;
int16_t gx, gy, gz;
float accelx, accely, accelz, acceleration;
float gyrox, gyroy, gyroz, rotation;
int yaw, pitch, roll;
int reset_count;
long timer = 0;
int bmePresent;
int RXLED = 17; // The RX LED has a defined Arduino pin
int whiteLED = 9;
int yellowLED = 8;
int Sensor1 = 0;
float Sensor2 = 0;
float temp;
int calibration = 0;
void ee_prom_word_write(int addr, int val);
short ee_prom_word_read(int addr);
int first_time = true;
int first_read = true;
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
float T2 = 24; // Temperature data point 1
float R2 = 169; // Reading data point 1
float T1 = 6; // Temperature data point 2
float R1 = 181; // Reading data point 2
#endif
#if defined __AVR_ATmega32U4__
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
#endif
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
float T2 = 25; // Temperature data point 1
float R2 = 671; // Reading data point 1
float T1 = 15.5; // Temperature data point 2
float R1 = 695; // Reading data point 2
#endif
int sensorValue;
float Temp;
float rest;
char sensor_end_flag[] = "_END_FLAG_";
char sensor_start_flag[] = "_START_FLAG_";
bool show_gps = true; // set to false to not see all messages
float flon = 0.0, flat = 0.0, flalt = 0.0;
void get_gps();
extern void payload_setup(); // sensor extension setup function defined in payload_extension.cpp
extern void payload_loop(); // sensor extension read function defined in payload_extension.cpp
volatile bool MPUInterrupt = false; // Indicates whether MPU6050 interrupt pin has gone high
void DMPDataReady()
{
MPUInterrupt = true;
}
void setup() {
Serial.begin(115200); // Serial Monitor for testing
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
Serial1.setRX(1);
delay(100);
Serial1.setTX(0);
delay(100);
#endif
Serial1.begin(115200); // for communication with Pi Zero
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards in Arduino IDE
EEPROM.begin(512);
#endif
delay(2000);
#if defined (ARDUINO_ARCH_MBED_RP2040) && (ARDUINO_ARCH_RP2040)
Serial.println("Pico with Mbed");
#elif !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
Serial.println("Pico with RP2040");
#elif defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
Serial.println("STM32");
#elif defined __AVR_ATmega32U4__
Serial.println("Pro Micro");
#else
Serial.println("Unknown board");
#endif
Serial.println("Starting!");
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
Serial.println("Starting Serial2 for optional GPS on JP12");
// Serial2.begin(9600); // serial from - some modules need 115200
Serial2.begin(9600); // serial from GPS or other serial sensor. Some GPS need 115200
// set all Pico GPIO connected pins to input
for (int i = 10; i < 22; i++) {
pinMode(i, INPUT);
}
pinMode(26, INPUT);
pinMode(27, INPUT);
pinMode(28, INPUT);
pinMode(15, INPUT_PULLUP); // squelch
#endif
blink_setup();
blink(500);
delay(250);
blink(500);
delay(250);
led_set(whiteLED, HIGH);
delay(250);
led_set(whiteLED, LOW);
led_set(yellowLED, HIGH);
delay(250);
led_set(yellowLED, LOW);
if (bme.begin(0x76)) {
bmePresent = 1;
} else {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
bmePresent = 0;
}
// mpu6050.begin();
ax = 0;
ay = 0;
az = 0;
gx = 0;
gy = 0;
gz = 0;
yaw = 0;
pitch = 0;
roll = 0;
accelx = 0;
accely = 0;
accelz = 0;
acceleration = 1.0;
gyrox = 0;
gyroy = 0;
gyroz = 0;
mpu.initialize(ACCEL_FS::A2G, GYRO_FS::G250DPS);
// mpu.initialize();
pinMode(INTERRUPT_PIN, INPUT);
// Verify connection
if (mpu.testConnection())
{
Serial.println("MPU6050 connection successful");
}
else
{
Serial.println("MPU6050 connection failed");
}
/* Initializate and configure the DMP*/
Serial.println(F("Initializing DMP..."));
devStatus = mpu.dmpInitialize();
if (eeprom_word_read(0) == 0xA08)
{
Serial.println("Reading gyro and accel offsets from EEPROM\n");
int axOffset = eeprom_word_read(1);
int ayOffset = eeprom_word_read(2);
int azOffset = eeprom_word_read(3);
int gxOffset = eeprom_word_read(4);
int gyOffset = eeprom_word_read(5);
int gzOffset = eeprom_word_read(6);
Serial.println(axOffset, DEC);
Serial.println(ayOffset, DEC);
Serial.println(azOffset, DEC);
Serial.println(gxOffset, DEC);
Serial.println(gyOffset, DEC);
Serial.println(gzOffset, DEC);
mpu.setXGyroOffset(gxOffset);
mpu.setYGyroOffset(gyOffset);
mpu.setZGyroOffset(gzOffset);
mpu.setXAccelOffset(axOffset);
mpu.setYAccelOffset(ayOffset);
mpu.setZAccelOffset(azOffset);
mpu.PrintActiveOffsets();
Serial.println("\nTemperature calibration data from EEPROM\n");
T1 = ((float)eeprom_word_read(7)) / 10.0;
R1 = ((float)eeprom_word_read(8));
T2 = ((float)eeprom_word_read(9)) / 10.0;
R2 = ((float)eeprom_word_read(10));
Serial.println(T1, DEC);
Serial.println(R1, DEC);
Serial.println(" ");
Serial.println(T2, DEC);
Serial.println(R2, DEC);
Serial.println(" ");
}
else
{
// Serial.println("Calculating gyro offsets\n");
// mpu6050.calcGyroOffsets(true);
if (devStatus == 0)
{
// if (first_read == true) {
mpu.CalibrateAccel(6); // Calibration Time: generate offsets and calibrate our MPU6050
mpu.CalibrateGyro(6);
Serial.println("These are the Active offsets: ");
mpu.PrintActiveOffsets();
int16_t *offsets;
offsets = mpu.GetActiveOffsets();
// A_OFFSET_H_READ_A_OFFS(Data);
Serial.print((float)offsets[0], 5); Serial.print(",\t");
Serial.print((float)offsets[1], 5); Serial.print(",\t");
Serial.print((float)offsets[2], 5); Serial.print(",\t");
// XG_OFFSET_H_READ_OFFS_USR(Data);
Serial.print((float)offsets[3], 5); Serial.print(",\t");
Serial.print((float)offsets[4], 5); Serial.print(",\t");
Serial.print((float)offsets[5], 5); Serial.print("\n\n");
// }
#if !defined(ARDUINO_ARCH_MBED_RP2040) // && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
Serial.println("Storing gyro and accel offsets in EEPROM\n");
eeprom_word_write(0, 0xA08);
/* 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);
*/
eeprom_word_write(1, offsets[0]);
eeprom_word_write(2, offsets[1]);
eeprom_word_write(3, offsets[2]);
eeprom_word_write(4, offsets[3]);
eeprom_word_write(5, offsets[4]);
eeprom_word_write(6, offsets[5]);
Serial.println("\nStoring temperature calibration data in EEPROM\n");
eeprom_word_write(7, (int)(T1 * 10.0) + 0.5);
eeprom_word_write(8, (int) R1);
eeprom_word_write(9, (int)(T2 * 10.0) + 0.5);
eeprom_word_write(10, (int) R2);
T1 = ((float)eeprom_word_read(7)) / 10.0;
R1 = ((float)eeprom_word_read(8));
T2 = ((float)eeprom_word_read(9)) / 10.0;
R2 = ((float)eeprom_word_read(10));
Serial.println(T1, DEC);
Serial.println(R1, DEC);
Serial.println(" ");
Serial.println(T2, DEC);
Serial.println(R2, DEC);
Serial.println(" ");
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
if (EEPROM.commit()) {
Serial.println("EEPROM successfully committed\n");
} else {
Serial.println("ERROR! EEPROM commit failed\n");
}
#endif
#endif
}
}
/* Supply your gyro offsets here, scaled for min sensitivity */
/* mpu.setXGyroOffset(57);
mpu.setYGyroOffset(99);
mpu.setZGyroOffset(19);
mpu.setXAccelOffset(-4922);
mpu.setYAccelOffset(-2136);
mpu.setZAccelOffset(3104);
mpu.setXGyroOffset(0);
mpu.setYGyroOffset(0);
mpu.setZGyroOffset(0);
mpu.setXAccelOffset(0);
mpu.setYAccelOffset(0);
mpu.setZAccelOffset(0);
*/
if (devStatus == 0)
{
/* if (first_read == true) {
mpu.CalibrateAccel(6); // Calibration Time: generate offsets and calibrate our MPU6050
mpu.CalibrateGyro(6);
Serial.println("These are the Active offsets: ");
mpu.PrintActiveOffsets();
}
*/
Serial.println(F("Enabling DMP...")); // Turning ON DMP
mpu.setDMPEnabled(true);
Serial.print(F("Enabling interrupt detection (Arduino external interrupt "));
Serial.print(digitalPinToInterrupt(INTERRUPT_PIN));
Serial.println(F(")..."));
attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), DMPDataReady, RISING);
MPUIntStatus = mpu.getIntStatus();
/* Set the DMP Ready flag so the main loop() function knows it is okay to use it */
Serial.println(F("DMP ready! Waiting for first interrupt..."));
DMPReady = true;
packetSize = mpu.dmpGetFIFOPacketSize();
// Serial.print(packetSize);
}
else
{
Serial.print(F("DMP Initialization failed (code ")); // Print the error code
Serial.print(devStatus);
Serial.println(F(")"));
// 1 = initial memory load failed
// 2 = DMP configuration updates failed
}
payload_setup(); // sensor extension setup function defined in payload_extension.cpp
reset_count = 100;
}
void loop() {
blink(50);
if (Serial1.available() > 0) {
Serial.print("Received serial data!!!\n");
delay(10);
while (Serial1.available() > 0) {
char result = Serial1.read();
Serial.print(result);
}
Serial.println(" ");
}
{
// if (result == '?')
{
if (bmePresent) {
Serial1.print(sensor_start_flag);
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());
Serial.print("OK BME280 ");
temp = bme.readTemperature();
Serial.print(temp);
Serial.print(" ");
Serial.print(bme.readPressure() / 100.0F);
Serial.print(" ");
Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
Serial.print(" ");
Serial.print(bme.readHumidity());
} else
{
Serial1.print(sensor_start_flag);
Serial1.print("OK BME280 0.0 0.0 0.0 0.0");
Serial.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());
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());
*/
// if (MPUInterrupt) {
// if (true) {
if (mpu.dmpGetCurrentFIFOPacket(FIFOBuffer))
{
/* Display Euler angles in degrees */
mpu.dmpGetQuaternion(&q, FIFOBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
accelx = ax / 16384.0;
accely = ay / 16384.0;
accelz = (az - 16384) / 16384.0;
acceleration = sqrt(accelx*accelx + accely*accely + accelz*accelz);
gyrox = gx / 6.75;
gyroy = gy / 6.75;
gyroz = gz / 6.75;
rotation = sqrt(gyrox*gyrox + gyroy*gyroy + gyroz*gyroz);
yaw = ypr[0] * 180 / M_PI;
if (yaw < 0) yaw += 360;
pitch = ypr[1] * 180 / M_PI;
if (pitch < 0) pitch += 360;
roll = ypr[2] * 180 / M_PI;
if (roll < 0) roll += 360;
// Serial.print("_"); Serial.print(yaw); Serial.print("_");
// } else
// Serial.print("*");
MPUInterrupt = false;
} else
// Serial.print("/");
Serial1.print(" "); // Don't know why this is needed
Serial1.print(" MPU6050 ");
Serial1.print(gyrox); Serial1.print(" ");
Serial1.print(gyroy); Serial1.print(" ");
Serial1.print(gyroz); Serial1.print(" ");
Serial1.print(accelx); Serial1.print(" ");
Serial1.print(accely); Serial1.print(" ");
Serial1.print(accelz);
Serial.print(" MPU6050 ");
Serial.print(gyrox); Serial.print(" ");
Serial.print(gyroy); Serial.print(" ");
Serial.print(gyroz); Serial.print(" ");
Serial.print(accelx); Serial.print(" ");
Serial.print(accely); Serial.print(" ");
Serial.print(accelz);
/*
} else {
Serial1.print("OK MPU6050 0.0 0.0 0.0 0.0 0.0 0.0");
Serial.print("OK MPU6050 0.0 0.0 0.0 0.0 0.0 0.0");
}
*/
sensorValue = read_analog();
// Serial.println(sensorValue);
Temp = T1 + (sensorValue - R1) *((T2 - T1)/(R2 - R1));
// Serial1.print(" GPS 0 0 0 TMP ");
Serial1.print(" GPS ");
Serial1.print(flat,4);
Serial1.print(" ");
Serial1.print(flon,4);
Serial1.print(" ");
Serial1.print(flalt,2);
Serial1.print(" TMP ");
Serial1.print(Temp);
// Serial1.print(" ");
// Serial1.println(Sensor2);
Serial.print(" GPS ");
Serial.print(flat,4);
Serial.print(" ");
Serial.print(flon,4);
Serial.print(" ");
Serial.print(flalt,2);
// Serial.print(" GPS 0 0 0 TMP ");
Serial.print(" TMP ");
Serial.print(Temp);
// Serial.print(" ");
// Serial.println(Sensor2);
// float rotation = 0;
// rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()*mpu6050.getGyroZ());
// float acceleration = 0;
// acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ());
// Serial.println(" ");
// Serial.print(rotation);
// Serial.print(" ");
// Serial.println(acceleration);
if (first_read == true) {
first_read = false;
rest = acceleration;
Serial.println(" ");
Serial.print("rest acceleration: ");
Serial.println(rest);
}
if (acceleration > 1.1 * rest)
led_set(whiteLED, HIGH);
else
led_set(whiteLED, LOW);
if (rotation > 20)
led_set(yellowLED, HIGH);
else
led_set(yellowLED, LOW);
}
Serial1.print(" YPR ");
Serial1.print(yaw);
Serial1.print(" ");
Serial1.print(pitch);
Serial1.print(" ");
Serial1.print(roll);
Serial1.print(" ");
Serial.print(" YPR ");
Serial.print(yaw);
Serial.print(" ");
Serial.print(pitch);
Serial.print(" ");
Serial.print(roll);
Serial.println(" ");
payload_loop(); // sensor extension read function defined in payload_extension.cpp
// Serial1.println(" ");
Serial1.println(sensor_end_flag);
Serial.println(" ");
}
if (Serial.available() > 0) {
blink(50);
char result = Serial.read();
// Serial.println(result);
// Serial.println("OK");
// Serial.println(counter++);
//#if !defined (ARDUINO_ARCH_RP2040)
if (result == 'R' || result == 'r') {
// Serial1.println("OK");
// delay(100);
Serial.println("Resetting\n");
first_read = true;
setup();
}
else if (result == 'D' || result == 'd') {
Serial.println("\nCurrent temperature calibration data\n");
Serial.println(T1, DEC);
Serial.println(R1, DEC);
Serial.println(" ");
Serial.println(T2, DEC);
Serial.println(R2, DEC);
Serial.println("\nCurrent raw temperature reading\n");
Serial.println(sensorValue, DEC);
Serial.println(" ");
}
else if (result == 'C' || result == 'c') {
Serial.println("\nClearing stored gyro and accel offsets in EEPROM\n");
eeprom_word_write(0, 0x00);
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
if (EEPROM.commit()) {
Serial.println("EEPROM successfully committed\n");
} else {
Serial.println("ERROR! EEPROM commit failed\n");
}
#endif
first_time = true;
setup();
}
else if (result == 'S' || result == 's') {
Serial.print("\nStoring temperature calibration data point "); // in EEPROM\n");
Serial.print(calibration + 1);
Serial.print(" in EEPROM\n");
Serial.println(temp);
Serial.println(sensorValue);
Serial.println(" ");
eeprom_word_write(calibration * 2 + 7 , (int)(temp * 10.0) + 0.5);
eeprom_word_write(calibration * 2 + 8, sensorValue);
if (calibration == 0) {
T1 = temp;
R1 = sensorValue;
calibration = 1;
} else {
T2 = temp;
R2 = sensorValue;
calibration = 0;
}
// calibration = (calibration + 1) % 2;
// Serial.println(calibration + 1);
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
if (EEPROM.commit()) {
Serial.println("EEPROM successfully committed\n");
} else {
Serial.println("ERROR! EEPROM commit failed\n");
}
#endif
}
//#endif
}
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
Serial.print("Squelch: ");
Serial.println(digitalRead(15));
get_gps();
#else
delay(1000); // not needed due to gps 1 second polling delay
#endif
// if (reset_count-- == 0)
// setup();
}
void eeprom_word_write(int addr, int val)
{
#if !defined(ARDUINO_ARCH_MBED_RP2040) // && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
EEPROM.write(addr * 2, lowByte(val));
EEPROM.write(addr * 2 + 1, highByte(val));
#endif
}
short eeprom_word_read(int addr)
{
int result = 0;
#if !defined(ARDUINO_ARCH_MBED_RP2040) // && defined(ARDUINO_ARCH_RP2040) // if Raspberry Pi RP2040 Boards is used in Arduino IDE
result = ((EEPROM.read(addr * 2 + 1) << 8) | EEPROM.read(addr * 2));
#endif
return result;
}
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(whiteLED, OUTPUT);
pinMode(yellowLED,OUTPUT);
#endif
#if defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
pinMode(LED_BUILTIN, OUTPUT);
pinMode(18, OUTPUT); // yellow LED (was blue LED on STEM Payload Board v1.3.2)
pinMode(19, OUTPUT); // white LED (was green LED on STEM Payload Board v1.3.2)
#endif
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
if (check_for_wifi()) {
wifi = true;
led_builtin_pin = LED_BUILTIN; // use default GPIO for Pico W
pinMode(LED_BUILTIN, OUTPUT);
// configure_wifi();
} else {
led_builtin_pin = 25; // manually set GPIO 25 for Pico board
// pinMode(25, OUTPUT);
pinMode(led_builtin_pin, OUTPUT);
}
pinMode(18, OUTPUT);
pinMode(19, 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
#if defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
digitalWrite(LED_BUILTIN, HIGH); // set the built-in LED ON
#endif
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
if (wifi)
digitalWrite(LED_BUILTIN, HIGH); // set the built-in LED ON
else
digitalWrite(led_builtin_pin, HIGH); // set the built-in LED ON
#endif
delay(length);
#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
#if defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
digitalWrite(LED_BUILTIN, LOW); // set the built-in LED OFF
#endif
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
if (wifi)
digitalWrite(LED_BUILTIN, LOW); // set the built-in LED ON
else
digitalWrite(led_builtin_pin, LOW); // set the built-in 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 == whiteLED)
digitalWrite(PB9, state);
else if (ledPin == yellowLED)
digitalWrite(PB8, state);
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(ledPin, state);
#endif
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
if (ledPin == whiteLED)
digitalWrite(19, state);
else if (ledPin == yellowLED)
digitalWrite(18, state);
#endif
}
int read_analog()
{
int sensorValue;
#if defined __AVR_ATmega32U4__
sensorValue = analogRead(A3);
#endif
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
sensorValue = analogRead(PA7);
#endif
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
sensorValue = analogRead(28);
#endif
return(sensorValue);
}
#if !defined(ARDUINO_ARCH_MBED_RP2040) && defined(ARDUINO_ARCH_RP2040)
bool check_for_wifi() {
pinMode(29, INPUT);
const float conversion_factor = 3.3f / (1 << 12);
uint16_t result = analogRead(29);
// Serial.printf("ADC3 value: 0x%03x, voltage: %f V\n", result, result * conversion_factor);
if (result < 0x10) {
Serial.println("\nPico W detected!\n");
return(true);
}
else {
Serial.println("\nPico detected!\n");
return(false);
}
}
#endif
#if defined (ARDUINO_ARCH_MBED_RP2040) || (ARDUINO_ARCH_RP2040)
void get_gps() {
// Serial.println("Getting GPS data");
bool newData = false;
unsigned long start = millis();
// for (unsigned long start = millis(); millis() - start < 1000;) // 5000;)
while ((millis() - start) < 1000) // 5000;)
{
while (Serial2.available())
{
char c = Serial2.read();
if (show_gps)
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
if (newData) {
Serial.print("GPS read new data in ms: ");
Serial.println(millis() - start);
// float flon = 0.0, flat = 0.0, flalt = 0.0;
// unsigned long age;
// starting = millis();
// gps.f_get_position(&flat, &flon, &age);
Serial.print(F("Location: "));
if (gps.location.isValid())
{
Serial.print(gps.location.lat(), 6);
Serial.print(F(","));
Serial.print(gps.location.lng(), 6);
flat = gps.location.lat();
flon = gps.location.lng();
flalt = gps.altitude.meters();
}
else
{
Serial.print(F("INVALID"));
}
Serial.print("\r\n");
} else
// Serial.printf("GPS read no new data: %d\n", millis() - start);
;
}
#endif

@ -0,0 +1,25 @@
// Use this template for adding additional sensors
// see Payload_BME280_MPU6050_XS_Extended for an example
// put your library includes here
#include "Arduino.h"
// put your globals here
// put your setup code here
void payload_setup() {
// Serial.println("Starting new sensor!");
}
// put your loop code here
// Very Important: only use print, not println!!
void payload_loop() {
/*
Serial1.print(" NEW 0.0"); // send sensor data over serial to Pi Zero
Serial.print(" NEW 0.0"); // send sensor data over serial monitor for testing
*/
}

@ -20,7 +20,9 @@ bme280test Displays the results of reading the BME280 sensor: Temperature, Press
GetAllData Displays the results of reading the MPU6050 sensor: Temperature, X, Y, and Z Axes: Acceleration, Gyor (Rotation Rate), and Angle. Requires the following libraries: MPU6050_tockn.
Payload_BME280_MPU6050_XS This code answers the query from the Raspberry Pi CubeSatSim software over the UART so that the STEM Payload is marked "OK" in the FoxTelem CubeSatSim-FSK or CubeSatSim-BPSK Health tab and also replies with BME280 and MPU6050 sensor data. In FoxTelem, this is displayed as the X, Y, and Z Gyro (dps) and in AFSK mode, it is appended to the telemetry string.
Payload_BME280_MPU6050_XS This code answers the query from the Raspberry Pi CubeSatSim software over the UART so that the STEM Payload is marked "OK" in the FoxTelem CubeSatSim-FSK or CubeSatSim-BPSK Health tab and also replies with BME280 and MPU6050 sensor data. In FoxTelem, this is displayed as the X, Y, and Z Gyro (dps) and in AFSK mode, it is appended to the telemetry string. This code also supports a serial GPS module.
ayload_BME280_MPU6050_YPR_EEPROM This code adds to the Payload_BME280_MPU6050_XS code Yaw Pitch and Roll (YPR) determination.
For information about programming the Sparkfun Pro Micro or STM32, see the v1.2 wiki instructions: https://github.com/alanbjohnston/CubeSatSim/wiki/v1.2-8.-STEM-Payload-Board

@ -0,0 +1,16 @@
[Unit]
Description=OliveTin
Requires=network-online.target
After=network-online.target
Requires=local-fs.target
After=local-fs.target
[Service]
ExecStart=/usr/local/bin/OliveTin
Restart=always
Environment="PORT=80"
# User=pi
[Install]
WantedBy=multi-user.target

@ -8,7 +8,9 @@ WorkingDirectory=/home/pi/CubeSatSim
StandardOutput=inherit
StandardError=inherit
Restart=always
User=root
User=pi
CPUQuota=50%
CPUWeight=50
[Install]
WantedBy=default.target

@ -0,0 +1,17 @@
[Unit]
Description=frequency
[Service]
TimeoutStopSec=5
ExecStart=python3 -u /home/pi/CubeSatSim/frequency.py
WorkingDirectory=/home/pi/CubeSatSim
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
CPUQuota=15%
CPUWeight=70
CPUAccounting=true
[Install]
WantedBy=default.target

@ -0,0 +1,14 @@
[Unit]
Description=PacsatSim
[Service]
TimeoutStopSec=5
ExecStart=/home/pi/CubeSatSim/pacsatsim.sh
WorkingDirectory=/home/pi/CubeSatSim
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=default.target

@ -0,0 +1,14 @@
[Unit]
Description=pushbutton
[Service]
TimeoutStopSec=5
ExecStart=python3 -u /home/pi/CubeSatSim/pushbutton.py
WorkingDirectory=/home/pi/CubeSatSim
StandardOutput=inherit
StandardError=inherit
Restart=always
User=root
[Install]
WantedBy=default.target

@ -8,7 +8,7 @@ WorkingDirectory=/home/pi/CubeSatSim
StandardOutput=inherit
StandardError=inherit
Restart=always
User=root
User=pi
[Install]
WantedBy=default.target

@ -15,7 +15,7 @@ int main(int argc, char *argv[]) {
}
}
printf("CubeSatSim v2.2 INA219 Voltage and Current Telemetry\n");
printf("CubeSatSim v2.3 INA219 Voltage and Current Telemetry\n");
map[MINUS_X] = MINUS_Y;
map[PLUS_Z] = MINUS_X;
map[MINUS_Y] = PLUS_Z;
@ -30,6 +30,9 @@ int main(int argc, char *argv[]) {
strcat(pythonConfigStr, " s");
char cmdbuffer[1000];
// FILE *file2 = sopen(pythonVenv); // activate venv
FILE *file1 = sopen(pythonConfigStr); // try new function
fgets(cmdbuffer, 1000, file1);
if (debug == ON)

File diff suppressed because it is too large Load Diff

481
update

@ -1,481 +0,0 @@
#!/bin/bash
echo -e "\nupdate script for CubeSatSim v2.2\n"
FLAG=0
checkout=0
if [ -z "$1" ] ; then
checkout=0
else
checkout=1
branch="$1"
echo -n "changing to branch "
echo $branch
FLAG=1
fi
if [ "$1" = "n" ] ; then
noreboot=1
else
noreboot=0
fi
# echo "No reboot"
# echo $noreboot
sudo rm /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/id.txt /home/pi/CubeSatSim/cw.txt > /dev/null 2>&1
#if [ "$1" = "u" ]; then
# sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get update -y
sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev python3-pip minicom gpsd gpsd-clients libgps-dev python3-gps
#fi
sudo apt-get install -y gpsd gpsd-clients libgps-dev python3-gps
# sudo apt-get install -y python3-smbus libusb-1.0
sudo sed -i 's/update.sh/update /g' /etc/motd
sudo sed -i 's/installed and/installed\nand/g' /etc/motd
sudo sed -i 's/more information/more\ninformation/g' /etc/motd
sudo sed -i 's/update to/update\nto/g' /etc/motd
sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/maxcpus=2/maxcpus=1/g' /boot/cmdline.txt # single core if Pi Zero 2
sudo sed -i 's/DEVICES=""/DEVICES="\/dev\/serial0"/g' /etc/default/gpsd
sudo sed -i 's/GPSD_OPTIONS=""/GPSD_OPTIONS="-s 9600"/g' /etc/default/gpsd
sudo systemctl disable gpsd > /dev/null 2>&1
sudo systemctl disable gpsd.socket > /dev/null 2>&1
cd /home/pi/CubeSatSim
git pull --no-rebase > .updated
if [ $checkout -eq 1 ]; then
git checkout $branch
git pull --no-rebase > .updated
FLAG=1
echo "Running update script again"
/home/pi/CubeSatSim/update
fi
make debug
FILE=/home/pi/CubeSatSim/command_tx
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo "True\n" > /home/pi/CubeSatSim/command_tx
fi
FILE=/home/pi/CubeSatSim/command_count.txt
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo "0\n" > /home/pi/CubeSatSim/command_count.txt
fi
if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then
echo "changed cubesatsim.service."
sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service
FLAG=1
else
echo "no changes to cubesatsim.service."
fi
FILE=/etc/systemd/system/rpitx.service
if [ -f "$FILE" ]; then
sudo systemctl disable rpitx
sudo rm /etc/systemd/system/rpitx.service
fi
FILE=/etc/systemd/system/transmit.service
if [ -f "$FILE" ]; then
if [[ $(diff systemd/transmit.service /etc/systemd/system/transmit.service) ]]; then
echo "changed transmit.service."
sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service
FLAG=1
else
echo "no change to transmit.service."
fi
else
echo "creating transmit.service."
sudo cp /home/pi/CubeSatSim/systemd/transmit.service /etc/systemd/system/transmit.service
FLAG=1
fi
FILE=/etc/systemd/system/command.service
if [ -f "$FILE" ]; then
if [[ $(diff systemd/command.service /etc/systemd/system/command.service) ]]; then
echo "changed command.service."
sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service
FLAG=1
else
echo "no change to command.service."
fi
else
echo "creating command.service."
sudo cp /home/pi/CubeSatSim/systemd/command.service /etc/systemd/system/command.service
sudo systemctl enable command
FLAG=1
fi
FILE=/etc/asound.conf
if [ -f "$FILE" ]; then
if [[ $(diff /home/pi/CubeSatSim/asound.conf /etc/asound.conf) ]]; then
echo "changed /etc/asound.conf."
sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf
FLAG=1
else
echo "no change to /etc/asound.conf."
fi
else
echo "creating /etc/asound.conf."
sudo cp /home/pi/CubeSatSim/asound.conf /etc/asound.conf
FLAG=1
fi
FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg
if [ ! -f "$FILE" ]; then
echo "Copying SSTV image 1."
cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg
fi
FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg
if [ ! -f "$FILE" ]; then
echo "Copying SSTV image 2."
cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg
fi
grep 'update' /home/pi/CubeSatSim/.updated
if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then
echo "update script updated, running again"
/home/pi/CubeSatSim/update
fi
if [ ! -d "/home/pi/PiSSTVpp" ]; then
# sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get update -y
sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev
cd
git clone https://github.com/alanbjohnston/PiSSTVpp.git
cd PiSSTVpp
make pisstvpp
cd
sudo raspi-config nonint do_camera 0
fi
if [ ! -d "/home/pi/rpitx" ]; then
cd
git clone https://github.com/alanbjohnston/rpitx.git
cd rpitx
./install.sh
cd
else
if [[ $(grep 'SYNCWITHPWM' /home/pi/rpitx/src/librpitx/src/fskburst.h) ]]; then
echo "rpitx library already updated"
else
echo "updating rpitx"
cd /home/pi/rpitx
git pull
./update.sh
cd
fi
fi
if [ ! -d "/home/pi/WiringPi" ]; then
cd
git clone https://github.com/alanbjohnston/WiringPi
cd WiringPi
./build debian
sudo dpkg -i debian-template/wiringpi-2.61-1.deb
cd
cd CubeSatSim
make debug
FLAG=1
cd
fi
if [ ! -d "/home/pi/ssdv" ]; then
echo "Installing SSDV for FUNcube mode"
cd
git clone https://github.com/alanbjohnston/ssdv.git # install ssdv for FUNcube images
cd ssdv
make
cd
FLAG=1
fi
if [ ! -d "/home/pi/fctelem" ]; then
echo "Installing fctelem binary v0.2 for FUNcube mode"
cd
mkdir /home/pi/fctelem
mkdir /home/pi/fctelem/public_html
cd fctelem
wget https://github.com/alanbjohnston/go/releases/download/v0.2/fctelem.zip
unzip -u fctelem.zip
FLAG=1
elif [ ! -f "/home/pi/fctelem/v0.2" ]; then
echo "Updating fctelem binary to version v0.2 for FUNcube mode"
cd
cd /home/pi/fctelem
sudo mv fctelem fctelem.bk
sudo mv fcdecode.conf fcdecode.conf.bk
sudo mv fctelem.zip fctelem.zip.1
wget https://github.com/alanbjohnston/go/releases/download/v0.2/fctelem.zip
unzip -u fctelem.zip
FLAG=1
fi
if [ ! -f "/home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/mpu6050" ]; then
echo "Installing MPU6050-C-CPP-Library-for-Raspberry-Pi"
sudo apt-get install -y libi2c-dev
cd
git clone https://github.com/alanbjohnston/MPU6050-C-CPP-Library-for-Raspberry-Pi.git
cd MPU6050-C-CPP-Library-for-Raspberry-Pi
sudo make install
make payload
fi
cd /home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi
git checkout master
git pull --no-rebase > .updated_p
if [[ $(grep 'changed' /home/pi/MPU6050-C-CPP-Library-for-Raspberry-Pi/.updated_p) ]]; then
echo "updating MPU6050-C-CPP-Library-for-Raspberry-Pi"
sudo make install
make payload
else
echo "nothing to do for MPU6050-C-CPP-Library-for-Raspberry-Pi."
fi
if [ ! -f "/home/pi/raspberry-pi-bme280/bme280" ]; then
echo "Installing raspberry-pi-bme280"
sudo apt-get install -y libi2c-dev
cd
git clone https://github.com/alanbjohnston/raspberry-pi-bme280.git
cd raspberry-pi-bme280
git checkout payload
make
fi
cd /home/pi/raspberry-pi-bme280
git checkout payload
git pull --no-rebase > .updated_p
if [[ $(grep 'changed' /home/pi/raspberry-pi-bme280/.updated_p) ]]; then
echo "updating raspberry-pi-bme280"
make
else
echo "nothing to do for raspberry-pi-bme280."
fi
if [ ! -f "/home/pi/fcdctl/fcdctl" ]; then
echo "Installing fcdctl to set FUNcubeDongle Pro gain"
sudo rm /var/lib/dpkg/info/python3-pip.list
sudo apt install python3-pip --reinstall
sudo apt-get install -y python3-smbus libusb-1.0
cd
git clone https://github.com/csete/fcdctl.git
cd fcdctl
make fcdpp
fi
cd /home/pi/pi-power-button
git pull --no-rebase > .updated_p
git checkout master
# grep 'changed' /home/pi/pi-power-button/.updated_p
# if [[ $(grep 'changed' /home/pi/pi-power-button/.updated_p) ]]; then
echo "updating pi-power-button."
script/install
FLAG=1
# else
# echo "nothing to do for pi-power-button."
# fi
cd /home/pi/ssdv
git checkout master
git pull --no-rebase > .updated_p
grep 'changed' /home/pi/ssdv/.updated_p
if [[ $(grep 'changed' /home/pi/ssdv/.updated_p) ]]; then
echo "updating ssdv."
# git checkout master
script/install
FLAG=1
else
echo "nothing to do for ssdv."
fi
if [[ $(grep 'dtparam=audio=on' /boot/config.txt) ]]; then
echo "dtparam=audio=on already in /boot/config.txt"
else
echo "adding dtparam=audio=on to /boot/config.txt"
sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/config.txt'
FLAG=1
fi
if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/config.txt) ]]; then
echo "dtoverlay=audremap,enable_jack=on already in /boot/config.txt"
else
echo "adding dtoverlay=audremap,enable_jack=on to /boot/config.txt"
sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/config.txt'
FLAG=1
fi
if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/config.txt) ]]; then
echo "dtoverlay=pwm,pin=18,func=2 already in /boot/config.txt"
else
echo "adding dtoverlay=pwm,pin=18,func=2 to /boot/config.txt"
sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/config.txt'
FLAG=1
# cd /home/pi/pi-power-button
# git pull --no-rebase
# git checkout reboot-mode-change
# script/install
## sudo apt-get update && sudo apt-get dist-upgrade -y
# sudo apt-get update -y
# sudo apt-get install -y libjpeg-dev zlib1g-dev libfreetype6-dev liblcms1-dev libopenjp2-7 libtiff5 python3-pil
# sudo pip3 install -y adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 pillow
fi
if [[ $(grep 'disable_splash=1' /boot/config.txt) ]]; then
echo "disable_splash=1 already in /boot/config.txt"
else
echo "adding to /boot/config.txt"
sudo sh -c 'echo "\ndisable_splash=1" >> /boot/config.txt'
FLAG=1
fi
if [[ $(grep 'boot_delay=0' /boot/config.txt) ]]; then
echo "boot_delay=0 already in /boot/config.txt"
else
echo "adding to /boot/config.txt"
sudo sh -c 'echo "\nboot_delay=0" >> /boot/config.txt'
FLAG=1
fi
if ! grep -q force_turbo=1 /boot/config.txt ; then
sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'
FLAG=1
fi
#if [ ! -f "/home/pi/CubeSatSim/telem_string.txt" ]; then
# sudo apt-get update && sudo apt-get dist-upgrade -y
# sudo apt-get install -y libjpeg-dev zlib1g-dev libfreetype6-dev liblcms1-dev libopenjp2-7 libtiff5 -y
# sudo pip3 install pillow
#fi
changed=0
value=`cat /home/pi/CubeSatSim/sim.cfg`
# echo "$value"
echo "$value" > /dev/null
set -- $value
if [ -z "$1" ] ; then n1="AMSAT" ; changed=1 ; else n1=$1 ; fi # callsign
if [ -z "$2" ] ; then n2="0" ; changed=1 ; else n2=$2 ; fi # reset count
if [ -z "$3" ] ; then n3="0" ; changed=1 ; else n3=$3 ; fi # lat
if [ -z "$4" ] ; then n4="0" ; changed=1 ; else n4=$4 ; fi # lon
if [ -z "$5" ] ; then n5="no" ; changed=1 ; else n5=$5 ; fi # sim mode
if [ -z "$6" ] ; then n6="3" ; changed=1 ; else n6=$6 ; fi # squelch
if [ -z "$7" ] ; then n7="434.9000" ; changed=1 ; else n7=$7 ; fi # transmit frequency
if [ -z "$8" ] ; then n8="435.0000" ; changed=1 ; else n8=$8 ; fi # receive frequency
if [ -z "$9" ] ; then n9="no" ; changed=1 ; else n9=$9 ; fi # hab mode
if [ -z "${10}" ] ; then m1="0" ; changed=1 ; else m1=${10} ; fi # rx pl code
if [ -z "${11}" ] ; then m2="0" ; changed=1 ; else m2=${11} ; fi # tx pl code
if [ $changed -eq 1 ]; then
echo -e "Current sim.cfg configuration file:"
echo
echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11}
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
echo
echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2
echo $n1 $n2 $n3 $n4 $n5 $n6 $n7 $n8 $n9 $m1 $m2 > /home/pi/CubeSatSim/sim.cfg
echo
fi
if [ "$noreboot" = "0" ] ; then
if [ $FLAG -eq 1 ]; then
echo "systemctl daemon-reload and reboot"
sudo systemctl daemon-reload
sudo reboot -h now
# sudo cubesatsim
else
grep 'changed' /home/pi/CubeSatSim/.updated
if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then
echo "reboot due to code changes " | wall
sudo reboot -h now
# sudo cubesatsim
else
echo "nothing to do."
fi
fi
else
if [ $FLAG -eq 1 ]; then
echo "reboot needed for changes to take effect" | wall
fi
fi
echo "CubeSatSim update complete."

@ -0,0 +1 @@
install

@ -0,0 +1,3 @@
#!/bin/bash
. /home/pi/venv/bin/activate
Loading…
Cancel
Save

Powered by TurnKey Linux.