From a432645cfd3be3f2da2caf0a376023f4ea469d4b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 16:48:39 -0500 Subject: [PATCH 01/19] Update fc_block_decode.py add system_and_print --- groundstation/fc_block_decode.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 3d862902..587a7840 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -12,7 +12,11 @@ logging.basicConfig(format='%(message)s') def fstr(template): - return eval(f"f'{template}'") + return eval(f"f'{template}'") + +def system_and_print(string) + print(string) + system(string) FC_EPS = 1 FC_BOB = 25 @@ -32,11 +36,11 @@ image_dir = "/home/pi/fctelem/" image = "image_file" ssdv = "/home/pi/ssdv/ssdv -d -J " -system("sudo rm " + image_dir + image) -#system("sudo rm " + html_dir + "*") -system("sudo rm " + html_dir + "/images/*") +system_and_print("sudo rm " + image_dir + image) +#system_and_print("sudo rm " + html_dir + "*") +system_and_print("sudo rm " + html_dir + "/images/*") -#system("cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg " + html_dir + "image_file.jpeg") +#system_and_print("cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg " + html_dir + "image_file.jpeg") head_string = 'FunCube CubeSatSim Telemetry\n\n

FunCube CubeSatSim Telemetry

' + \ '

  
All images
' @@ -125,7 +129,7 @@ if __name__ == "__main__": except: print("File error") # try: - system(ssdv + image_dir + image + "_payload " + + system_and_print(ssdv + image_dir + image + "_payload " + image_dir + image + "_payload.jpeg 2>&1 | sudo tee /home/pi/fctelem/ssdv_output") with open("/home/pi/fctelem/ssdv_output", "r") as file: for line in file: @@ -141,14 +145,14 @@ if __name__ == "__main__": print("End of image") if (image_id != 256): print("Saving complete image") - system("cp " + filename + " " + html_dir + "images/") + system_and_print("cp " + filename + " " + html_dir + "images/") newfilename = image_dir + image + str(new_image_id) + ".jpeg" - # system(ssdv + image_dir + image + " " + filename) - system("mv " + filename + " " + newfilename) - system("mv " + image_dir + image + " " + image_dir + image + str(image_id)) - # system("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") + # system_and_print(ssdv + image_dir + image + " " + filename) + system_and_print("mv " + filename + " " + newfilename) + system_and_print("mv " + image_dir + image + " " + image_dir + image + str(image_id)) + # system_and_print("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") else: - system("sudo rm " + image_dir + image) + system_and_print("sudo rm " + image_dir + image) print("New Image ID: ") print(new_image_id) image_id = new_image_id @@ -161,8 +165,8 @@ if __name__ == "__main__": with open(image_dir + image, "ab") as binary_file: binary_file.write(immutable_payload) filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" - system(ssdv + image_dir + image + " " + filename) - system("cp " + filename + " " + html_dir + "image_file.jpeg") + system_and_print(ssdv + image_dir + image + " " + filename) + system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") telem_string = fstr(telem_string_format) with open(html_dir + "index.html", "w") as html_file: html_file.write(head_string) From 797a5eb60197af67170fa7acd01c194e40cb1a23 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 16:50:37 -0500 Subject: [PATCH 02/19] Update fc_block_decode.py missing : --- groundstation/fc_block_decode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 587a7840..4ee0f21c 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -14,7 +14,7 @@ logging.basicConfig(format='%(message)s') def fstr(template): return eval(f"f'{template}'") -def system_and_print(string) +def system_and_print(string): print(string) system(string) From 1d146aff14f96bd09c4b9c15a3a6c55be0501d39 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 17:24:39 -0500 Subject: [PATCH 03/19] Update fc_block_decode.py cleanup - don't save temp files --- groundstation/fc_block_decode.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 4ee0f21c..75f7acad 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -121,7 +121,7 @@ if __name__ == "__main__": print('Payload {:x} {:x} \n'.format(data_block[FC_PAYLOAD + extended], data_block[FC_PAYLOAD + extended + 1])) if (data_block[FC_PAYLOAD + extended] == 0x55) and (data_block[FC_PAYLOAD + extended + 1] == 0x68): try: - print("Writing payload to file") + print("Writing this image payload block to file " + image + "_payload") immutable_payload = bytes(bytearray(data_block[(FC_PAYLOAD + extended):])) # payload) # print(immutable_payload) with open(image_dir + image + "_payload", "wb") as binary_file: @@ -129,8 +129,10 @@ if __name__ == "__main__": except: print("File error") # try: + print("Processing payload with ssdv, saving image to " + image + "_paylad.jpeg and log to ssdv_output") system_and_print(ssdv + image_dir + image + "_payload " + image_dir + image + "_payload.jpeg 2>&1 | sudo tee /home/pi/fctelem/ssdv_output") + print("Parsing ssdv_output") with open("/home/pi/fctelem/ssdv_output", "r") as file: for line in file: # print("line:") @@ -145,11 +147,12 @@ if __name__ == "__main__": print("End of image") if (image_id != 256): print("Saving complete image") - system_and_print("cp " + filename + " " + html_dir + "images/") - newfilename = image_dir + image + str(new_image_id) + ".jpeg" + system_and_print("cp " html_dir + "image_file.jpeg" + " " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") + system_and_print("sudo rm " + image_dir + image) + # newfilename = image_dir + image + str(new_image_id) + ".jpeg" # system_and_print(ssdv + image_dir + image + " " + filename) - system_and_print("mv " + filename + " " + newfilename) - system_and_print("mv " + image_dir + image + " " + image_dir + image + str(image_id)) + # system_and_print("mv " + filename + " " + newfilename) + # system_and_print("mv " + image_dir + image + " " + image_dir + image + str(image_id)) # system_and_print("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") else: system_and_print("sudo rm " + image_dir + image) @@ -162,12 +165,16 @@ if __name__ == "__main__": image_count += 1 print("new image_count:") print(image_count) + print("Appending block to file " + image) with open(image_dir + image, "ab") as binary_file: binary_file.write(immutable_payload) - filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" - system_and_print(ssdv + image_dir + image + " " + filename) - system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") +# filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" + print("Running ssdv with all blocks in file " + image + " saving as " + html_dir + "image_file.jpeg") +# system_and_print(ssdv + image_dir + image + " " + filename) + system_and_print(ssdv + image_dir + image + " " + html_dir + "image_file.jpeg") system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") +# system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") telem_string = fstr(telem_string_format) + print("Writing index.html file") with open(html_dir + "index.html", "w") as html_file: html_file.write(head_string) html_file.write(telem_string) From eaa8a65acd88bd871aced855e9e629128dab6a85 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 17:30:26 -0500 Subject: [PATCH 04/19] Update fc_block_decode.py tabs --- groundstation/fc_block_decode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 75f7acad..93aab0ac 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -147,7 +147,7 @@ if __name__ == "__main__": print("End of image") if (image_id != 256): print("Saving complete image") - system_and_print("cp " html_dir + "image_file.jpeg" + " " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") + system_and_print("cp " html_dir + "image_file.jpeg " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") system_and_print("sudo rm " + image_dir + image) # newfilename = image_dir + image + str(new_image_id) + ".jpeg" # system_and_print(ssdv + image_dir + image + " " + filename) From 588114c1bd1adca735c7756db024d355a87e8ca4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 17:31:14 -0500 Subject: [PATCH 05/19] Update fc_block_decode.py added + --- groundstation/fc_block_decode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 93aab0ac..5bc2770a 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -147,7 +147,7 @@ if __name__ == "__main__": print("End of image") if (image_id != 256): print("Saving complete image") - system_and_print("cp " html_dir + "image_file.jpeg " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") + system_and_print("cp " + html_dir + "image_file.jpeg " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") system_and_print("sudo rm " + image_dir + image) # newfilename = image_dir + image + str(new_image_id) + ".jpeg" # system_and_print(ssdv + image_dir + image + " " + filename) From 1a60e14d811f455371a102528246085d882b0e11 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 17:33:18 -0500 Subject: [PATCH 06/19] Update fc_block_decode.py extra line --- groundstation/fc_block_decode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 5bc2770a..ef706fca 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -171,7 +171,8 @@ if __name__ == "__main__": # filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" print("Running ssdv with all blocks in file " + image + " saving as " + html_dir + "image_file.jpeg") # system_and_print(ssdv + image_dir + image + " " + filename) - system_and_print(ssdv + image_dir + image + " " + html_dir + "image_file.jpeg") system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") + system_and_print(ssdv + image_dir + image + " " + html_dir + "image_file.jpeg") +# system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") # system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") telem_string = fstr(telem_string_format) print("Writing index.html file") From 2c1169f2081170aac741622eb8ea4210c315e469 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 17:43:12 -0500 Subject: [PATCH 07/19] Update fc_block_decode.py more cleanup --- groundstation/fc_block_decode.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index ef706fca..7a411acc 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -149,17 +149,11 @@ if __name__ == "__main__": print("Saving complete image") system_and_print("cp " + html_dir + "image_file.jpeg " + html_dir + "images/" + image + str(image_id) + "." + str(image_count) + ".jpeg") system_and_print("sudo rm " + image_dir + image) - # newfilename = image_dir + image + str(new_image_id) + ".jpeg" - # system_and_print(ssdv + image_dir + image + " " + filename) - # system_and_print("mv " + filename + " " + newfilename) - # system_and_print("mv " + image_dir + image + " " + image_dir + image + str(image_id)) - # system_and_print("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") else: system_and_print("sudo rm " + image_dir + image) print("New Image ID: ") print(new_image_id) image_id = new_image_id - # image_count = (image_count + 1) % 256 image_count = 1 else: image_count += 1 @@ -168,12 +162,8 @@ if __name__ == "__main__": print("Appending block to file " + image) with open(image_dir + image, "ab") as binary_file: binary_file.write(immutable_payload) -# filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" print("Running ssdv with all blocks in file " + image + " saving as " + html_dir + "image_file.jpeg") -# system_and_print(ssdv + image_dir + image + " " + filename) system_and_print(ssdv + image_dir + image + " " + html_dir + "image_file.jpeg") -# system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") -# system_and_print("cp " + filename + " " + html_dir + "image_file.jpeg") telem_string = fstr(telem_string_format) print("Writing index.html file") with open(html_dir + "index.html", "w") as html_file: From b20a1f673de38e90ee1b97abad7de4e0cf6b31d8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 21 Feb 2025 21:59:10 -0500 Subject: [PATCH 08/19] Update transmit.py cleanup --- transmit.py | 68 ++++++++++------------------------------------------- 1 file changed, 13 insertions(+), 55 deletions(-) diff --git a/transmit.py b/transmit.py index 4507ccc9..c4dfdf2e 100644 --- a/transmit.py +++ b/transmit.py @@ -23,6 +23,14 @@ def battery_saver_check(): except: print("battery saver not activated") # txc = True + +def blink(times): + powerPin = 16 + for i in range(times): + GPIO.output(powerPin, 0) # blink two times + sleep(0.1) + GPIO.output(powerPin, 1) + sleep(0.1) def increment_mode(): print("increment mode") @@ -39,76 +47,26 @@ def increment_mode(): print(mode) if (mode == 'a'): 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) + blink(2) sleep(2.5) elif (mode == 'f'): 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) + blink(3) sleep(2.5) elif (mode == 'b'): 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) + blink(4) sleep(2.5) elif (mode == 's'): 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) + blink(5) sleep(2.5) else: mode = 'a' - GPIO.output(powerPin, 0) # blink one time - sleep(0.1) - GPIO.output(powerPin, 1) + blink(1) sleep(2.5) try: From b0b9d38bb6ed7a9bf0348fab6d04a0525469884a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 08:52:10 -0500 Subject: [PATCH 09/19] Update transmit.py don't print checking file --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index c4dfdf2e..aa723a76 100644 --- a/transmit.py +++ b/transmit.py @@ -773,7 +773,7 @@ if __name__ == "__main__": sleep(4.2) else: # FunCube mode image for i in range(4): - print("Checking image_file.bin") +# print("Checking image_file.bin") try: file = open("/home/pi/CubeSatSim/image_file.bin") file.close() From d89d423297339f9bc46e4c41a4258511309a229b Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 14:16:32 -0500 Subject: [PATCH 10/19] Update transmit.py change device from 1 to Card --- transmit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index aa723a76..3d908552 100644 --- a/transmit.py +++ b/transmit.py @@ -819,7 +819,8 @@ if __name__ == "__main__": ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") sleep(1) - system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") +# system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") + system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") GPIO.output(powerPin, 1) sleep(0.5) GPIO.output(powerPin, 0) From e30c143d6aae68fc5aef2574254330f30a444ff6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 14:22:05 -0500 Subject: [PATCH 11/19] Update transmit.py don't turn off power LED for e --- transmit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transmit.py b/transmit.py index 3d908552..6220d9dc 100644 --- a/transmit.py +++ b/transmit.py @@ -807,7 +807,7 @@ if __name__ == "__main__": GPIO.setup(txLed, GPIO.OUT) GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected - GPIO.output(powerPin, 0) + GPIO.output(powerPin, 1) # was 0 while True: sleep(0.5) if (GPIO.input(squelch) == False): @@ -821,9 +821,9 @@ if __name__ == "__main__": sleep(1) # system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") - GPIO.output(powerPin, 1) - sleep(0.5) - GPIO.output(powerPin, 0) +# GPIO.output(powerPin, 1) +# sleep(0.5) +# GPIO.output(powerPin, 0) while (GPIO.input(squelch) == False): sleep(1) print("No carrier detected, stopping repeater") From 68cbe07e24a58ceb953b652524784ec8adef7391 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 14:24:31 -0500 Subject: [PATCH 12/19] Update transmit.py remove power pin from e --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 6220d9dc..3e297eae 100644 --- a/transmit.py +++ b/transmit.py @@ -805,9 +805,9 @@ if __name__ == "__main__": output(ptt, 1) GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi 4 GPIO.setup(txLed, GPIO.OUT) - GPIO.setup(powerPin, GPIO.OUT) +# GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected - GPIO.output(powerPin, 1) # was 0 +# GPIO.output(powerPin, 1) # was 0 while True: sleep(0.5) if (GPIO.input(squelch) == False): From 5d0be00edfb5fff83e9d2d424b714a6e401c8580 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 14:43:21 -0500 Subject: [PATCH 13/19] Update transmit.py add 2 sec delay in e --- transmit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transmit.py b/transmit.py index 3e297eae..59ebd1c7 100644 --- a/transmit.py +++ b/transmit.py @@ -819,6 +819,8 @@ if __name__ == "__main__": ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") sleep(1) + print("Sleeping 2") + sleep(1) # system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") # GPIO.output(powerPin, 1) From dff7fde57e3c9f8ac1575eeb93e2c39e3e3c644f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 15:51:21 -0500 Subject: [PATCH 14/19] Update transmit.py crossband -290 MHz --- transmit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 59ebd1c7..2c40a9bc 100644 --- a/transmit.py +++ b/transmit.py @@ -797,7 +797,7 @@ if __name__ == "__main__": # else: sleep(0.6) elif (mode == 'e'): # code based on https://zr6aic.blogspot.com/2016/11/creating-2m-fm-repeater-with-raspberry.html - print("Repeater") + print("Cross Band Repeater") print("Stopping command and control") system("sudo systemctl stop command") print("turn on FM rx") @@ -808,6 +808,8 @@ if __name__ == "__main__": # GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected # GPIO.output(powerPin, 1) # was 0 + tx = rx - 290 + print("Transmit frequency: ",tx) while True: sleep(0.5) if (GPIO.input(squelch) == False): From b9258890ff3d0a180fd72e894d4639b62c53c935 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 15:54:19 -0500 Subject: [PATCH 15/19] Update transmit.py change to txf --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index 2c40a9bc..4adde3ea 100644 --- a/transmit.py +++ b/transmit.py @@ -808,7 +808,7 @@ if __name__ == "__main__": # GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected # GPIO.output(powerPin, 1) # was 0 - tx = rx - 290 + txf = float(rx) - 290.0 print("Transmit frequency: ",tx) while True: sleep(0.5) @@ -819,7 +819,7 @@ if __name__ == "__main__": output(txLed, txLedOn) # system("arecord -D plughw:CARD=Device,DEV=0 | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") - system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") + system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + str(txf) + "e3 &") sleep(1) print("Sleeping 2") sleep(1) From a7cd85cf76d89870bd05c65aac1793982f990248 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 16:04:32 -0500 Subject: [PATCH 16/19] Update transmit.py cross band repeater shift 434.9 to 145 --- transmit.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/transmit.py b/transmit.py index 4adde3ea..55c757e3 100644 --- a/transmit.py +++ b/transmit.py @@ -808,8 +808,8 @@ if __name__ == "__main__": # GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected # GPIO.output(powerPin, 1) # was 0 - txf = float(rx) - 290.0 - print("Transmit frequency: ",tx) + txf = float(tx) - 289.9 + print("Transmit frequency: ",txf) while True: sleep(0.5) if (GPIO.input(squelch) == False): @@ -820,9 +820,7 @@ if __name__ == "__main__": # system("arecord -D plughw:CARD=Device,DEV=0 | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 &") ## system("arecord -D plughw:CARD=Device,DEV=0 -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 " + tx + "e3 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + str(txf) + "e3 &") - sleep(1) - print("Sleeping 2") - sleep(1) + sleep(0.5) # system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") # GPIO.output(powerPin, 1) From a99043ae1ccb8dbf5a5c3622a4da16aef8caa641 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 16:08:27 -0500 Subject: [PATCH 17/19] Update transmit.py add 1 sec between keys --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 55c757e3..7fe1c380 100644 --- a/transmit.py +++ b/transmit.py @@ -811,7 +811,7 @@ if __name__ == "__main__": txf = float(tx) - 289.9 print("Transmit frequency: ",txf) while True: - sleep(0.5) + sleep(1) if (GPIO.input(squelch) == False): print("Carrier detected, starting repeater") GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 From 630e015d9e2f7369ff1ed34690be17b78cd00068 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 16:14:52 -0500 Subject: [PATCH 18/19] Update transmit.py shift 290.9 --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 7fe1c380..7991313c 100644 --- a/transmit.py +++ b/transmit.py @@ -808,7 +808,7 @@ if __name__ == "__main__": # GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected # GPIO.output(powerPin, 1) # was 0 - txf = float(tx) - 289.9 + txf = float(tx) - 290.9 print("Transmit frequency: ",txf) while True: sleep(1) From e8a031b5c9b6ff183fe12c1daf298d82f1d239cc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 22 Feb 2025 16:16:13 -0500 Subject: [PATCH 19/19] Update transmit.py shift 288.9 --- transmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transmit.py b/transmit.py index 7991313c..e1c9336c 100644 --- a/transmit.py +++ b/transmit.py @@ -808,7 +808,7 @@ if __name__ == "__main__": # GPIO.setup(powerPin, GPIO.OUT) GPIO.setup(squelch, GPIO.IN, pull_up_down=GPIO.PUD_UP) ## pull up in case pin is not connected # GPIO.output(powerPin, 1) # was 0 - txf = float(tx) - 290.9 + txf = float(tx) - 288.9 print("Transmit frequency: ",txf) while True: sleep(1)