The previous cleanup logic conflated two independent concerns into
SDLOG_MAX_SIZE: the maximum size of a single log file (rotation
trigger) AND the minimum free space to maintain. That was broken:
the 4095 MB default meant "keep 4 GB free", which over-cleaned on
large SD cards and was impossible to satisfy on small flash.
Disentangle the two:
- SDLOG_ROTATE (new, int %, default 90): maximum disk usage percentage.
Cleanup guarantees at least (100 - SDLOG_ROTATE)% free even during
writing of a new log file. Setting 0 disables space-based cleanup;
100 allows filling the disk completely.
- SDLOG_MAX_SIZE (default lowered from 4095 to 1024): pure max file
size. The value is added on top of the rotate-derived threshold as
headroom for the next file write, so the rotate guarantee holds
even mid-write.
- SDLOG_DIRS_MAX: removed. Directory count limits were confusing and
orthogonal to the space-management goal; free-space cleanup alone
covers the use case. Drop the param and all remaining overrides
(rc.board_defaults, rcS, rc.replay, 1002_standard_vtol.hil).
Cleanup threshold is now:
((100 - SDLOG_ROTATE)% of disk) + SDLOG_MAX_SIZE
Small-flash boards can override SDLOG_MAX_SIZE to get more retained
logs within the available space. kakuteh7v2 and airbrainh743 drop
their SDLOG_DIRS_MAX overrides accordingly.
Update docs/en/dev_log/logging.md with the new semantics and a
worked example for the typical 8 GB SD case.
Move log cleanup from boot to log start, delete individual .ulg files
(oldest first) instead of entire directories, and add a max log file
size. This makes it practical to run the logger on small flash targets
(e.g. 128 MB W25N NAND) while still allowing logs to be downloaded via
MAVLink FTP before they are removed.
- Move cleanup from boot to log start so logs can be downloaded first.
- Delete individual .ulg files (oldest first) instead of whole dirs.
- Add SDLOG_MAX_SIZE parameter (default 4095 MiB, just under FAT32 limit).
- Prioritize directories from the naming scheme not currently in use
(e.g. delete sess dirs first when using date dirs).
- Simplify get_log_time to rely on clock_gettime (GPS driver sets it).
- Safer string handling in directory parsing.
- Log elapsed cleanup time for diagnostics.
- Split pure parsing helpers into util_parse.{h,cpp} and add unit tests
(loggerUtilTest.cpp). Move px4_add_unit_gtest outside the BUILD_TESTING
guard for consistency with the rest of the tree; the macro already
checks BUILD_TESTING internally.
Sponsored by CubePilot.
* Remove support for MAVLink 1
* Add back support for MAVLink 1 but don't default to it
* Update src/modules/mavlink/mavlink_params.c
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
---------
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Note: Some files are autogenerated and I did not yet
go through each source of generation to fix it there.
Instead I adjusted the filter to only exclude those
such that we can fix things in steps.
* Update ulog_file_format.md
Update Known Parser Implementations with updated information for Foxglove and the typescript parser
* Update docs/en/dev_log/ulog_file_format.md
* Updated Encrypted logs docs to reflect https://github.com/PX4/PX4-Autopilot/pull/24489
* Subedit
* Subedit the key generation bit
* Updated the docs with multiple command line args for the decryptor and added OpenSSL as a requirement
* Subedit
* Update log_encryption.md
---------
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* Add vitepress tree
* Update existing workflows so they dont trigger on changes in the docs path
* Add nojekyll, package.json, LICENCE etc
* Add crowdin docs upload/download scripts
* Add docs flaw checker workflows
* Used docs prefix for docs workflows
* Crowdin obvious fixes
* ci: docs move to self hosted runner
runs on a beefy server for faster builds
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* ci: don't run build action for docs or ci changes
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* ci: update runners
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* Add docs/en
* Add docs assets and scripts
* Fix up editlinks to point to PX4 sources
* Download just the translations that are supported
* Add translation sources for zh, uk, ko
* Update latest tranlsation and uorb graphs
* update vitepress to latest
---------
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>