Skip to content

fix(pi): run one novaGround unit per environment so the backend port … - #14

Merged
Awesome-Ace22 merged 2 commits into
devfrom
bugfix/backend-port-fix
Oct 24, 2026
Merged

Awesome-Ace22 merged 2 commits into
devfrom
bugfix/backend-port-fix

Conversation

@Awesome-Ace22

@Awesome-Ace22 Awesome-Ace22 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What and why

This pull request introduces a major refactor of how novaGround is configured and run on the Pi, moving from a single systemd service and config file to a per-environment (prod/dev) model. It also adds a timer-based reporting mechanism for Pi status and clarifies the configuration and operation in the documentation and scripts.

fixes UTATRocketry/Nova-Collected#29

The most important changes are:

Systemd Service Architecture and Configuration:

  • Replaces the single novaGround.service with a template unit novaGround@.service, allowing separate instances for prod and dev environments. Each instance reads its settings from /etc/nova/pi.env (Pi identity and binary) and /etc/nova/novaGround-<env>.env (broker/backend, written by the ops PC), preventing accidental misconfiguration and making switching environments explicit. [1] [2] [3] [4] [5] [6] [7] [8]

Bench Session Handling and Environment Selection:

  • Updates run.sh to select the environment (--env prod|dev), read settings from the correct files, and refuse to run if either service is active, eliminating conflicts and making bench work safer and more predictable.

Automated Pi State Reporting:

  • Adds nova-pi-report.service and nova-pi-report.timer, which periodically (every 15s) report the Pi’s state (including which novaGround is running, backend status, and last upload) to the Nova Console, improving fleet monitoring and diagnostics. [1] [2] [3]

Installer and Workflow Updates:

  • Refactors install.sh to only ask for Pi identity and target binary, delegating broker/backend configuration to the ops PC. The installer now registers both prod and dev services, and documents the migration path from the old single-service setup. [1] [2] [3] [4]

Documentation and Housekeeping:

  • Updates README.md and docs/setup.md to reflect the new multi-environment setup, clarify troubleshooting, and document the new configuration and reporting mechanisms. Also adds .timer to .gitattributes for proper line endings. [1] [2] [3] [4] [5]

These changes modernize the deployment, make environment switching robust, and improve observability of Pi status.

How was this tested?

  • 1 Unit / Automated Test - CI
  • 2 Simulator Test - testing procedure with the hardware simulators
  • 3 Bench Test - testing procedure on the dev stack, with some real hardware
  • 4 Integration Test - full engine test procedure, real hardware, no propellants

Hardware impact

  • None - UI, docs or tooling only
  • Changes how a sensor is read, converted or shown
  • Changes how an actuator is commanded, or safety rules, interlocks, timeouts or sequencing → add the hardware-risk label; a lead must approve
  • Changes a message format, MQTT topic or FAS protocol that another repo depends on → title needs !, link the matching PRs:

impacts deployment, releasing, and data saving

UTATRocketry/Nova-Collected/pull/#36

Checklist

  • Targets dev (or main for a release/hotfix, or with a reason given above)
  • Branch is up to date ("Update branch" button)
  • No station config/calibrations, data files, secrets, .env files or build output committed
  • README/docs updated if behaviour changed

…follows the stack

Refactor novaGround service management and upload functionality

- Remove the old novaGround.service file and replace it with a new template service file (novaGround@.service) that supports multiple environments (prod and dev).
- Update run.sh to allow selection of the environment and ensure proper configuration loading from environment-specific files.
- Enhance data_file_controller to log upload results and check backend health in a separate thread.
- Modify upload_file function to return detailed upload results, including HTTP status and error messages.
- Improve start.sh to validate environment and configuration before execution, preventing conflicts between prod and dev instances.
@Awesome-Ace22
Awesome-Ace22 requested a review from a team as a code owner October 24, 2026 14:33
@Awesome-Ace22
Awesome-Ace22 marked this pull request as draft October 24, 2026 14:34
@Awesome-Ace22 Awesome-Ace22 added hardware-risk Can move hardware: actuators, safety rules, interlocks, timeouts, sequencing needs-hardware-test Waiting for a Bench (3) or Integration (4) test labels Oct 24, 2026
@Awesome-Ace22
Awesome-Ace22 marked this pull request as ready for review October 24, 2026 14:50
@Awesome-Ace22
Awesome-Ace22 merged commit f46886a into dev Oct 24, 2026
15 of 20 checks passed
@Awesome-Ace22
Awesome-Ace22 deleted the bugfix/backend-port-fix branch October 24, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-risk Can move hardware: actuators, safety rules, interlocks, timeouts, sequencing needs-hardware-test Waiting for a Bench (3) or Integration (4) test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

novaGround's backend port lives in a hand-edited file and doesn't change with stack

1 participant