Skip to content

Commit b8f9fd6

Browse files
Implement beacon in flight-software add ground-station (#23)
* Add beacon functionality * Using packet manager * Remove extra watchdog pets * Split flight and ground station software * Fix fsk flag * Simplify main, add json autoformat precommit * native namespace packages * Fix archive * Update sleep helper arg ordering * A few more changes * Set ground station to 0.0.1 * Updated to pysquared 25w26-2 Signed-off-by: Michael Pham <[email protected]> * Updated readme with GS install command Signed-off-by: Michael Pham <[email protected]> --------- Signed-off-by: Michael Pham <[email protected]> Co-authored-by: Michael Pham <[email protected]>
1 parent 4fc060f commit b8f9fd6

File tree

22 files changed

+390
-514
lines changed

22 files changed

+390
-514
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ jobs:
2828
- name: Build
2929
run: |
3030
make build
31-
- name: Archive
31+
- name: Archive Flight Software
3232
uses: actions/upload-artifact@v4
3333
with:
34-
name: proves
35-
path: artifacts/proves.zip
34+
name: proveskit-flight-software
35+
path: artifacts/proves/flight-software
36+
- name: Archive Ground Station
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: proveskit-ground-station
40+
path: artifacts/proves/ground-station

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ venv
1212
firmware.uf2
1313

1414
# libs
15-
/lib/*
16-
!/lib/requirements.txt
15+
src/*/lib/*
16+
!src/*/lib/requirements.txt
17+
!src/flight-software/lib/proveskit_rp2040_v4/

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ repos:
77
- id: check-yaml
88
- id: check-json
99
- id: check-added-large-files
10+
- id: pretty-format-json
11+
args: [--autofix]
12+
exclude: '.vscode/.*'
1013
#- id: mixed-line-ending
1114
# args: [ --fix=lf ]
1215

Makefile

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYSQUARED_VERSION ?= v2.0.0-alpha-25w20
1+
PYSQUARED_VERSION ?= v2.0.0-alpha-25w26-2
22
PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)
33

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

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

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

2831
.PHONY: pre-commit-install
2932
pre-commit-install: uv
@@ -45,13 +48,13 @@ BOARD_MOUNT_POINT ?= ""
4548
VERSION ?= $(shell git tag --points-at HEAD --sort=-creatordate < /dev/null | head -n 1)
4649

4750
.PHONY: install
48-
install: build ## Install the project onto a connected PROVES Kit use `make install BOARD_MOUNT_POINT=/my_board_destination/` to specify the mount point
51+
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
4952
ifeq ($(OS),Windows_NT)
5053
rm -rf $(BOARD_MOUNT_POINT)
51-
cp -r artifacts/proves/* $(BOARD_MOUNT_POINT)
54+
cp -r artifacts/proves/$*/* $(BOARD_MOUNT_POINT)
5255
else
5356
@rm $(BOARD_MOUNT_POINT)/code.py > /dev/null 2>&1 || true
54-
$(call rsync_to_dest,artifacts/proves,$(BOARD_MOUNT_POINT))
57+
$(call rsync_to_dest,artifacts/proves/$*,$(BOARD_MOUNT_POINT))
5558
endif
5659

5760
# install-firmware
@@ -66,15 +69,18 @@ clean: ## Remove all gitignored files such as downloaded libraries and artifacts
6669
##@ Build
6770

