Skip to content

ESP/Log: Buffer uploads in RAM and make Pipi thread-safe - #171

Merged
ao-david merged 2 commits into
speaker/pr07-runtime-hardeningfrom
speaker/pr08-log-buffering
Oct 29, 2026
Merged

ao-david merged 2 commits into
speaker/pr07-runtime-hardeningfrom
speaker/pr08-log-buffering

Conversation

@ao-david

Copy link
Copy Markdown
Member

Stacked on #170.

  • Add allocation-free JSON formatting and a log() overload to Pipi so the logging task can populate an upload buffer without touching SD.
  • Protect FileLogger file state with a mutex now that log writing and rotation can happen from different tasks.
  • Serve the NetSender log pin from an 8 KiB in-memory buffer populated by the logging task, and rotate the on-disk log periodically from that task.
  • Keep the logging task on core 0 below audio priority.

This removes log file rotation and reads from the HTTP poll path.

Add Entry::format() and a FileLogger::log() overload so callers can obtain
the JSON form of a log without writing it to disk. Protect the logger's file
state with a mutex now that log rotation and writing can occur from different
tasks.
Serve the NetSender log pin from an in-memory buffer populated by the logging
task, so polling no longer rotates or reads log files from SD. Rotate the
on-disk log periodically from the logging task instead. Pin the logging task
to core 0 at a lower priority than audio.
@ao-david
ao-david added this pull request to stack #173 October 29, 2026 06:47
@ao-david
ao-david merged commit 296a596 into main Oct 29, 2026
2 of 3 checks passed
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.

1 participant