* fix(logger): make off stop active file logging
Handle logger on and off as explicit requests so logger off closes an active file log without disabling future automatic activations. Continuous logging modes fall back to arm-to-disarm sessions until reboot after their active log is stopped.
Assisted-by: Codex:gpt-5
Signed-off-by: jc-works <jc-works@users.noreply.github.com>
* fix(logger): keep the configured log mode on manual stop
Falling back to LogMode::while_armed by overwriting _log_mode destroyed the
configured mode for the rest of the boot, and nothing reported it: neither
logger status nor LoggerStatus carries the mode.
Only boot_until_shutdown needs the fallback at all, because its early return
would otherwise keep logging disabled once the boot log is stopped. Express
that with a dedicated flag so _log_mode stays the configured value, and say so
on the console when it happens.
arm_until_shutdown needs no fallback. After the forced stop
_prev_file_log_start_state is false, so full_log_continues is false and the
desired state falls back to plain arming. The next arming starts a log and sets
the flag again, so the following disarm keeps logging to shutdown as configured
instead of ending the log early.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(logger): restore SDLOG_MODE 2 logging behaviour after rearming
After logger off stops a boot-to-shutdown log, suspend automatic logging only until the next arming. Restore the configured lifecycle when the new log starts so it continues across subsequent disarms until shutdown.
Update the logger message and documentation accordingly.
Assisted-by: Codex:gpt-5
Signed-off-by: jc-works <jc-works@users.noreply.github.com>
* fix(logger): make repeated off requests idempotent
Regression testing found that repeating logger off after the active log had closed cleared the manual stop latch. When the arming or AUX logging condition remained active, automatic logging started a new log.
Preserve the manual stop latch across repeated off requests so logging remains stopped until the automatic logging condition deactivates. The latch is also cleared explicitly by logger on.
Assisted-by: Codex:gpt-5
Signed-off-by: jc-works <jc-works@users.noreply.github.com>
---------
Signed-off-by: jc-works <jc-works@users.noreply.github.com>
Signed-off-by: Julian Oes <julian@oes.ch>
Co-authored-by: jc-works <jc-works@users.noreply.github.com>
Co-authored-by: Julian Oes <julian@oes.ch>
On NuttX these are two things: / is the filesystem root, and /fs/microsd is the
SD card mounted under it. MAVLink FTP serves the root and confines writes to the
SD card, so the read-only ROMFS at /etc is visible but cannot be written.
On POSIX they were the same directory. PX4_ROOTFSDIR and PX4_STORAGEDIR both
resolved to CONFIG_BOARD_ROOT_PATH, which on SITL is ".", so the working
directory was simultaneously the FTP root and the only writable area. The
consequences were that the ROMFS symlink sat inside the FTP root, and that
_validatePathIsWritable() had nothing meaningful to check against and so was
compiled out on POSIX entirely, leaving no write restriction at all.
Give POSIX the same split. CONFIG_BOARD_ROOT_PATH keeps its meaning as the
storage directory, and a new CONFIG_BOARD_FS_ROOT_PATH names the root FTP
serves, defaulting to the storage path so every existing board is unchanged.
SITL sets the root to "." and storage to "./fs", which mirrors NuttX: logs,
parameters, dataman and eeprom move under ./fs, and etc/ stays in the root as
read-only data.
With storage distinct from the root, the write restriction now applies on every
platform rather than NuttX only, and no longer compares against a hardcoded
prefix length that was wrong for any board not using /fs/microsd.
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Julian Oes <julian@oes.ch>
* docs(docs): Add missing uorb topics sidebar
* docs(docs): discontinue cuav v5 plus/nano
* docs(docs): Fix 404 and 303 status HTTP links
* docs(docs): more link fixes
* update(drivers): Docs fix to fix up link
* docs(docs): Fix up all remaining broken links and add exclusions
* feat(logger): append topics defined in logger_topics.txt instead of replacing logging profile
* docs(logger): Explain how logger_topics.txt topics are being used
* refactor(logger): squash initialize functions into a single one
* docs(docs): Subedit
---------
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Make the logger practical on small flash storage (e.g. 128 MB W25N
NAND) while keeping the existing SD-card behaviour sensible.
- Move cleanup from boot to log start so logs can be downloaded via
MAVLink FTP before deletion.
- Delete individual .ulg files (oldest first) instead of whole
directories, prioritising the naming scheme not currently in use
(session dirs vs date dirs).
- Add SDLOG_MAX_SIZE (new, default 1024 MB): maximum size of a single
log file. When reached, the log rotates to a new file. The value is
also reserved as headroom in the cleanup threshold.
- Add SDLOG_ROTATE (new, default 90): maximum disk usage percentage.
Cleanup guarantees (100 - SDLOG_ROTATE)% free at all times, even
during writing of a new log file. 0 disables space-based cleanup,
100 allows filling the disk.
- Repurpose SDLOG_DIRS_MAX as an orthogonal directory-count cap
(default 0 = disabled). Useful for capping log usage by count
independent of disk size, e.g. in SITL.
- Drop the implicit ~300 MB free-space floor that used to fire even
with SDLOG_DIRS_MAX=0; space is now governed entirely by
SDLOG_ROTATE + SDLOG_MAX_SIZE.
- Split pure parsing helpers into util_parse.{h,cpp} and add unit
tests (loggerUtilTest.cpp).
- Simplify get_log_time to rely on clock_gettime (set by the GPS
driver); safer string handling in directory parsing.
- Reset _total_written in LogFileBuffer::reset() so callers reading
get_total_written() between stop and start don't see stale counts.
Sponsored by CubePilot.
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>