6871
.PHONY: build
69-
build: download-libraries mpy-cross ## Build the project, store the result in the artifacts directory
70-
@echo "Creating artifacts/proves"
71-
@mkdir -p artifacts/proves
72-
@echo "__version__ = '$(VERSION)'" > artifacts/proves/version.py
73-
$(call compile_mpy)
74-
$(call rsync_to_dest,.,artifacts/proves/)
75-
@$(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')]"
76-
@echo "Creating artifacts/proves.zip"
77-
@zip -r artifacts/proves.zip artifacts/proves > /dev/null
72+
build: build-flight-software build-ground-station ## Build all projects
73+
74+
.PHONY: build-*
75+
build-%: download-libraries-% mpy-cross ## Build the project, store the result in the artifacts directory
76+
@echo "Creating artifacts/proves/$*"
77+
@mkdir -p artifacts/proves/$*
78+
@echo "__version__ = '$(VERSION)'" > artifacts/proves/$*/version.py
79+
$(call compile_mpy,$*)
80+
$(call rsync_to_dest,src/$*,artifacts/proves/$*/)
81+
@$(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')]"
82+
@echo "Creating artifacts/proves/$*.zip"
83+
@zip -r artifacts/proves/$*.zip artifacts/proves/$* > /dev/null
7884

7985
define rsync_to_dest
8086
@if [ -z "$(1)" ]; then \
@@ -87,7 +93,7 @@ define rsync_to_dest
8793
exit 1; \
8894
fi
8995

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

9399
##@ Build Tools
@@ -96,7 +102,7 @@ $(TOOLS_DIR):
96102
mkdir -p $(TOOLS_DIR)
97103

98104
### Tool Versions
99-
UV_VERSION ?= 0.5.24
105+
UV_VERSION ?= 0.7.13
100106
MPY_CROSS_VERSION ?= 9.0.5
101107

102108
UV_DIR ?= $(TOOLS_DIR)/uv-$(UV_VERSION)
@@ -136,5 +142,5 @@ endif
136142
endif
137143

138144
define compile_mpy
139-
@$(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
145+
@$(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
140146
endef

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# ProvesKit RP2040 v4 CircuitPython Flight Software
1+
# ProvesKit RP2040 v4 CircuitPython Flight Software and Ground Station
22

33
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
44
![CI](https://github.com/proveskit/CircuitPython_RP2040_v4/actions/workflows/ci.yaml/badge.svg)
55

6-
This is the reference software for the v4x PROVES Kit Flight Controller boards. Clone this repository and use the `make install ...` tooling to get your v4x Flight Controller Board up and running!
6+
This is the reference software for the v4x PROVES Kit Flight Controller boards. Clone this repository and use the `make install-flight-software ...` tooling to get your v4x Flight Controller Board up and running!
7+
8+
If your are looking to setup ground station software you can use `make install-ground-station` to get simple receiver software running!
79

810
# Development Getting Started
911
We welcome contributions, so please feel free to join us. If you have any questions about contributing please open an issue or a discussion.

config.json

Lines changed: 80 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,84 @@
11
{
2-
"cubesat_name": "Orpheus",
3-
"last_battery_temp": 20.0,
4-
"sleep_duration": 30,
5-
"detumble_enable_z": true,
6-
"detumble_enable_x":true,
7-
"detumble_enable_y": true,
8-
"jokes": [
9-
"Hey it is pretty cold up here, did someone forget to pay the electric bill?",
10-
"sudo rf - rf*",
11-
"Why did the astronaut break up with his girlfriend? He needed space.",
12-
"Why did the sun go to school? To get a little brighter.",
13-
"why is the mall called the mall? because instead of going to one store you go to them all",
14-
"Alien detected. Blurring photo...",
15-
"Wait it is all open source? Always has been... www.github.com/proveskit",
16-
"What did 0 say to 1? You're a bit too much.",
17-
"Pleiades - Orpheus has been recently acquired by the Onion News Network",
18-
"This jokesat was brought to you by the Bronco Space Ministry of Labor and Job Placement",
19-
"Catch you on the next pass!",
20-
"Pleiades - Orpheus was not The Impostor",
21-
"Sorry for messing with your long-exposure astrophoto!",
22-
"Better buy a telescope. Wanna see me. Buy a telescope. Gonna be in space.",
23-
"According to all known laws of aviation, there is no way bees should be able to fly...",
24-
"You lost the game ",
25-
"Bobby Tables is a good friend of mine",
26-
"Why did the computer cross the road? To get a byte to eat!",
27-
"Why are the astronauts not hungry when they got to space? They had a big launch.",
28-
"Why did the computer get glasses? To improve its web sight!",
29-
"What are computers favorite snacks? Chips!",
30-
"Wait! I think I see a White 2019 Subaru Crosstrek 2.0i Premium",
31-
"IS THAT A SUPRA?!",
32-
"Finally escpaed the LA Traffic",
33-
"My CubeSat is really good at jokes, but its delivery is always delayed.",
34-
"exec order 66",
35-
"I had a joke about UDP, but I am not sure if you'd get it.",
36-
"I am not saying FSK modulation is the best way to send jokes, but at least it is never monotone!",
37-
"I am sorry David, I am afrain I can not do that.",
38-
"My memory is volatile like RAM, so it only makes sense that I forget things.",
39-
"Imagine it gets stuck and just keeps repeating this joke every 2 mins",
40-
"Check Engine: Error Code 404: Joke Not Found",
41-
"CQ CQ KN6NAQ ... KN6NAT are you out there?",
42-
"Woah is that the Launcher Orbiter?????",
43-
"Everything in life is a spring if you think hard enough!"
44-
],
45-
"debug": true,
46-
"heating": false,
47-
"normal_temp": 20,
48-
"normal_battery_temp": 1,
49-
"normal_micro_temp": 20,
50-
"normal_charge_current": 0.5,
51-
"normal_battery_voltage": 6.9,
52-
"critical_battery_voltage": 6.6,
53-
"battery_voltage": 5.2,
54-
"current_draw": 240.5,
55-
"reboot_time": 3600,
56-
"longest_allowable_sleep_time": 600,
57-
"turbo_clock": false,
58-
"radio": {
59-
"license": "",
60-
"receiver_id": 250,
61-
"sender_id": 251,
62-
"start_time": 80000,
63-
"transmit_frequency": 437.4,
2+
"battery_voltage": 5.2,
3+
"critical_battery_voltage": 6.6,
4+
"cubesat_name": "PROVES-MY_SATELLITE_NAME",
5+
"current_draw": 240.5,
6+
"debug": true,
7+
"detumble_enable_x": true,
8+
"detumble_enable_y": true,
9+
"detumble_enable_z": true,
10+
"heating": false,
11+
"jokes": [
12+
"Hey it is pretty cold up here, did someone forget to pay the electric bill?",
13+
"sudo rf - rf*",
14+
"Why did the astronaut break up with his girlfriend? He needed space.",
15+
"Why did the sun go to school? To get a little brighter.",
16+
"why is the mall called the mall? because instead of going to one store you go to them all",
17+
"Alien detected. Blurring photo...",
18+
"Wait it is all open source? Always has been... www.github.com/proveskit",
19+
"What did 0 say to 1? You're a bit too much.",
20+
"Pleiades - Orpheus has been recently acquired by the Onion News Network",
21+
"This jokesat was brought to you by the Bronco Space Ministry of Labor and Job Placement",
22+
"Catch you on the next pass!",
23+
"Pleiades - Orpheus was not The Impostor",
24+
"Sorry for messing with your long-exposure astrophoto!",
25+
"Better buy a telescope. Wanna see me. Buy a telescope. Gonna be in space.",
26+
"According to all known laws of aviation, there is no way bees should be able to fly...",
27+
"You lost the game ",
28+
"Bobby Tables is a good friend of mine",
29+
"Why did the computer cross the road? To get a byte to eat!",
30+
"Why are the astronauts not hungry when they got to space? They had a big launch.",
31+
"Why did the computer get glasses? To improve its web sight!",
32+
"What are computers favorite snacks? Chips!",
33+
"Wait! I think I see a White 2019 Subaru Crosstrek 2.0i Premium",
34+
"IS THAT A SUPRA?!",
35+
"Finally escpaed the LA Traffic",
36+
"My CubeSat is really good at jokes, but its delivery is always delayed.",
37+
"exec order 66",
38+
"I had a joke about UDP, but I am not sure if you'd get it.",
39+
"I am not saying FSK modulation is the best way to send jokes, but at least it is never monotone!",
40+
"I am sorry David, I am afrain I can not do that.",
41+
"My memory is volatile like RAM, so it only makes sense that I forget things.",
42+
"Imagine it gets stuck and just keeps repeating this joke every 2 mins",
43+
"Check Engine: Error Code 404: Joke Not Found",
44+
"CQ CQ KN6NAQ ... KN6NAT are you out there?",
45+
"Woah is that the Launcher Orbiter?????",
46+
"Everything in life is a spring if you think hard enough!",
47+
"Your Mom",
48+
"Your Mum",
49+
"Your Face",
50+
"not True lol",
51+
"I have brought peace, freedom, justice, and security to my new empire! Your New Empire?"
52+
],
53+
"last_battery_temp": 20.0,
54+
"longest_allowable_sleep_time": 600,
55+
"normal_battery_temp": 1,
56+
"normal_battery_voltage": 6.9,
57+
"normal_charge_current": 0.5,
58+
"normal_micro_temp": 20,
59+
"normal_temp": 20,
60+
"radio": {
61+
"fsk": {
62+
"broadcast_address": 255,
63+
"modulation_type": 0,
64+
"node_address": 1
65+
},
66+
"license": "KK4PDM",
6467
"lora": {
65-
"ack_delay": 0.2,
66-
"coding_rate": 8,
67-
"cyclic_redundancy_check": true,
68-
"max_output": true,
69-
"spreading_factor": 8,
70-
"transmit_power": 23
68+
"ack_delay": 0.2,
69+
"coding_rate": 8,
70+
"cyclic_redundancy_check": true,
71+
"max_output": true,
72+
"spreading_factor": 8,
73+
"transmit_power": 23
7174
},
72-
"fsk": {
73-
"broadcast_address": 255,
74-
"node_address": 1,
75-
"modulation_type": 0
76-
}
77-
},
78-
"super_secret_code": "ABCD",
79-
"repeat_code": "RP",
80-
"joke_reply": [
81-
"Your Mom",
82-
"Your Mum",
83-
"Your Face",
84-
"not True lol",
85-
"I have brought peace, freedom, justice, and security to my new empire! Your New Empire?"
86-
]
75+
"modulation": "LoRa",
76+
"start_time": 80000,
77+
"transmit_frequency": 437.4
78+
},
79+
"reboot_time": 3600,
80+
"repeat_code": "RP",
81+
"sleep_duration": 30,
82+
"super_secret_code": "ABCD",
83+
"turbo_clock": false
8784
}

0 commit comments

Comments
 (0)