Skip to content

Write a lighthouse config file to a swarm with swarm lh write -i - #55

Merged
evoggy merged 1 commit into
mainfrom
evoggy/swarm-lh-write
Oct 16, 2026
Merged

evoggy merged 1 commit into
mainfrom
evoggy/swarm-lh-write

Conversation

@evoggy

@evoggy evoggy commented Oct 16, 2026

Copy link
Copy Markdown
Member

swarm lh write and swarm lh check now take a YAML file with -i/--input, as lh config write -i and lh config check -i do for one Crazyflie:

cfcli swarm lh write -i my_setup.yaml
cfcli swarm lh check -i my_setup.yaml

-i and --config can't be combined; with neither, the configuration the swarm names is used, as before.

Details:

  • The configuration is now loaded before the Crazyradios are opened (lighthouse::wanted(), then lighthouse::run()), so a missing or bad file fails at once with its own error.
  • When swarm lh check finds Crazyflies that differ, the swarm lh write it suggests now includes the --config or -i that was given. Before, it always suggested plain swarm lh write, which writes the configuration the swarm names.
  • docs/swarm.md mentions -i.

Testing

On the fishtank swarm (CF-05 to CF-09, one Crazyradio, base stations 4-7 on):

  • Read CF-05's configuration with lh config read -o. swarm lh check -i on that file found all 5 up to date, and swarm lh write -i skipped all 5 as up to date.
  • With a copy where BS 4 was moved 3 cm, check -i reported "BS 4 moved 3.0 cm" for all 5 and exited with 60, and its hint named the -i file. write -i --cf CF-05 wrote it, and a check afterwards found CF-05 up to date and CF-06 still differing.
  • swarm lh write --cf CF-05 put the swarm's configuration back, and all 5 were up to date again.
  • Without a Crazyradio: a missing file and a file that isn't YAML fail with their own error, and --config with -i is refused.
  • Unit tests pass.

Closes #42

Like 'lh config write -i' for one Crazyflie, 'swarm lh write' and
'swarm lh check' take a YAML file with -i/--input instead of the stored
config the swarm names. The config is loaded before the radios open, so
a bad file fails at once, and the check hint to write it names the same
--config or -i.

Closes #42
@evoggy
evoggy merged commit 3e5fba7 into main Oct 16, 2026
1 check passed
@evoggy evoggy mentioned this pull request Oct 16, 2026
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.

Enable writing LH config files directly to swarm

1 participant