Add set_next_code_file command for over-the-air code updates via supervisor module #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Enables mission operators to change the satellite's startup code file using CircuitPython's
supervisor.set_next_code_file()API, supporting safer over-the-air updates by allowing fallback to known-good code.Implementation
cdh.py
set_next_code_filecommand that validates filename argument, callssupervisor.set_next_code_file(), and triggers automatic resetchange_radio_modulation)Testing
supervisormock for CPython test environmentDemo
examples/watchdog_demo.py- minimal demonstration script that prints status every 1 secondexamples/README.md- usage documentationUsage
{ "password": "<password>", "name": "<satellite_name>", "command": "set_next_code_file", "args": ["watchdog_demo.py"] }Satellite responds with acknowledgement, resets, and executes specified file instead of default
code.py.References
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.shcurl -LsSf REDACTED(dns block)https://api.github.com/repos/adafruit/adafruit_circuitpython_asyncio/commits/1.3.3tools/uv-0.8.14/uv pip install --requirement pyproject.toml(http block)https://api.github.com/repos/proveskit/Adafruit_CircuitPython_TCA9548A/commits/1.1.0tools/uv-0.8.14/uv pip install --requirement pyproject.toml(http block)https://api.github.com/repos/proveskit/CircuitPython_SX1280/commits/1.0.4tools/uv-0.8.14/uv pip install --requirement pyproject.toml(http block)https://api.github.com/repos/proveskit/micropySX126X/commits/1.0.0tools/uv-0.8.14/uv pip install --requirement pyproject.toml(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
cdh.pyto Reset the Satellite with a New Initial Code File #216💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.