From db2dd6345e59d2349c9d6dd467c2e408198074ab Mon Sep 17 00:00:00 2001 From: DavidUniack Date: Fri, 18 Jul 2025 11:18:59 -0700 Subject: [PATCH 1/2] Update config.json spelling and callsign --- config.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index 03c0351..d12ffcd 100644 --- a/config.json +++ b/config.json @@ -17,7 +17,7 @@ ], "jokes": [ "Hey it is pretty cold up here, did someone forget to pay the electric bill?", - "sudo rf - rf*", + "sudo rm - rf*", "Why did the astronaut break up with his girlfriend? He needed space.", "Why did the sun go to school? To get a little brighter.", "why is the mall called the mall? because instead of going to one store you go to them all", @@ -39,12 +39,12 @@ "What are computers favorite snacks? Chips!", "Wait! I think I see a White 2019 Subaru Crosstrek 2.0i Premium", "IS THAT A SUPRA?!", - "Finally escpaed the LA Traffic", + "Finally escaped the LA Traffic", "My CubeSat is really good at jokes, but its delivery is always delayed.", "exec order 66", "I had a joke about UDP, but I am not sure if you'd get it.", "I am not saying FSK modulation is the best way to send jokes, but at least it is never monotone!", - "I am sorry David, I am afrain I can not do that.", + "I am sorry David, I am afraid I can not do that.", "My memory is volatile like RAM, so it only makes sense that I forget things.", "Imagine it gets stuck and just keeps repeating this joke every 2 mins", "Check Engine: Error Code 404: Joke Not Found", @@ -65,7 +65,7 @@ "modulation_type": 0, "node_address": 1 }, - "license": "", + "license": "KO6FDY", "lora": { "ack_delay": 0.2, "coding_rate": 8, From 21b796948a01293df2a5c207480bf8f53ab4d507 Mon Sep 17 00:00:00 2001 From: DavidUniack Date: Fri, 18 Jul 2025 15:45:51 -0700 Subject: [PATCH 2/2] S-band radio implementation! --- Makefile | 2 +- config.json | 1 + .../lib/proveskit_rp2350_v5b/register.py | 1 + src/flight-software/main.py | 1 + src/flight-software/repl.py | 2 + src/ground-station/lib/requirements.txt | 3 +- src/ground-station/repl.py | 41 ++++++++++++++++--- 7 files changed, 44 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 72c5316..2a4123b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYSQUARED_VERSION ?= v2.0.0-alpha-25w26-2 +PYSQUARED_VERSION ?=mike-dev PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION) BOARD_MOUNT_POINT ?= "" BOARD_TTY_PORT ?= "" diff --git a/config.json b/config.json index d12ffcd..12f5a01 100644 --- a/config.json +++ b/config.json @@ -4,6 +4,7 @@ "cubesat_name": "Orpheus", "current_draw": 240.5, "debug": true, + "degraded_battery_voltage": 7.0, "detumble_enable_x": true, "detumble_enable_y": true, "detumble_enable_z": true, diff --git a/src/flight-software/lib/proveskit_rp2350_v5b/register.py b/src/flight-software/lib/proveskit_rp2350_v5b/register.py index ce5d29e..28801a7 100644 --- a/src/flight-software/lib/proveskit_rp2350_v5b/register.py +++ b/src/flight-software/lib/proveskit_rp2350_v5b/register.py @@ -1,3 +1,4 @@ class Register: boot_count = 0 error_count = 1 + message_count = 2 diff --git a/src/flight-software/main.py b/src/flight-software/main.py index 31eb348..1f41993 100644 --- a/src/flight-software/main.py +++ b/src/flight-software/main.py @@ -109,6 +109,7 @@ logger, uhf_radio, config.radio.license, + Counter(Register.message_count), 0.2, ) diff --git a/src/flight-software/repl.py b/src/flight-software/repl.py index 1f2c39a..c78e41b 100644 --- a/src/flight-software/repl.py +++ b/src/flight-software/repl.py @@ -24,6 +24,7 @@ from lib.adafruit_veml7700 import VEML7700 ### This is Hacky V5a Devel Stuff### # from lib.pysquared.Big_Data import AllFaces ### This is Hacky V5a Devel Stuff### +from lib.proveskit_rp2350_v5b.register import Register from lib.pysquared.beacon import Beacon from lib.pysquared.cdh import CommandDataHandler from lib.pysquared.config.config import Config @@ -117,6 +118,7 @@ logger, uhf_radio, config.radio.license, + Counter(Register.message_count), 0.2, ) diff --git a/src/ground-station/lib/requirements.txt b/src/ground-station/lib/requirements.txt index 05be484..8eaa3bc 100644 --- a/src/ground-station/lib/requirements.txt +++ b/src/ground-station/lib/requirements.txt @@ -1,4 +1,5 @@ adafruit-circuitpython-asyncio @ git+https://github.com/adafruit/adafruit_circuitpython_asyncio@1.3.3 adafruit-circuitpython-rfm==1.0.3 +proves-circuitpython-sx1280 @ git+https://github.com/proveskit/CircuitPython_SX1280@1.0.3 adafruit-circuitpython-ticks==1.1.1 -proveskit-ground-station @ git+https://github.com/proveskit/circuitpython_ground_station@0.0.1 +proveskit-ground-station @ git+https://github.com/proveskit/circuitpython_ground_station@david-dev diff --git a/src/ground-station/repl.py b/src/ground-station/repl.py index 06a80f3..b073128 100644 --- a/src/ground-station/repl.py +++ b/src/ground-station/repl.py @@ -7,6 +7,7 @@ from lib.pysquared.hardware.busio import _spi_init from lib.pysquared.hardware.digitalio import initialize_pin from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager +from lib.pysquared.hardware.radio.manager.sx1280 import SX1280Manager from lib.pysquared.hardware.radio.packetizer.packet_manager import PacketManager from lib.pysquared.logger import Logger from lib.pysquared.nvm.counter import Counter @@ -24,18 +25,48 @@ board.SPI0_MISO, ) -radio = RFM9xManager( +spi1 = _spi_init( logger, - config.radio, - spi0, - initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT, True), - initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT, True), + board.SPI1_SCK, + board.SPI1_MOSI, + board.SPI1_MISO, ) +print("Please select which radio you wish to use...") +print("1 for UHF or 2 for S-Band") + +selection = input() + +if selection == "1": + radio = RFM9xManager( + logger, + config.radio, + spi0, + initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT, True), + initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT, True), + ) +elif selection == "2": + radio = SX1280Manager( + logger, + config.radio, + spi1, + initialize_pin(logger, board.SPI1_CS0, digitalio.Direction.OUTPUT, True), + initialize_pin(logger, board.RF2_RST, digitalio.Direction.OUTPUT, True), + initialize_pin(logger, board.RF2_IO0, digitalio.Direction.OUTPUT, True), + 2.4, + initialize_pin(logger, board.RF2_TX_EN, digitalio.Direction.OUTPUT, False), + initialize_pin(logger, board.RF2_RX_EN, digitalio.Direction.OUTPUT, False), + ) + +else: + print("Invalid selection. Exiting.") + exit() + packet_manager = PacketManager( logger, radio, config.radio.license, + Counter(2), 0.2, )