You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CubeSatSim/install

136 lines
2.3 KiB

#!/bin/bash
echo -e "\ninstallation script for CubeSatSim v1.2\n"
FILE=/home/pi/CubeSatSim/sim.cfg
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo "AMSAT 1 0.0 0.0" > /home/pi/CubeSatSim/sim.cfg
fi
cd
CubeSatSim/config -c -n
CubeSatSim/config -l -n
sudo apt-get update && sudo apt-get dist-upgrade -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
cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
cd
#changed to python3-smbus
sudo apt install -y python3-pip python3-smbus
sudo pip3 install --upgrade setuptools
sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219
cd ~/CubeSatSim
git pull
make debug
FILE=/home/pi/CubeSatSim/.mode
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo "ARG1=s" > .mode
fi
cd
git clone https://github.com/alanbjohnston/direwolf.git
cd direwolf
make -j
sudo make install
make install-rpi
cd
git clone https://github.com/alanbjohnston/pi-power-button.git
cd pi-power-button
git checkout master
./script/install
cd
git clone https://github.com/alanbjohnston/PiSSTVpp.git
cd PiSSTVpp
make pisstvpp
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
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
cd
sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service
sudo systemctl enable cubesatsim
sudo cp ~/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service
sudo systemctl enable rpitx
sudo cp /boot/config.txt /boot/config.txt.0
sudo cp /boot/cmdline.txt /boot/cmdline.txt.0
sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_camera 0
sudo raspi-config nonint do_legacy 0
#if [ "$1" = "u" ]; then
#fi
## sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt
echo "Would you like to reboot to complete the installation (y/n)?"
read -r ANS
if [ "$ANS" = "y" ]; then
sudo reboot now
else
echo "The CubeSatSim software will start next time you reboot"
fi

Powered by TurnKey Linux.