Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,27 @@ jobs:
- name: Lint
run: |
make fmt
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Typecheck
run: |
make typecheck
archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
make build
- name: Archive
- name: Archive Flight Software
uses: actions/upload-artifact@v4
with:
name: proveskit-flight-software
path: artifacts/proves/flight-software
- name: Archive Ground Station
uses: actions/upload-artifact@v4
with:
name: proves
path: artifacts/proves.zip
name: proveskit-ground-station
path: artifacts/proves/ground-station
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ venv
**/*.mpy

# libs
/lib/*
!/lib/requirements.txt
src/*/lib/*
!src/*/lib/requirements.txt
!src/flight-software/lib/proveskit_rp2350_v5a/
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ repos:
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: pretty-format-json
args: [--autofix]
exclude: '.vscode/.*'
#- id: mixed-line-ending
# args: [ --fix=lf ]

Expand Down
55 changes: 32 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PYSQUARED_VERSION ?= v2.0.0-alpha-25w20
PYSQUARED_VERSION ?= v2.0.0-alpha-25w26-2
PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)

.PHONY: all
Expand All @@ -14,16 +14,19 @@ help: ## Display this help.
@echo "Creating virtual environment..."
@$(MAKE) uv
@$(UV) venv
@$(UV) pip install --requirement pyproject.toml
@$(UV) sync

.PHONY: download-libraries
download-libraries: uv .venv ## Download the required libraries
@echo "Downloading libraries..."
@$(UV) pip install --requirement lib/requirements.txt --target lib --no-deps --upgrade --quiet
@$(UV) pip --no-cache install $(PYSQUARED) --target lib --no-deps --upgrade --quiet
download-libraries: download-libraries-flight-software download-libraries-ground-station

@rm -rf lib/*.dist-info
@rm -rf lib/.lock
.PHONY: download-libraries-%
download-libraries-%: uv .venv ## Download the required libraries
@echo "Downloading libraries for $*..."
@$(UV) pip install --requirement src/$*/lib/requirements.txt --target src/$*/lib --no-deps --upgrade --quiet
@$(UV) pip --no-cache install $(PYSQUARED) --target src/$*/lib --no-deps --upgrade --quiet

@rm -rf src/$*/lib/*.dist-info
@rm -rf src/$*/lib/.lock

.PHONY: pre-commit-install
pre-commit-install: uv
Expand All @@ -38,17 +41,20 @@ sync-time: uv ## Syncs the time from your computer to the PROVES Kit board
fmt: pre-commit-install ## Lint and format files
$(UVX) pre-commit run --all-files

typecheck: .venv download-libraries ## Run type check
@$(UV) run -m pyright .

BOARD_MOUNT_POINT ?= ""
VERSION ?= $(shell git tag --points-at HEAD --sort=-creatordate < /dev/null | head -n 1)

.PHONY: install
install: build ## Install the project onto a connected PROVES Kit use `make install BOARD_MOUNT_POINT=/my_board_destination/` to specify the mount point
install-%: build-% ## Install the project onto a connected PROVES Kit use `make install-flight-software BOARD_MOUNT_POINT=/my_board_destination/` to specify the mount point
ifeq ($(OS),Windows_NT)
rm -rf $(BOARD_MOUNT_POINT)
cp -r artifacts/proves/* $(BOARD_MOUNT_POINT)
cp -r artifacts/proves/$*/* $(BOARD_MOUNT_POINT)
else
@rm $(BOARD_MOUNT_POINT)/code.py > /dev/null 2>&1 || true
$(call rsync_to_dest,artifacts/proves,$(BOARD_MOUNT_POINT))
$(call rsync_to_dest,artifacts/proves/$*,$(BOARD_MOUNT_POINT))
endif

# install-firmware
Expand All @@ -63,15 +69,18 @@ clean: ## Remove all gitignored files such as downloaded libraries and artifacts
##@ Build

.PHONY: build
build: download-libraries mpy-cross ## Build the project, store the result in the artifacts directory
@echo "Creating artifacts/proves"
@mkdir -p artifacts/proves
@echo "__version__ = '$(VERSION)'" > artifacts/proves/version.py
$(call compile_mpy)
$(call rsync_to_dest,.,artifacts/proves/)
@$(UV) run python -c "import os; [os.remove(os.path.join(root, file)) for root, _, files in os.walk('artifacts/proves/lib') for file in files if file.endswith('.py')]"
@echo "Creating artifacts/proves.zip"
@zip -r artifacts/proves.zip artifacts/proves > /dev/null
build: build-flight-software build-ground-station ## Build all projects

