Repository navigation
Conversation
Scan, select, param, log, console, platform info and hlc go through the connection server's client API, so they work directly with this computer's Crazyradios or through a connection server, chosen with --connection, CRAZYFLIE_CONNECTION or 'settings connection'. The default, auto, uses a server on this computer if one runs, else the Crazyradios. 'cfcli server run' runs a standalone connection server and 'cfcli server list' shows the Crazyflies it holds and the programs attached to them. The swarm runner keeps its own connecting and hands each connection to an in-process server, so swarm param, log and platform info share the code of the single Crazyflie commands. Commands not ported yet use crazyflie-lib directly and fail with a clear error while a server holds the Crazyradios. crazyflie-connection-server is a path dependency for now.
bootload flash sends the STM32 and nRF51 firmware to the server's flash job. Deck firmware is skipped with a note; the nRF51 bootloader+softdevice and --cold still need --connection direct.
The swarm runner attaches through the client API in every mode; in direct mode it still plans the radios and pins each Crazyflie. Through a server swarm scan, platform (also reboot, power off, sleep, wake up), param, log, debug assert, config add --scan and bootload flash (one job per platform) work. Deck list, lh, rechannel, bootload info and reprogramming stay direct only, with a clear error. The single-Crazyflie platform commands and debug assert use the client too, server list shows the radio, and log print reports why its stream ended.
deck list, lh config, config, mem, swarm deck list and swarm lh use the client's memories, so they work through a connection server too. The EEPROM writes of rechannel and reprogramming go through the client; both stay direct only for the reboot onto the new link. Displaying a deck memory still uses crazyflie-lib.
hlc trajectory and loco use the client's trajectory and Loco memories and LPP packets, so they work through a connection server too.
The swarm runner no longer handles 8 Crazyflies per radio at a time: the ones already connected keep polling the radio while the next ones connect, so all at once is faster (25 on one radio: 21.6 s to 1.6 s for swarm param get through a server, with the server changes). The bootloader and deck steps keep their own limits. Whether a param is persistent is asked for, through the client API.
cfcli server run caches TOCs in a directory, by default ~/.cache/cf-cli/server-toc-cache, rather than in memory, so a restart doesn't download them again. Not in cfcli's config file: a long-running server would write back the whole config it loaded.
swarm rechannel and the reprogramming in swarm config add reboot each Crazyflie onto its new URI with Client::reboot_to, which returns once the firmware answers there, so they no longer need direct mode. The runner's own wait for a rebooted Crazyflie is gone.
swarm bootload flash connects to each Crazyflie to read its platform. One the server reports asleep is now powered on and attached again, since flashing restarts it anyway.
It connects a Crazyflie with fewer round trips: a command on one Crazyflie takes as long as with crazyflie-lib directly again.
The server keeps each Crazyflie's console and `cfcli console` prints it, so the flag was ignored without a word there.
`hlc stop` cuts the thrust but leaves the Crazyflie armed, so a brushless one keeps its motors at idle; the help said it disabled the motors. The trajectory examples and `hlc trajectory display` still pointed at `cfcli trajectory upload` and `cfcli trajectory run`.
It waits for a Crazyflie that is starting instead of calling it asleep, and no longer leaves answers to its version questions for crazyflie-lib to read ("Wrong version answer" right after a restart).
`bootload flash` and `bootload info` (and their swarm versions) in direct mode returned as soon as the Crazyflie had left its bootloader. Its address only answers once its STM32 has started (2.7 s after a restart here) and its firmware a few seconds later, so a command run right after failed. Now they return once it runs its firmware again, or fail after 15 s saying it isn't back. The swarm commands wait for all their Crazyflies at once. A flash through a connection server waited already. `bootload flash` of one Crazyflie takes 21 -> 26 s; the next command then connects in 0.3 s instead of failing.
evoggy
marked this pull request as ready for review
October 29, 2026 21:19
A flash job on a server printed a line for every Crazyflie at every step, which for a swarm scrolled by without saying how far it was. Servers from 0.2.3 count the Crazyflies that finished each step, so swarm bootload flash now shows a bar per step, as it does without a server. Writing an image keeps its byte bar; steps of a single Crazyflie, and those from older servers, stay lines. bootload flash prints each step once instead of again when it is done.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
cfcli reaches the Crazyflies through the client API of crazyflie-connection-server (0.2.3 on crates.io). With a connection server running, several programs use the same Crazyflies at once, for example cfcli setting parameters while Swarmkeeper monitors the swarm, and a server on one computer serves cfcli on others. The connection features are marked experimental.
Where cfcli reaches the Crazyflies
--connection, elseCRAZYFLIE_CONNECTION, elsecfcli settings connection, elseauto:auto(default)directlocal127.0.0.1:7777)host,host:portWithout a server,
autoisdirect: cfcli runs the server in its own process and nothing else reaches it, so cfcli behaves as before. Swarmkeeper serves its connections on127.0.0.1:7777, so with Swarmkeeper running cfcli uses its connections instead of competing for the Crazyradios.New commands
cfcli server run: a standalone server holding this computer's Crazyradios.--listen(default127.0.0.1:7777),--linger(seconds a Crazyflie stays connected after its last client),--toc-cache DIR(TOCs on disk, by default in the cache directory).cfcli server list: the Crazyflies the server holds and the programs attached to them.cfcli settings connection show/set/clear.Through the client API, in every mode
scan(with the programs attached to each Crazyflie),select,param,log,console,platform info/reboot/power-off/sleep/wakeup,debug,deck,lh config,config,mem,loco,hlc(trajectories included).bootload flashof the STM32 and nRF51 runs as a job on the server when one holds the Crazyradios, and the other Crazyflies stay connected. Deck firmware is skipped with a note, and the nRF51 bootloader and softdevice are refused; both need--connection direct.swarm bootload flashis one job per platform (broadcast when the bootloaders support it), wakes Crazyflies that are asleep first and shows a bar per step, counting the Crazyflies that finished it.swarm rechanneland reprogramming inconfig addreboot each Crazyflie onto its new link through the server.bootload flash/info(single and swarm) return once the Crazyflie runs its firmware again (at most 15 s), so the next command finds it running.bootload flashof one Crazyflie takes 26 s instead of 21 s, and one that another program put to sleep takes 5 s to be reported as asleep.Direct mode only
test,platform dfu,bootloadother thanflash,bootload flash --cold,swarm bootload infoandswarm bootload flash --unicast. With a server holding the Crazyradios they stop with exit code 10 and say to use--connection direct.--preserve-consoledoes nothing through a server, which keeps each Crazyflie's console forcfcli console, and says so.Docs
docs/connection-server.md(new, with an experimental warning), a section indocs/settings.md, and the README's command list, options and doc index.Found while testing: the
hlc stophelp said it disables the motors, but the Crazyflie stays armed (a brushless one idles its motors); the trajectory examples andhlc trajectory displaypointed atcfcli trajectory upload/run.Testing
cargo test: 103 pass.param listoutput is byte-identical to cfcli 0.17.0.cfcli server run, from separate processes: log stream, console, scan,server listand param set at the same time. Attaching took 7 ms. Unported commands exit with 10.bootload flashof a release (STM32 and nRF51) through the server: 29 s.swarm scan9 of 9 in 0.44 s;swarm platform info,param get,log print --once9 of 9 in 3–4 s with connecting, 0.4 s while the connections lingeredswarm debug assert,swarm platform reboot(9 of 9 back in 6 s),platform sleep/wakeupswarm bootload flash: 9 of 9 by broadcast in 47 s, and later with 3 of 5 asleep (woken first) in 54 sswarm rechannel: 4 Crazyflies moved from channel 88 to 90swarm config add --scan;config(an EEPROM write of the same values) andlh config writeon one Crazyflieswarm param getin 1.6 s.swarm bootload flash, and the performance comparison below.Performance, direct mode
Against cfcli 0.18.0 built from main (5e5917b), on this computer's Crazyradios, each with its own scratch settings, runs alternating, median of 3 to 10 runs. Outputs are identical.
param get, one Crazyflieparam get, no TOC cacheparam listlog print, 4 variables at 10 ms for 10 sswarm scan, 9 Crazyfliesswarm param get, 9swarm param get, 9, no TOC cacheswarm log print --once, 9With crazyflie-connection-server 0.2.0 a command on one Crazyflie took 40 ms longer (0.32 s) and 300 ms longer without the TOC cache (extra round trips while connecting); 0.2.1 fixes that. With 0.2.0 on 25 Crazyflies on two Crazyradios:
swarm scan0.33 → 0.16 s,swarm param get1.40 → 1.33 s,swarm log print --once1.70 → 1.34 s. Peak memory is about 2.5 MB higher for one Crazyflie and 5–12 MB for a swarm.Hardware, direct and local
The fishtank (9 Crazyflie 2.1 Brushless, release 2026.10, Lighthouse and Color LED decks, channel 90) on this computer's 2 Crazyradios, once in direct mode and once through
cfcli server runon this computer (--connection local):hlc arm(motors to idle),disarm,stop,trajectory uploadof figure8 and square to two offsets, read back withmem verifyand identical to the YAML;trajectory displayof memory and of a file. No takeoff, land, goto or trajectory run.platform info,reboot,sleep,wakeup, single and swarm; asleep Crazyflies are reported as asleep. Direct only:platform dfu(no USB: clear error,platform rebootbrings it back).config display/set(same values),lh config read/write/checkandswarm lh write/check(a changed calibration written, checked, written back),deck list,mem,loco,debug assert,console,swarm param/log.bootload flashof the STM32 and nRF51 from the 2026.10 zip: direct 21 s, through the server 26 s;swarm bootload flashof 2 through the server by broadcast in 52 s, one of them asleep and woken first; direct only:swarm bootload flash --unicast(2 in 42 s),bootload info,swarm bootload info.swarm rechannel(90 → 88 → 90) andswarm config add --set-channelin both modes.Found and fixed (crazyflie-connection-server 0.2.2 and this PR):
swarm bootload info(0.17.0: none), and now and then on the first connect after a few idle minutes, in both modes. Fixed in 0.2.2: no "Wrong version answer" since, in three repeats of that sequence and the reboots and flashes in both modes, and no slower (one Crazyflie 0.316 → 0.318 s, 9 Crazyflies 0.730 → 0.738 s, 3 Crazyflies 0.450 → 0.454 s).swarm bootload infoon 9, 0.17.0 reached 8 and the PR none). After a reboot a Crazyflie 2.1 Brushless here acks at its address at 2.7 s (once its STM32 has set it) and its firmware answers at about 5.1 s. With 0.2.2 and the waits above, a command right afterbootload info, a flash (single, unicast, broadcast) orplatform wakeupconnects (0.3 s once the restart was waited for), a connect as soon as a rebooting Crazyflie acks waits 2.7 s and connects, a Crazyflie that is off still fails in 1.2 s, and an asleep one after 5.1 s.--connection directwithradio://0/…said the Crazyflie doesn't answer; now that the Crazyradio is in use.Open:
platform rebootof a Crazyflie that comes back at another address (recovering from the nRF51 lost-address bug at E7E7E7E7E7) reports after 15 s that it didn't come back, although it did.bootload flash --coldandplatform power-off(need someone at the Crazyflies).