Compare commits

..

No commits in common. '0ec6f2520b4ed76a43e88e5024adaf0ad80c88dc' and 'd378dec4486a1395b5f8c4cd18ce56cacdaec5d5' have entirely different histories.

@ -1188,25 +1188,24 @@ elif [ "$1" = "-F" ]; then
rx="$8"
echo "Keeping value of" $rx
fi
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13}
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg
echo
echo "Restarting CubeSatSim with new configuration file"
# else
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then
sudo systemctl restart transmit
else
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13}
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg
# fi
# if [ "$norestart" = "1" ]; then
# echo
# else
echo
echo "temporarily disabling gpsd and rebooting to program FM module"
echo "this will take about 40 seconds"
sudo systemctl stop gpsd.socket
echo "Restarting CubeSatSim with new configuration file"
## echo
# reboot=1
## sudo reboot now
sudo systemctl restart transmit
sleep 10
reboot=1
fi
# fi
elif [ "$1" = "-o" ]; then
@ -1772,47 +1771,7 @@ elif [ "$1" = "-U" ]; then
if [ "${12}" != "$sim" ] || [ "${13}" != "$time" ] ; then
reboot=1
fi
elif [ "$1" = "-u" ]; then
echo
echo "Change gpsd state"
echo
if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then
echo "gpsd is inactive"
echo
echo "Do you want to turn gpsd to ON (y/n) "
read reset
echo
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
echo "gpsd set to ON"
sudo systemctl enable gpsd
sudo systemctl enable gpsd.socket
echo
echo "Unless you configure gpsd otherwise, the gps is connected to serial0 on the Pi."
echo "To monitor your gps device, use the command gpsmon"
echo
reboot=1
fi
else
echo "gpsd is active"
echo
echo "Do you want to turn gpsd to OFF (y/n) "
read reset
echo
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
echo "gpsd set to OFF"
sudo systemctl disable gpsd
sudo systemctl disable gpsd.socket
reboot=1
fi
fi
elif [ "$1" = "-h" ]; then
echo "config OPTION"

@ -48,7 +48,7 @@ sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get remove pulseaudio -y
# removed wiringpi and python-picamera python3-picamera
sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev minicom gpsd gpsd-clients libgps-dev python3-gps
sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev minicom
cd /tmp
@ -270,8 +270,6 @@ sudo raspi-config nonint do_legacy 0
sudo sh -c 'echo "\n" >> /boot/config.txt'
sudo sed -i 's/DEVICES=""/DEVICES="\/dev\/serial0"/g' /etc/default/gpsd
changed=0
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null

@ -11,7 +11,6 @@ from os import system
from PIL import Image, ImageDraw, ImageFont, ImageColor
import serial
import random
import subprocess
def sim_failure_check():
try:
@ -396,20 +395,7 @@ if __name__ == "__main__":
card = "Headphones" # default using pcm audio output of Pi Zero
# card = "Device" # using USB sound card for audio output
query = ["sudo", "systemctl", "is-active", "gpsd.socket"]
try:
result = subprocess.run(query, capture_output=True, text=True, check=True)
print(f"Command run was: {query}")
gpsd_status = result.stdout.strip()
print(f"Output of the command (stdout): {gpsd_status}")
except subprocess.CalledProcessError as e:
# print(f"Command failed with return code: {e.returncode}")
print(f"Command run was: {e.cmd}")
gpsd_status = e.stdout.strip()
print(f"Output of the command (stdout): {e.stdout}")
# print(f"Error output of the command (stderr): {e.stderr}")
if (mode != 'e') and (gpsd_status != "active"):
if (mode != 'e'):
print("Programming FM module!\n");
output(pd, 1)
output (ptt, 1)

@ -31,12 +31,10 @@ 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
sudo apt-get install -y git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev python3-pip minicom gpsd gpsd-clients libgps-dev
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
@ -51,10 +49,7 @@ sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=1 r/g' /boot/cmdline.txt # si
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 systemctl disable gpsd > /dev/null 2>&1
sudo systemctl disable gpsd.socket > /dev/null 2>&1
sudo sed -i 's/DEVICES=""/DEVICES="/dev/serial0"/g' /etc/default/gpsd
cd /home/pi/CubeSatSim

Loading…
Cancel
Save

Powered by TurnKey Linux.