.PHONY: build-*
build-%: download-libraries-% mpy-cross ## Build the project, store the result in the artifacts directory
@echo "Creating artifacts/proves/$*"
@mkdir -p artifacts/proves/$*
@echo "__version__ = '$(VERSION)'" > artifacts/proves/$*/version.py
$(call compile_mpy,$*)
$(call rsync_to_dest,src/$*,artifacts/proves/$*/)
@$(UV) run python -c "import os; [os.remove(os.path.join(root, file)) for root, _, files in os.walk('artifacts/proves/$*/lib') for file in files if file.endswith('.py')]"
@echo "Creating artifacts/proves/$*.zip"
@zip -r artifacts/proves/$*.zip artifacts/proves/$* > /dev/null

define rsync_to_dest
@if [ -z "$(1)" ]; then \
Expand All @@ -84,7 +93,7 @@ define rsync_to_dest
exit 1; \
fi

@rsync -avh $(1)/config.json artifacts/proves/version.py $(1)/*.py $(1)/lib --exclude=".*" --exclude='requirements.txt' --exclude='__pycache__' $(2) --delete --times --checksum
@rsync -avh ./config.json $(2)/version.py $(1)/*.py $(1)/lib --exclude=".*" --exclude='requirements.txt' --exclude='__pycache__' $(2) --delete --times --checksum
endef

##@ Build Tools
Expand All @@ -93,7 +102,7 @@ $(TOOLS_DIR):
mkdir -p $(TOOLS_DIR)

### Tool Versions
UV_VERSION ?= 0.5.24
UV_VERSION ?= 0.7.13
MPY_CROSS_VERSION ?= 9.0.5

UV_DIR ?= $(TOOLS_DIR)/uv-$(UV_VERSION)
Expand Down Expand Up @@ -133,5 +142,5 @@ endif
endif

define compile_mpy
@$(UV) run python -c "import os, subprocess; [subprocess.run(['$(MPY_CROSS)', os.path.join(root, file)]) for root, _, files in os.walk('lib') for file in files if file.endswith('.py')]" || exit 1
@$(UV) run python -c "import os, subprocess; [subprocess.run(['$(MPY_CROSS)', os.path.join(root, file)]) for root, _, files in os.walk('src/$(1)/lib') for file in files if file.endswith('.py')]" || exit 1
endef
163 changes: 80 additions & 83 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,84 @@
{
"cubesat_name": "Orpheus",
"last_battery_temp": 20.0,
"sleep_duration": 30,
"detumble_enable_z": true,
"detumble_enable_x":true,
"detumble_enable_y": true,
"jokes": [
"Hey it is pretty cold up here, did someone forget to pay the electric bill?",
"sudo rf - 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",
"Alien detected. Blurring photo...",
"Wait it is all open source? Always has been... www.github.com/proveskit",
"What did 0 say to 1? You're a bit too much.",
"Pleiades - Orpheus has been recently acquired by the Onion News Network",
"This jokesat was brought to you by the Bronco Space Ministry of Labor and Job Placement",
"Catch you on the next pass!",
"Pleiades - Orpheus was not The Impostor",
"Sorry for messing with your long-exposure astrophoto!",
"Better buy a telescope. Wanna see me. Buy a telescope. Gonna be in space.",
"According to all known laws of aviation, there is no way bees should be able to fly...",
"You lost the game ",
"Bobby Tables is a good friend of mine",
"Why did the computer cross the road? To get a byte to eat!",
"Why are the astronauts not hungry when they got to space? They had a big launch.",
"Why did the computer get glasses? To improve its web sight!",
"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",
"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.",
"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",
"CQ CQ KN6NAQ ... KN6NAT are you out there?",
"Woah is that the Launcher Orbiter?????",
"Everything in life is a spring if you think hard enough!"
],
"debug": true,
"heating": false,
"normal_temp": 20,
"normal_battery_temp": 1,
"normal_micro_temp": 20,
"normal_charge_current": 0.5,
"normal_battery_voltage": 6.9,
"critical_battery_voltage": 6.6,
"battery_voltage": 5.2,
"current_draw": 240.5,
"reboot_time": 3600,
"longest_allowable_sleep_time": 360,
"turbo_clock": false,
"radio": {
"license": "",
"receiver_id": 250,
"sender_id": 251,
"start_time": 80000,
"transmit_frequency": 437.4,
"battery_voltage": 5.2,
"critical_battery_voltage": 6.6,
"cubesat_name": "PROVES-MY_SATELLITE_NAME",
"current_draw": 240.5,
"debug": true,
"detumble_enable_x": true,
"detumble_enable_y": true,
"detumble_enable_z": true,
"heating": false,
"jokes": [
"Hey it is pretty cold up here, did someone forget to pay the electric bill?",
"sudo rf - 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",
"Alien detected. Blurring photo...",
"Wait it is all open source? Always has been... www.github.com/proveskit",
"What did 0 say to 1? You're a bit too much.",
"Pleiades - Orpheus has been recently acquired by the Onion News Network",
"This jokesat was brought to you by the Bronco Space Ministry of Labor and Job Placement",
"Catch you on the next pass!",
"Pleiades - Orpheus was not The Impostor",
"Sorry for messing with your long-exposure astrophoto!",
"Better buy a telescope. Wanna see me. Buy a telescope. Gonna be in space.",
"According to all known laws of aviation, there is no way bees should be able to fly...",
"You lost the game ",
"Bobby Tables is a good friend of mine",
"Why did the computer cross the road? To get a byte to eat!",
"Why are the astronauts not hungry when they got to space? They had a big launch.",
"Why did the computer get glasses? To improve its web sight!",
"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",
"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.",
"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",
"CQ CQ KN6NAQ ... KN6NAT are you out there?",
"Woah is that the Launcher Orbiter?????",
"Everything in life is a spring if you think hard enough!",
"Your Mom",
"Your Mum",
"Your Face",
"not True lol",
"I have brought peace, freedom, justice, and security to my new empire! Your New Empire?"
],
"last_battery_temp": 20.0,
"longest_allowable_sleep_time": 360,
"normal_battery_temp": 1,
"normal_battery_voltage": 6.9,
"normal_charge_current": 0.5,
"normal_micro_temp": 20,
"normal_temp": 20,
"radio": {
"fsk": {
"broadcast_address": 255,
"modulation_type": 0,
"node_address": 1
},
"license": "KK4PDM",
"lora": {
"ack_delay": 0.2,
"coding_rate": 8,
"cyclic_redundancy_check": true,
"max_output": true,
"spreading_factor": 8,
"transmit_power": 23
"ack_delay": 0.2,
"coding_rate": 8,
"cyclic_redundancy_check": true,
"max_output": true,
"spreading_factor": 8,
"transmit_power": 23
},
"fsk": {
"broadcast_address": 255,
"node_address": 1,
"modulation_type": 0
}
},
"super_secret_code": "ABCD",
"repeat_code": "RP",
"joke_reply": [
"Your Mom",
"Your Mum",
"Your Face",
"not True lol",
"I have brought peace, freedom, justice, and security to my new empire! Your New Empire?"
]
"modulation": "LoRa",
"start_time": 80000,
"transmit_frequency": 437.4
},
"reboot_time": 3600,
"repeat_code": "RP",
"sleep_duration": 30,
"super_secret_code": "ABCD",
"turbo_clock": false
}
29 changes: 20 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,38 @@ version = "1.0.0"
description = "Flight Software for the PROVES Kit RP2350 v5A"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"adafruit-circuitpython-typing==1.11.2",
"circuitpython-stubs==9.2.5",
"coverage==7.6.10",
"pre-commit==4.0.1",
"pyright[nodejs]==1.1.399",
"pytest==8.3.2",
dependencies = []

[dependency-groups]
dev = [
"adafruit-circuitpython-typing==1.12.1",
"circuitpython-stubs==9.2.8",
"pre-commit==4.2.0",
"pyright[nodejs]==1.1.402",
]

[tool.ruff.format]
# Use `\n` line endings for all files
line-ending = "lf"

[tool.pyright]
include = ["main.py", "boot.py", "repl.py", "safemode.py"]
include = [
"src/flight-software/boot.py",
"src/flight-software/main.py",
"src/flight-software/repl.py",
"src/flight-software/safemode.py",
"src/flight-software/lib/proveskit_rp2040_v4/*",
"src/ground_station/boot.py",
"src/ground_station/main.py",
"src/ground_station/repl.py",
"src/ground_station/safemode.py",
]
exclude = [
"**/__pycache__",
".venv",
".git",
"artifacts",
"lib",
"src/*/lib",
"typings",
]
stubPath = "./typings"
Expand Down
File renamed without changes.
Empty file.
3 changes: 3 additions & 0 deletions src/flight-software/lib/proveskit_rp2350_v5a/register.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Register:
boot_count = 0
error_count = 1
File renamed without changes.
Loading