diff --git a/README.md b/README.md index 1c9396df..d319e9c4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ There are two ways to get the CubeSatSim software for your Pi. One option is to download the disk image file and write it to a 16GB micro SD card or larger. The image is based on Raspberry Pi OS (Rasbian) Lite, dated December 2020. All software is installed, you just need to login to change your password and set your amateur radio callsign if you have one. You can run the ./update.sh script to update all packages and update and compile the latest CubeSatSim software. -The other option is to start with a Buster Raspberry Pi OS (Rasbian) image and run the installation script ./install.sh which will install and compile all the related software. Note that the installation script does not yet work with Bullseye. This includes the following packages: +The other option is to start with a Raspberry Pi OS (Rasbian) image (Bullseye or Buster works) and run the installation script ./install.sh which will install and compile all the related software. This includes the following packages: - wiringpi - git - libasound2-dev @@ -18,7 +18,7 @@ The other option is to start with a Buster Raspberry Pi OS (Rasbian) image and r - Direwolf - rpitx - python3-pip -- python-smbus +- python3-smbus ## Disk Image Option Steps @@ -26,7 +26,7 @@ See the Wiki Software Install page for details: https://github.com/alanbjohnston ## Installation Script Option Steps -CubeSatSim runs on the Buster version of Raspberry Pi OS (Desktop or Lite), although a Pi Zero or Pi Zero W should only run Lite. Your Pi will need to have internet access to update settings and install packages. The software does NOT yet support Bullseye due to changes in the Pi Camera (thanks Raspberry Pi for the lack of backwards compatibility!!) +CubeSatSim runs on the Bullseye or Buster version of Raspberry Pi OS (Desktop or Lite), although a Pi Zero or Pi Zero W should only run Lite. Your Pi will need to have internet access to update settings and install packages. To get the software follow these steps: diff --git a/config b/config index 765e2620..d34d1e4c 100755 --- a/config +++ b/config @@ -1,6 +1,6 @@ #!/bin/bash -echo "CubeSatSim v1.0 configuration tool" +echo "CubeSatSim v1.1 configuration tool" if [ "$2" = "-n" ]; then norestart=1 diff --git a/install b/install index 0bfea58f..54e3e858 100755 --- a/install +++ b/install @@ -1,10 +1,25 @@ #!/bin/bash -echo -e "\ninstallation script for CubeSatSim v1.0\n" +echo -e "\ninstallation script for CubeSatSim v1.1\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 -sudo apt-get install -y wiringpi git libasound2-dev i2c-tools python-picamera python3-picamera build-essential libgd-dev libmagic-dev +# 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 @@ -15,7 +30,8 @@ sudo dpkg -i wiringpi-latest.deb cd -sudo apt install -y python3-pip python-smbus +#changed to python3-smbus +sudo apt install -y python3-pip python3-smbus sudo pip3 install --upgrade setuptools @@ -37,16 +53,6 @@ else echo "ARG1=f" > .mode fi - -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 git clone https://github.com/alanbjohnston/direwolf.git @@ -66,6 +72,8 @@ git clone https://github.com/alanbjohnston/pi-power-button.git cd pi-power-button +git checkout master + ./script/install @@ -112,6 +120,7 @@ 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 @@ -155,10 +164,6 @@ sudo raspi-config nonint do_camera 0 sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt fi -CubeSatSim/config -c -n - -CubeSatSim/config -l -n - echo "Would you like to reboot to complete the installation (y/n)?" read -r ANS diff --git a/main.c b/main.c index a77b2472..cf315dd5 100644 --- a/main.c +++ b/main.c @@ -23,6 +23,8 @@ int main(int argc, char * argv[]) { + printf("\n\nCubeSatSim v1.1 starting...\n\n"); + FILE * rpitx_stop = popen("sudo systemctl stop rpitx", "r"); pclose(rpitx_stop); diff --git a/rpitx.py b/rpitx.py index ae5c2728..08f929a1 100644 --- a/rpitx.py +++ b/rpitx.py @@ -9,6 +9,8 @@ from time import sleep import sys from os import system +print("CubeSatSim v1.1 rpitx.py starting...") + GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP) @@ -41,7 +43,15 @@ else: txLedOn = 1 txLedOff = 0 +# GPIO.setup(txLed, GPIO.OUT) +# output(txLed, txLedOff) + +GPIO.setmode(GPIO.BCM) # Repeat to make LED work on Pi 4 +GPIO.setwarnings(False) GPIO.setup(txLed, GPIO.OUT) + +output(txLed, txLedOn) +sleep(1) output(txLed, txLedOff) # print(txLedOn) @@ -78,7 +88,9 @@ if __name__ == "__main__": if (debug_mode == 1): print("Can't read callsign from sim.cfg file, defaulting to AMSAT") print(callsign) - + GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 + GPIO.setup(txLed, GPIO.OUT) + sleep(1) output(txLed, txLedOn) if (debug_mode == 1): @@ -161,12 +173,15 @@ if __name__ == "__main__": elif (mode == 's'): print("SSTV") try: - from picamera import PiCamera +# from picamera import PiCamera # from pysstv.sstv import SSTV - camera = PiCamera() +# camera = PiCamera() + print("Testing for camera") + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") + f = open("/home/pi/CubeSatSim/camera_out.jpg") print("Camera present") camera_present = 1 - camera.close() +# camera.close() except: print("No camera available") print(" -> if camera plugged in, is software enabled?") diff --git a/telem.c b/telem.c index a2d0182f..eff6ba50 100644 --- a/telem.c +++ b/telem.c @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) { if (digitalRead(26) != HIGH) { // if (debug == ON) - printf("CubeSatSim v1.0 INA219 Voltage and Current Telemetry\n"); + printf("CubeSatSim v1.1 INA219 Voltage and Current Telemetry\n"); map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; map[MINUS_Y] = PLUS_Z; diff --git a/update b/update index 67f5074b..b8d61613 100755 --- a/update +++ b/update @@ -1,6 +1,6 @@ #!/bin/bash -echo -e "\nupdate script for CubeSatSim v1.0\n" +echo -e "\nupdate script for CubeSatSim v1.1\n" sudo rm /home/pi/CubeSatSim/morse.wav /home/pi/CubeSatSim/id.txt /home/pi/CubeSatSim/cw.txt > /dev/null 2>&1 @@ -8,10 +8,12 @@ if [ "$1" = "u" ]; then sudo apt-get update && sudo apt-get dist-upgrade -y - sudo apt-get install -y wiringpi git libasound2-dev i2c-tools python-picamera python3-picamera build-essential libgd-dev libmagic-dev + sudo apt-get install -y wiringpi git libasound2-dev i2c-tools build-essential libgd-dev libmagic-dev python3-pip minicom fi +sudo apt-get install -y python3-smbus + sudo sed -i 's/update.sh/update /g' /etc/motd sudo sed -i 's/installed and/installed\nand/g' /etc/motd