Skip to content

Conversation

@messplay
Copy link

No description provided.

messplay and others added 5 commits June 11, 2025 17:01
…l-proyecto

Enable RTCM SD logging with daily rotation
This feature allows users to save incoming serial (UART) data to an SD card.

Key changes:
- Added functionality to `sd_logger.c` to initialize an SD card,
  write data to daily log files (YYYYMMDD.rtcm), and handle
  automatic file rotation at midnight.
- Integrated SD logging with UART data by an event handler that
  writes data when `UART_EVENT_READ` is triggered.
- Modified `main/web_server.c` to include new HTTP endpoints:
    - GET `/sdlog/status`: Returns current SD logging status and card mount state.
    - POST `/sdlog/toggle`: Allows runtime enabling/disabling of SD logging.
- Updated `www/index.html`:
    - Added a new "SD Card Logging" section in the web interface.
    - Included a toggle switch to control SD logging.
    - Displays current logging status and SD card mount status.
    - JavaScript handles switch toggling and status updates via the new API endpoints.
- Added `KEY_CONFIG_SD_LOG_ACTIVE` to `config.c` to persist the
  logging preference across reboots.
- Enhanced error logging for SD card operations.
Se agrega la funcionalidad para guardar los datos recibidos por el puerto serie
en una tarjeta SD.

Características principales:
- Un nuevo interruptor en la interfaz web permite al usuario activar o
  desactivar la función de registro en la SD.
- Los archivos de registro se guardan con el formato YYYYMMDD.rtcm.
- Las grabaciones se dividen automáticamente a las 00:00 de cada día,
  creando un nuevo archivo para el nuevo día.

Cambios realizados:
- Se añadió un elemento de interfaz de usuario en `www/index.html` para
  controlar la activación del registro SD.
- Se modificó `main/uart.c` para llamar a `sd_logger_write` y así
  escribir los datos del UART en la SD cuando la función está activa.
- La funcionalidad existente en `main/sd_logger.c` y `main/include/config.h`
  ya soportaba la activación por configuración y la rotación de archivos
  diaria, por lo que no se necesitaron cambios mayores en esos archivos
  más allá de asegurar la correcta integración.
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