From 8c6b0d841d7c221d60d430cd5aff75ff801e63ee Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 09:50:36 -0400 Subject: [PATCH 01/32] added changes to remove delays on first four frames for BPSK --- afsk/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 20a928ad..1f51f9de 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -122,7 +122,7 @@ char call[5]; int bitRate, mode, bufLen, rsFrames, payloads, rsFrameLen, dataLen, headerLen, syncBits, syncWord, parityLen, samples, frameCnt, samplePeriod; float sleepTime; -int sampleTime = 0; +int sampleTime = 0, frames_sent = 0; int cw_id = ON; int vB4 = FALSE, vB5 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; float batteryThreshold = 0; @@ -534,7 +534,7 @@ printf("After command\n"); while (loop-- != 0) { - + frames_sent++; float batteryVoltage = read_sensor_data(sensor[BAT]).voltage; #ifdef DEBUG_LOGGING fprintf(stderr,"INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold); @@ -1379,7 +1379,11 @@ if (firstTime != ON) fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } // digitalWrite (0, HIGH); - firstTime = 0; + + if (mode == FSK) + firstTime = 0; + else if (frames_sent > 5) + firstTime = 0; return 0; } From 249464f5134e472d941be9cfdaca68a3b257b741 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 09:57:07 -0400 Subject: [PATCH 02/32] added 2>&1 to rpitx --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 1f51f9de..3a700103 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1292,7 +1292,7 @@ if (firstTime != ON) { if (mode == FSK) { // txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.896e3&", "r"); - txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done &", "r"); + txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3 2>&1; done &", "r"); pclose(txResult); // printf("4\n"); } else if (mode == BPSK) { From 4b644b0230776c20007ea785fb163bd091ba349d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 10:07:11 -0400 Subject: [PATCH 03/32] removed &2>1 --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 3a700103..1f51f9de 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1292,7 +1292,7 @@ if (firstTime != ON) { if (mode == FSK) { // txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.896e3&", "r"); - txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3 2>&1; done &", "r"); + txResult = popen("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done &", "r"); pclose(txResult); // printf("4\n"); } else if (mode == BPSK) { From 1a955cd09227a61a9bd02cd8b863c2895b1f7a47 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 15 Jul 2020 16:29:10 -0400 Subject: [PATCH 04/32] changed to file2 for SPI check --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 1f51f9de..086a8e43 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -308,9 +308,9 @@ int main(int argc, char *argv[]) { printf("SPI is enabled!\n"); FILE *file2 = popen("ls /dev/spidev0.* 2>&1", "r"); -// printf("Result: %d char: %c \n",file, getc(file)); +// printf("Result getc: %c \n", getc(file2)); - if (fgetc(file) != 'l') + if (fgetc(file2) != 'l') { printf("SPI devices present!\n"); // } From c087825dc925920bd9b261b80fad09f8377ff3b1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 15 Jul 2020 17:31:14 -0400 Subject: [PATCH 05/32] initial add of systemd for rpitx and sh --- rpitx.sh | 14 ++++++++++++++ systemd/rpitx.service | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 rpitx.sh create mode 100644 systemd/rpitx.service diff --git a/rpitx.sh b/rpitx.sh new file mode 100755 index 00000000..2f39a135 --- /dev/null +++ b/rpitx.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" + + if [ "$1" = "a" ]; then + echo "Mode is continuous AFSK" + sleep infinity + elif [ "$1" = "b" ]; then + echo "Tx is continuous BPSK" + sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done + else + echo "Tx is continuous FSK" + sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float 2>&1; done + fi diff --git a/systemd/rpitx.service b/systemd/rpitx.service new file mode 100644 index 00000000..c58b7bd1 --- /dev/null +++ b/systemd/rpitx.service @@ -0,0 +1,15 @@ +[Unit] +Description=CubeSatSim rpitx service + +[Service] +TimeoutStopSec=5 +EnvironmentFile=/home/pi/CubeSatSim/.mode +ExecStart=/home/pi/CubeSatSim/rpitx.sh $ARG1 +WorkingDirectory=/home/pi/CubeSatSim +StandardOutput=inherit +StandardError=inherit +Restart=always +User=root + +[Install] +WantedBy=default.target From 048cd2a6a3b97d46465a04bafc3c988961078bf5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 15 Jul 2020 20:11:48 -0400 Subject: [PATCH 06/32] started removing rpitx --- afsk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 086a8e43..85de018e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1261,7 +1261,7 @@ if (firstTime != ON) // printf("\n"); // rpitx - +/* char cmdbuffer[1000]; FILE* txResult; if ((rpitxStatus != mode)) // || ((loop % 1000) == 0)) @@ -1287,7 +1287,7 @@ if (firstTime != ON) // printf("3\n"); sleep(1); // digitalWrite (txLed, txLedOff); - + if (transmit) { if (mode == FSK) { @@ -1310,6 +1310,7 @@ if (firstTime != ON) sleep(2); // printf("Results of transmit command: %s\n", cmdbuffer); } +*/ // socket write From d8f37caab6ceccf5831914fd8b0a30a34acbc6d7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 23:07:19 -0400 Subject: [PATCH 07/32] removed rest of rpitx except for AFSK --- afsk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 85de018e..fe6c59f9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -504,7 +504,7 @@ else } // Send ID in CW (Morse Code) - +cw_id = OFF; if (cw_id == ON) // Don't send CW if using AX5043 or in mode cycling or set by 3rd argument { char cw_str[200]; @@ -621,6 +621,7 @@ while (loop-- != 0) sleep(loop_count); printf("Done sleeping\n"); } +/* // int transmit = popen("timeout 1 sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3","r"); int txResult = popen("sudo killall -9 rpitx > /dev/null 2>&1", "r"); pclose(txResult); @@ -631,7 +632,7 @@ while (loop-- != 0) if(cw_id == ON) // only turn off Power LED if CW ID is enabled (i.e. not demo.sh mode cycling) digitalWrite (onLed, onLedOff); - +*/ return 0; } From e3d2acca34193db1ba32966a758ccbb02590942f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 23:10:44 -0400 Subject: [PATCH 08/32] added restarting rpitx.service --- demo.sh | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/demo.sh b/demo.sh index 6a3222ee..6780d8e5 100755 --- a/demo.sh +++ b/demo.sh @@ -2,35 +2,19 @@ echo -e "\nDemo of CubeSatSim at 434.9 MHz\n" -#exit +sudo systemctl stop rpitx +sudo systemctl start rpitx -y=$(last reboot | grep ^reboot | wc -l) -echo $y - -#if (( $y % 2 == 0 )) -#then echo -e "\n Continuous Mode\n\n" # /home/pi/CubeSatSim/radioafsk f if [ "$1" = "a" ]; then echo "Mode is continuous AFSK" - sleep 1 - sudo killall -9 sendiq - sudo killall -9 sendiq - sleep 1 /home/pi/CubeSatSim/radioafsk afsk elif [ "$1" = "b" ]; then - echo "Mode is continuous BPSK" - sleep 1 - sudo killall -9 sendiq - sudo killall -9 sendiq - sleep 1 + echo "Mode is continuous BPSK" /home/pi/CubeSatSim/radioafsk bpsk else echo "Mode is continuous FSK" - sleep 1 - sudo killall -9 sendiq - sudo killall -9 sendiq - sleep 1 /home/pi/CubeSatSim/radioafsk fsk fi From 28b84c31ce5322435316876e9a383837b13caeb1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 23:12:12 -0400 Subject: [PATCH 09/32] removed 2>&1 from sendiq --- rpitx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.sh b/rpitx.sh index 2f39a135..df9e2c34 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -10,5 +10,5 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done else echo "Tx is continuous FSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float 2>&1; done + sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float; done fi From 952233f05f3ef65692f49dcebe3614e12650ea68 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Jul 2020 23:21:05 -0400 Subject: [PATCH 10/32] swapped BPSK and FSK --- rpitx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpitx.sh b/rpitx.sh index df9e2c34..1136a5f3 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -7,8 +7,8 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" sleep infinity elif [ "$1" = "b" ]; then echo "Tx is continuous BPSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done + sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float; done else echo "Tx is continuous FSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float; done + sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done fi From 7754d0139d7aadada6e00a8ec6d37c4c1f793117 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 16:58:56 -0400 Subject: [PATCH 11/32] removed timeout for v2beta rpitx branch --- rpitx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpitx.sh b/rpitx.sh index 1136a5f3..945de1a0 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -7,8 +7,8 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" sleep infinity elif [ "$1" = "b" ]; then echo "Tx is continuous BPSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | while true; do sudo timeout -k 1 60m /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float; done + sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float else echo "Tx is continuous FSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | while true; do sudo timeout -k 1 60m /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3; done + sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3 fi From 6b2fd33c03aeae517512e5150a688fd6fd03f9d0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 21:20:38 -0400 Subject: [PATCH 12/32] started --- rpitx.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 rpitx.py diff --git a/rpitx.py b/rpitx.py new file mode 100644 index 00000000..1cadee16 --- /dev/null +++ b/rpitx.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import RPi.GPIO as GPIO +import subprocess +import time +import os + +GPIO.setmode(GPIO.BCM) +GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP) +GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) +if GPIO.input(12) == False: + powerPin = 16 +else: + powerPin = 17 +GPIO.setwarnings(False) +GPIO.setup(powerPin, GPIO.OUT) +GPIO.output(powerPin, 1); + +while (True): + time.sleep(1) + GPIO.wait_for_edge(26, GPIO.FALLING) + + done = False; + time.sleep(1) + if GPIO.input(26): + print("sudo reboot -h now") + GPIO.setwarnings(False) + GPIO.setup(powerPin, GPIO.OUT) + GPIO.output(powerPin, 0); + subprocess.call(['reboot', '-h', 'now'], shell=False) + GPIO.output(powerPin, 0); From 46c23a4082c7bdca596089c4f2ed9845c8e1b49f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 22:57:45 -0400 Subject: [PATCH 13/32] added transmit setting, callsign read, and Tx setting --- rpitx.py | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/rpitx.py b/rpitx.py index 1cadee16..5c9a5029 100644 --- a/rpitx.py +++ b/rpitx.py @@ -6,26 +6,36 @@ import time import os GPIO.setmode(GPIO.BCM) -GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP) +GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) +transmit = False if GPIO.input(12) == False: - powerPin = 16 -else: - powerPin = 17 -GPIO.setwarnings(False) -GPIO.setup(powerPin, GPIO.OUT) -GPIO.output(powerPin, 1); + transmit = True +if GPIO.input(27) == False; + transmit = True -while (True): - time.sleep(1) - GPIO.wait_for_edge(26, GPIO.FALLING) +print(transmit) - done = False; - time.sleep(1) - if GPIO.input(26): - print("sudo reboot -h now") - GPIO.setwarnings(False) - GPIO.setup(powerPin, GPIO.OUT) - GPIO.output(powerPin, 0); - subprocess.call(['reboot', '-h', 'now'], shell=False) - GPIO.output(powerPin, 0); +file = open("/home/pi/CubeSatSim/sim.cfg") +callsign = file.readline().split(" ")[0] +print(callsign) + +if __name__ == "__main__": +# print(f"Arguments count: {len(sys.argv)}") +# for i, arg in enumerate(sys.argv): +# print(f"Argument {i:>6}: {arg}") +# + print 'Length: ', len(sys.argv) + + if (len(sys.argv)) > 1: +# print("There are arguments!") + if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): + print("AFSK") +# os.system("sleep infinity") + elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): + print("BPSK") +# os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") + else + mode = FSK + print("FSK") +# os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") From de21f15407099708d5de5b90ce6e7018e1975b88 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 22:59:25 -0400 Subject: [PATCH 14/32] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 5c9a5029..d0268743 100644 --- a/rpitx.py +++ b/rpitx.py @@ -11,7 +11,7 @@ GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) transmit = False if GPIO.input(12) == False: transmit = True -if GPIO.input(27) == False; +if GPIO.input(27) == False: transmit = True print(transmit) From 3d76c641e4d54e1ccc763b9ccc86bd19fcf67cc2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 23:00:34 -0400 Subject: [PATCH 15/32] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index d0268743..7dae4a13 100644 --- a/rpitx.py +++ b/rpitx.py @@ -35,7 +35,7 @@ if __name__ == "__main__": elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") # os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") - else + else: mode = FSK print("FSK") # os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") From e0bb481323955607e42565c71016966381c8a262 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 23:01:29 -0400 Subject: [PATCH 16/32] Update rpitx.py --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index 7dae4a13..5a3353ae 100644 --- a/rpitx.py +++ b/rpitx.py @@ -4,6 +4,7 @@ import RPi.GPIO as GPIO import subprocess import time import os +import sys GPIO.setmode(GPIO.BCM) GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) From 037deeb086c29f5edc44f97c4de62f98cf214284 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 16 Jul 2020 23:02:14 -0400 Subject: [PATCH 17/32] Update rpitx.py --- rpitx.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 5a3353ae..32470eb8 100644 --- a/rpitx.py +++ b/rpitx.py @@ -37,6 +37,5 @@ if __name__ == "__main__": print("BPSK") # os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") else: - mode = FSK print("FSK") # os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") From dc557dba98b9d0b2e12820a99db01f5f3dff91cf Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 17 Jul 2020 08:59:22 -0400 Subject: [PATCH 18/32] added cw id and rpitx calls --- rpitx.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 32470eb8..d1757921 100644 --- a/rpitx.py +++ b/rpitx.py @@ -21,6 +21,10 @@ file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0] print(callsign) +os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") + +time.sleep(2) + if __name__ == "__main__": # print(f"Arguments count: {len(sys.argv)}") # for i, arg in enumerate(sys.argv): @@ -32,10 +36,14 @@ if __name__ == "__main__": # print("There are arguments!") if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") -# os.system("sleep infinity") + while True: + time.sleep(5) elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") -# os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") else: print("FSK") -# os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") + else: + print("FSK") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") From 2d23de7c25ecfc6104f8f1cdb666df2967ee79ff Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 17 Jul 2020 09:25:14 -0400 Subject: [PATCH 19/32] add rptix.py call --- rpitx.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpitx.sh b/rpitx.sh index 945de1a0..6e376253 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -2,6 +2,8 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" +python rpitx.py $1 + if [ "$1" = "a" ]; then echo "Mode is continuous AFSK" sleep infinity From 63e0161321ed4303da62308d264255214b8758ef Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 18 Jul 2020 15:04:59 -0400 Subject: [PATCH 20/32] removed cw id transmit since in rpitx now --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index fe6c59f9..105bd795 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -495,7 +495,7 @@ else //uint8_t data[1024]; tx_freq_hz -= tx_channel * 50000; - +/* if (transmit == FALSE) { @@ -531,7 +531,7 @@ printf("After command\n"); //printf("After Write\n"); } //printf("Done CW!\n"); - +*/ while (loop-- != 0) { frames_sent++; From 379843640ffc178fe2c8d269172eb52167fbac25 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 18 Jul 2020 15:18:07 -0400 Subject: [PATCH 21/32] swapped HIGH and LOW for txLed On/Off for vB5 --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 105bd795..03772caa 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -385,8 +385,8 @@ int main(int argc, char *argv[]) { { printf("vB5 Present\n"); txLed = 2; - txLedOn = HIGH; - txLedOff = LOW; + txLedOn = LOW; //HIGH; + txLedOff = HIGH; //LOW; vB5 = TRUE; onLed = 27; onLedOn = HIGH; From 9cac292894bc36d5ef74f44decf29b0ada3b8875 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 17:25:49 -0400 Subject: [PATCH 22/32] reset Hi and LOW for Tx LED --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 03772caa..105bd795 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -385,8 +385,8 @@ int main(int argc, char *argv[]) { { printf("vB5 Present\n"); txLed = 2; - txLedOn = LOW; //HIGH; - txLedOff = HIGH; //LOW; + txLedOn = HIGH; + txLedOff = LOW; vB5 = TRUE; onLed = 27; onLedOn = HIGH; From f59751e35bf14b6650a0ffd07c2ee13e6615925d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 20 Jul 2020 18:11:52 -0400 Subject: [PATCH 23/32] added Tx LED Logging - occational 8 sec BPSK --- afsk/main.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ rpitx.sh | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 105bd795..f54d30dc 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -399,8 +399,14 @@ int main(int argc, char *argv[]) { } pinMode (txLed, OUTPUT); digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif pinMode (onLed, OUTPUT); digitalWrite (onLed, onLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif // if ((cycle == ON) && !ax5043) // don't cycle modes if using AX5043 // mode = (reset_count) % 3; // alternate between the three modes @@ -518,6 +524,9 @@ if (cw_id == ON) // Don't send CW if using AX5043 or in mode cycling or set by 3 strcat(cw_str, cw_footer); //printf("Before 1st strcpy\n"); digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif printf("Before cmd\n"); //printf("CW String: %s\n", cw_str); // FILE* f; @@ -528,6 +537,9 @@ printf("After command\n"); // sleep(7); //printf("Before Write\n"); digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif //printf("After Write\n"); } //printf("Done CW!\n"); @@ -610,10 +622,16 @@ while (loop-- != 0) if (mode == BPSK) { digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif printf("Sleeping to allow BPSK transmission to finish.\n"); sleep(loop_count * 5); printf("Done sleeping\n"); digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif } else if (mode == FSK) { @@ -632,6 +650,9 @@ while (loop-- != 0) if(cw_id == ON) // only turn off Power LED if CW ID is enabled (i.e. not demo.sh mode cycling) digitalWrite (onLed, onLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif */ return 0; } @@ -682,6 +703,9 @@ int get_tlm(void) { for (int j = 0; j < frameCnt; j++) { digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif int tlm[7][5]; memset(tlm, 0, sizeof tlm); @@ -802,6 +826,9 @@ for (int j = 0; j < frameCnt; j++) strcat(cw_str2, cw_footer2); //printf("Before 1st strcpy\n"); digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif printf("Before cmd\n"); printf("CW telem String: %s\n", cw_str2); // FILE* f; @@ -813,6 +840,9 @@ printf("After command\n"); // sleep(7); //printf("Before Write\n"); digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif //printf("After Write\n"); //} //printf("Done CW!\n"); @@ -820,6 +850,9 @@ printf("After command\n"); if (ax5043) { digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif fprintf(stderr,"INFO: Transmitting X.25 packet\n"); memcpy(data, str, strnlen(str, 256)); int ret = ax25_tx_frame(&hax25, &hax5043, data, strnlen(str, 256)); @@ -831,6 +864,9 @@ printf("After command\n"); } ax5043_wait_for_transmit(); digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif if (ret) { fprintf(stderr, @@ -857,8 +893,14 @@ printf("After command\n"); fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n"); } digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif sleep(3); digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif } //digitalWrite (txLed, txLedOff); @@ -868,6 +910,9 @@ printf("After command\n"); printf("End of get_tlm and rpitx =========================================================\n"); digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif return; } @@ -943,11 +988,17 @@ if (firstTime != ON) { // delay for sample period digitalWrite (txLed, txLedOn); + #ifdef DEBUG_LOGGING + printf("Tx LED On\n"); + #endif while ((millis() - sampleTime) < samplePeriod) sleep(sleepTime); digitalWrite (txLed, txLedOff); + #ifdef DEBUG_LOGGING + printf("Tx LED Off\n"); + #endif printf("Sample period: %d\n",millis() - sampleTime); sampleTime = millis(); diff --git a/rpitx.sh b/rpitx.sh index 6e376253..44aa3f45 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -2,7 +2,7 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" -python rpitx.py $1 +#python rpitx.py $1 if [ "$1" = "a" ]; then echo "Mode is continuous AFSK" From 902177cdf0ee90aaaef0c707fd9b862a9b8d424d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 20 Jul 2020 18:41:49 -0400 Subject: [PATCH 24/32] removed BPSK 4 frame no delay --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index f54d30dc..35e2ae39 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1435,7 +1435,7 @@ if (firstTime != ON) if (mode == FSK) firstTime = 0; - else if (frames_sent > 5) + else if (frames_sent > 0) //5) firstTime = 0; return 0; From 56eb9aafa4e02577cf2a57c94656444c7a8b7fdd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 20:47:31 -0400 Subject: [PATCH 25/32] cleaned up frequency and added GPIO.setwarnings(False) --- rpitx.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rpitx.py b/rpitx.py index d1757921..bbfecbc4 100644 --- a/rpitx.py +++ b/rpitx.py @@ -7,6 +7,7 @@ import os import sys GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) transmit = False @@ -21,15 +22,11 @@ file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0] print(callsign) -os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") +os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") time.sleep(2) if __name__ == "__main__": -# print(f"Arguments count: {len(sys.argv)}") -# for i, arg in enumerate(sys.argv): -# print(f"Argument {i:>6}: {arg}") -# print 'Length: ', len(sys.argv) if (len(sys.argv)) > 1: @@ -40,10 +37,10 @@ if __name__ == "__main__": time.sleep(5) elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float") else: print("FSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: print("FSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3") + os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") From 68f73b53c5b5557c694ec02af6212fc3a4a41e30 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 20:48:26 -0400 Subject: [PATCH 26/32] made rpitx.py python only --- rpitx.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/rpitx.sh b/rpitx.sh index 44aa3f45..edd07085 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -1,16 +1,5 @@ #!/bin/bash -echo -e "\nrpitx for CubeSatSim at 434.9 MHz\n" +echo -e "\nrpitx for CubeSatSim at 434.9 MHz using python\n" -#python rpitx.py $1 - - if [ "$1" = "a" ]; then - echo "Mode is continuous AFSK" - sleep infinity - elif [ "$1" = "b" ]; then - echo "Tx is continuous BPSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.8945e6 -t float - else - echo "Tx is continuous FSK" - sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.897e3 - fi +python rpitx.py $1 From 33c3ac8fd312bd28226db169c958d3478139e035 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 20:52:51 -0400 Subject: [PATCH 27/32] cleaned up with restart --- demo.sh | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/demo.sh b/demo.sh index 6780d8e5..7a29a981 100755 --- a/demo.sh +++ b/demo.sh @@ -2,19 +2,15 @@ echo -e "\nDemo of CubeSatSim at 434.9 MHz\n" -sudo systemctl stop rpitx -sudo systemctl start rpitx +sudo systemctl restart rpitx - echo -e "\n Continuous Mode\n\n" -# /home/pi/CubeSatSim/radioafsk f - - if [ "$1" = "a" ]; then - echo "Mode is continuous AFSK" - /home/pi/CubeSatSim/radioafsk afsk - elif [ "$1" = "b" ]; then - echo "Mode is continuous BPSK" - /home/pi/CubeSatSim/radioafsk bpsk - else - echo "Mode is continuous FSK" - /home/pi/CubeSatSim/radioafsk fsk - fi +if [ "$1" = "a" ]; then + echo "Mode is continuous AFSK" + /home/pi/CubeSatSim/radioafsk afsk +elif [ "$1" = "b" ]; then + echo "Mode is continuous BPSK" + /home/pi/CubeSatSim/radioafsk bpsk +else + echo "Mode is continuous FSK" + /home/pi/CubeSatSim/radioafsk fsk +fi From dd0ab8dd25106c0e3aa25d0e6411f3d65dc404f6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 21:07:19 -0400 Subject: [PATCH 28/32] put in full path for rpitx.py --- rpitx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.sh b/rpitx.sh index edd07085..e2cb4245 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -2,4 +2,4 @@ echo -e "\nrpitx for CubeSatSim at 434.9 MHz using python\n" -python rpitx.py $1 +python /home/pi/CubeSatSim/rpitx.py $1 From efd4219abd4ce7d1bd3b8e54b157d716b6b646e8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 20 Jul 2020 21:13:59 -0400 Subject: [PATCH 29/32] added 15 sec timeout to cw id --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index bbfecbc4..329a47d7 100644 --- a/rpitx.py +++ b/rpitx.py @@ -22,7 +22,7 @@ file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0] print(callsign) -os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") +os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo timeout -k 1 15 /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") time.sleep(2) From 888507c4e7aea1f9dc313903034f05e123bb5f75 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 21 Jul 2020 05:26:40 -0400 Subject: [PATCH 30/32] switched to rpitx master and removed timeout for cw id --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 329a47d7..bbfecbc4 100644 --- a/rpitx.py +++ b/rpitx.py @@ -22,7 +22,7 @@ file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0] print(callsign) -os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo timeout -k 1 15 /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") +os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") time.sleep(2) From 199531a7205df874715450aaecf5dcf3e79710fc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 21 Jul 2020 14:35:57 -0400 Subject: [PATCH 31/32] Update README.md --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b5b2f6e..7d4b2b08 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The CubeSat Simulator https://github.com/alanbjohnston/CubeSatSim/wiki is a low There are several hardware versions and software branches to go with them - see below for information. -See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. To build and run the software on a Raspberry Pi 3B, 3B+, or Pi Zero W (doesn't work on Pi 4 since rpitx doesn't work on it yet): +See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. To build and run the software on a Raspberry Pi 3B, 3B+, Pi Zero or Pi Zero W (doesn't work on Pi 4 since rpitx doesn't work on it yet): Requires: - Raspbian Stretch or Buster, full desktop or Lite - wiringpi @@ -14,9 +14,15 @@ Requires: - Direwolf - rpitx -See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. To build and run the software on a Raspberry Pi 3B, 3B+, or Pi Zero W (Does NOT work on a Pi 4 since rpitx does not work on it yet): +See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. Runs on a Raspberry Pi 3B, 3B+, or Pi Zero W (Does NOT work on a Pi 4 since rpitx does not work on it yet). The Pi Zero W or Pi Zero are recommended since they are draw the least power and will result in the best performance under battery power. -`sudo apt-get install -y wiringpi git libasound2-dev i2c-tools` +These instructions assume a Pi Zero W with WiFi connectivity. If you have a Pi Zero, follow these instructions to get connectivity: https://desertbot.io/blog/headless-pi-zero-ssh-access-over-usb-windows + +To begin the software install, after logging in type: + +`sudo apt update -y && sudo apt dist-upgrade -y` + +`sudo apt install -y wiringpi git libasound2-dev i2c-tools` Run raspi-config and enable the I2C bus by selecting Option 5 Interfacing Options and then Option 5 I2C and selecting Y to enable the ARM I2C bus: @@ -80,6 +86,8 @@ Create a sim.cfg configuration file with your amateur radio callsign (in all cap `echo "callsign" >> sim.cfg` +`echo >> .mode` + Compile the code: `make rebuild` @@ -125,6 +133,10 @@ To make the demo.sh script run automatically on boot: `sudo systemctl enable cubesatsim` +`sudo cp ~/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service` + +`sudo systemctl enable rpitx` + Now reboot for all the changes to take effect: `sudo reboot now` From b66f6c41f0e378ce522d7ced66bba608e342c802 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 22 Jul 2020 12:39:03 +0000 Subject: [PATCH 32/32] cleanup of ax5043 code --- afsk/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 35e2ae39..2bb8ba99 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -527,7 +527,7 @@ if (cw_id == ON) // Don't send CW if using AX5043 or in mode cycling or set by 3 #ifdef DEBUG_LOGGING printf("Tx LED On\n"); #endif -printf("Before cmd\n"); +//printf("Before cmd\n"); //printf("CW String: %s\n", cw_str); // FILE* f; system(cw_str); @@ -829,14 +829,14 @@ for (int j = 0; j < frameCnt; j++) #ifdef DEBUG_LOGGING printf("Tx LED On\n"); #endif -printf("Before cmd\n"); -printf("CW telem String: %s\n", cw_str2); +//printf("Before cmd\n"); +//printf("CW telem String: %s\n", cw_str2); // FILE* f; if (mode == CW) system(cw_str2); // printf("File %d \n", f); // printf("close: %d \n", pclose(f)); // execute command and wait for termination before continuing -printf("After command\n"); +//printf("After command\n"); // sleep(7); //printf("Before Write\n"); digitalWrite (txLed, txLedOn); @@ -853,7 +853,7 @@ printf("After command\n"); #ifdef DEBUG_LOGGING printf("Tx LED On\n"); #endif - fprintf(stderr,"INFO: Transmitting X.25 packet\n"); + fprintf(stderr,"INFO: Transmitting X.25 packet using AX5043\n"); memcpy(data, str, strnlen(str, 256)); int ret = ax25_tx_frame(&hax25, &hax5043, data, strnlen(str, 256)); if (ret) { @@ -907,7 +907,7 @@ printf("After command\n"); } -printf("End of get_tlm and rpitx =========================================================\n"); +//printf("End of get_tlm and rpitx =========================================================\n"); digitalWrite (txLed, txLedOff); #ifdef DEBUG_LOGGING