Skip to content

Conversation

joaoantoniocardoso
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso commented Oct 13, 2025

This should allow us to set MAV_SYSTEM_ID via env var in /root/.config/blueos/bootstrap/startup.json.

Helps #3591

How to test

To test it:

  1. Change SYSID_THISMAV parameter to 2
  2. Add the following to your /root/.config/blueos/bootstrap/startup.json:
"environment": [
  "MAV_SYSTEM_ID=2"
]

Then, open MAVLink-Server UI (http://blueos-avahi.local:8080) and check the SYS ID:

image

Copy link

sourcery-ai bot commented Oct 13, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR enhances the start-blueos-core bootstrap script to read an optional MAV_SYSTEM_ID from the environment and inject it into the startup JSON configuration during initialization.

File-Level Changes

Change Details Files
Enable MAV_SYSTEM_ID override via environment variable
  • Check for MAV_SYSTEM_ID in the shell environment
  • Inject or replace the MAV_SYSTEM_ID field in the startup JSON
  • Fallback to existing value when MAV_SYSTEM_ID is unset
core/start-blueos-core

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@joaoantoniocardoso joaoantoniocardoso marked this pull request as draft October 13, 2025 21:17
@joaoantoniocardoso joaoantoniocardoso marked this pull request as ready for review October 14, 2025 00:30
@rmackay9
Copy link

rmackay9 commented Oct 14, 2025

Hi @joaoantoniocardoso,

Thanks very much for this! Does this mean that users will need to manually modify the "/root/.config/blueos/bootstrap/startup.json" file if they've modified the autopilot's MAV_SYSID parameter? Ideally this manual file change wouldn't be necessary because we know that BlueOS can see the autopilot's system id at least once the autopilot has started.

Of course, having anyway to resolve this problem, even if it's a manual file update is still a step forward so my comment above is not meant to be a blocker, just a question

@joaoantoniocardoso
Copy link
Member Author

joaoantoniocardoso commented Oct 14, 2025

Hi @joaoantoniocardoso,

Thanks very much for this! Does this mean that users will need to manually modify the "/root/.config/blueos/bootstrap/startup.json" file if they've modified the autopilot's MAV_SYSID parameter? Ideally this manual file change wouldn't be necessary because we know that BlueOS can see the autopilot's system id at least once the autopilot has started.

Of course, having anyway to resolve this problem, even if it's a manual file update is still a step forward so my comment above is not meant to be a blocker, just a question

Unfortunately, yes.

The other approach I can think of is to make mavlink2rest, mavlink-server, and optionally extensions, dynamically learn the system id.

We could still use the environment variable to pass to extensions, in which case the kraken would have to learn it to inject it to each extension.

@rmackay9
Copy link

Hi @joaoantoniocardoso so I should add something like this at the bottom of the file?

image

@joaoantoniocardoso
Copy link
Member Author

Hi @joaoantoniocardoso so I should add something like this at the bottom of the file?
image

As you can imagine, that change could be made into an API, called from the UI.

@rmackay9
Copy link

rmackay9 commented Oct 14, 2025

@joaoantoniocardoso,

So I tried to test this but I wasn't able to see a difference. I made the above shown change to the, "/root/.config/blueos/bootstrap/startup.json" file but I'm unsure how I can pull in the change from this PR to the BlueOS running on my RPI. I tried using the "BlueOS Version" screen in BlueOS but couldn't figure out what the "Remove repository" should be. I also looked around for the "/core/start-blueos-core" file but I couldn't find it. Please excuse my ignorace on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants