Difference between revisions of "Maintenance"

From bcmeter.org
Jump to navigation Jump to search
(Polish English manual/wiki wording)
(Restructure: platform separation (ESP32 commercial prioritised, Raspberry Pi DIY in own section); verified against firmware/Pi source; complete serial command list)
 
Line 32: Line 32:
# Wait for "Calibration Successful" before starting a new log.
# Wait for "Calibration Successful" before starting a new log.


'''Technical detail:''' Calibration determines the per-channel correction factor K = Ref_avg / Sen_avg and stores it with the LED duty cycle values. Current ESP32 builds use ADS1220 block averaging for the optical readings. Calibration typically takes 30–60 seconds.
'''Technical detail:''' Calibration determines the per-channel correction factor K = Ref_avg / Sen_avg and stores it with the LED duty cycle values. Calibration typically takes 30–60 seconds.


=== Data Management ===
=== Data Management ===
Data is stored on the device's internal flash storage (LittleFS) and persists across reboots.


Click '''Log Files''' to open the data manager. The modal lists all stored sessions:
Click '''Log Files''' to open the data manager. The modal lists all stored sessions:
Line 43: Line 41:
! Column !! Description
! Column !! Description
|-
|-
| '''Log''' || Session name or filename (e.g., <code>bcmeter_20260312_2126.csv</code>). "Current Session" shows the active log.
| '''Log''' || Session name or filename (e.g., <code>26-03-12_212600.csv</code>). "Current Session" shows the active log.
|-
|-
| '''Size''' || File size in KB, or number of data points for the current session.
| '''Size''' || File size in KB, or number of data points for the current session.
Line 57: Line 55:


'''Backup:''' Internal storage is not archival. Download data to a secure location regularly.
'''Backup:''' Internal storage is not archival. Download data to a secure location regularly.
'''Storage management:''' The device has ~2 MB internal flash for logs. Warning at 512 KB free, critical at 32 KB. Old logs are auto-deleted when critical threshold is reached. Empty files are cleaned on startup.


=== Device Management ===
=== Device Management ===
Line 73: Line 69:
* '''Reboot Device:''' Restarts the device.
* '''Reboot Device:''' Restarts the device.
* '''Shutdown Device:''' Powers down before unplugging. Use this before disconnecting power. If the device loses power during an active session, it resumes measurement on the next boot.
* '''Shutdown Device:''' Powers down before unplugging. Use this before disconnecting power. If the device loses power during an active session, it resumes measurement on the next boot.
* '''Manual Firmware Update:''' Opens a dialog to upload a firmware file (.bin). The device also checks for updates a few times a day.
* '''Manual Firmware Update:''' Opens a dialog to upload a firmware file. The device also checks for updates a few times a day.
* '''Factory Reset:''' Permanently erases all measurement logs, WiFi credentials, calibration data, and device settings. A slide-to-confirm gesture is required. The device reboots into factory state.
* '''Factory Reset:''' Permanently erases all measurement logs, WiFi credentials, calibration data, and device settings. A slide-to-confirm gesture is required. The device reboots into factory state.


Line 113: Line 109:


The location input accepts common coordinate formats: <code>48.2082, 16.3738</code> — <code>48.2082 16.3738</code> — <code>(48.2082; 16.3738)</code>.
The location input accepts common coordinate formats: <code>48.2082, 16.3738</code> — <code>48.2082 16.3738</code> — <code>(48.2082; 16.3738)</code>.
=== bcMeter (DIY) — Raspberry Pi ===
The following notes apply specifically to the '''bcMeter (DIY)''' Raspberry Pi version. For the commercial bcMeter (ESP32), the sections above describe all maintenance procedures.
==== Storage ====
The Raspberry Pi version stores measurement data on the Linux filesystem (typically under <code>/home/bcmeter/logs/</code>). There is no fixed flash storage limit — available disk space depends on the SD card and system configuration. The web interface data manager works the same way as on the ESP32: log files are listed and can be downloaded or deleted individually.
The Pi does '''not''' use LittleFS or NVS. Configuration is stored in <code>~/bcmeter/bcMeter_config.json</code>.
==== Service Management ====
The bcMeter software runs as a systemd service (<code>bcMeter.service</code>). '''Do not use <code>systemctl stop</code>''' — stopping the service also disables the WiFi access point, cutting off remote access. Use the web interface Reboot or Shutdown buttons, or <code>systemctl restart</code> if a restart is needed from the terminal.
The firmware update endpoint (<code>POST /api/update</code>) accepts a <code>.tar.gz</code> or <code>.zip</code> archive, extracts it over the code directory, and runs <code>sudo systemctl restart bcMeter.service</code> automatically.
==== Maintenance Log Bundle ====
The Raspberry Pi version provides an additional endpoint, <code>GET /api/maintenance-logs</code>, which downloads a zip bundle for support purposes. The bundle contains:
* Rotating <code>bcmeter.log</code> files
* Syslog and <code>dmesg</code> output
* The 10 most recent CSV session files
* <code>journalctl</code> output for the bcMeter and pigpiod services
* The current config JSON (sensitive keys redacted)
* The incident log
This endpoint does not exist on the ESP32, which uses the structured <code>/api/logs</code> endpoint and crash report email for equivalent diagnostics.
==== ADC Hardware ====
The Raspberry Pi version uses the ADS8344E (18-bit, SPI) or MCP3428 (I2C, legacy) ADC, rather than the ADS1220 used on the ESP32. Calibration and measurement procedures are identical from the user's perspective.

Latest revision as of 20:59, 8 June 2026

Maintenance Procedures

Open maintenance functions with the Maintenance button in the navigation bar. The modal has cards for device management, system status, time synchronization, and geolocation.

Filter Change Procedure

The filter is not identical on both sides.

  • Identify the side with markings (black line, dot, or circles).
  • The marked side must face UP (towards the LEDs/light source in the upper optical chamber).

Warning: Incorrect orientation (marked side down) results in ~30% measurement error.

Procedure:

  1. Stop any running session.
  2. Unscrew the top cap of the optical chamber.
  3. Remove the saturated filter.
  4. Insert a new filter with markings facing up.
  5. Screw the cap back on (hand-tight).
  6. Check hose (if used): check that the air hose is still connected to the inlet port.
  7. Run Calibration (required).

Calibration

Filters vary slightly in optical density. Calibration balances the sensor signal against the reference signal for the specific filter currently installed.

  1. Go to Maintenance > Calibrate Device.
  2. Check that a new and clean filter is installed.
  3. Click "Yes."
  4. A progress bar appears. The device adjusts LED intensity per channel to find stable reference and sensor readings.
  5. Wait for "Calibration Successful" before starting a new log.

Technical detail: Calibration determines the per-channel correction factor K = Ref_avg / Sen_avg and stores it with the LED duty cycle values. Calibration typically takes 30–60 seconds.

Data Management

Click Log Files to open the data manager. The modal lists all stored sessions:

Column Description
Log Session name or filename (e.g., 26-03-12_212600.csv). "Current Session" shows the active log.
Size File size in KB, or number of data points for the current session.
Download Download button for each individual log file.

Below the table:

  • Clear All Data — Deletes all stored log files. Requires confirmation.
  • Remove Empty Logs — Cleans up zero-byte or near-empty files from aborted sessions.

Stored log files are downloaded as CSV for analysis. The dashboard's Download View button can additionally export the currently visible chart view as CSV, PNG, or SVG. CSV files use semicolon separation with dot as decimal divider.

Backup: Internal storage is not archival. Download data to a secure location regularly.

Device Management

Routine Maintenance

  • Calibrate Device: Adjusts LED duty cycles. Required after each filter change.
  • View System Status: Opens a structured status report for diagnosing issues. Entries are grouped by category: hardware, measurement, system, network.
  • Download Logs: Downloads the structured system status report as a text file for troubleshooting or support.
  • Identify Device: Blinks the device LED for about two minutes. Use this to find the right unit when more than one bcMeter is nearby.

System Operations

  • Reboot Device: Restarts the device.
  • Shutdown Device: Powers down before unplugging. Use this before disconnecting power. If the device loses power during an active session, it resumes measurement on the next boot.
  • Manual Firmware Update: Opens a dialog to upload a firmware file. The device also checks for updates a few times a day.
  • Factory Reset: Permanently erases all measurement logs, WiFi credentials, calibration data, and device settings. A slide-to-confirm gesture is required. The device reboots into factory state.

Firmware Update Notifications

When the device detects a newer firmware version, an Update Available modal appears showing:

  • The new version number and current version
  • Release notes (if available)
  • Update Now button to apply the update immediately (with progress bar)
  • Skip for now to dismiss and update later

Updates download over WiFi and are applied automatically. The device reboots after a successful update.

System Status

Shows device information:

  • Device ID: Unique hardware identifier (MAC address).
  • Software Version: Installed firmware version.
  • Free Memory: Available system memory.
  • Last Calibration: Timestamp of the most recent calibration.

Time Synchronization

Accurate timestamps need a correct device clock, especially on devices without internet access.

  • Browser Time / Device Time: Displayed for comparison.
  • Sync: If mismatch exceeds 10 seconds, a sync button appears to synchronize the device clock with your browser.

Devices connected to the internet sync automatically via NTP. Modem-based time sync (CLTS) is also supported when a 4G modem is connected.

Geolocation

When location services are active (Settings > Measurement > Location), the Geolocation card shows:

  • Location: Latitude/longitude with source (GPS, cell tower, or IP-based) and accuracy indicator.
  • Altitude (barometric): Derived from the pressure sensor.
  • Altitude (GPS) & Speed: Shown when a GPS module is connected and has a fix.

The location input accepts common coordinate formats: 48.2082, 16.373848.2082 16.3738(48.2082; 16.3738).

bcMeter (DIY) — Raspberry Pi

The following notes apply specifically to the bcMeter (DIY) Raspberry Pi version. For the commercial bcMeter (ESP32), the sections above describe all maintenance procedures.

Storage

The Raspberry Pi version stores measurement data on the Linux filesystem (typically under /home/bcmeter/logs/). There is no fixed flash storage limit — available disk space depends on the SD card and system configuration. The web interface data manager works the same way as on the ESP32: log files are listed and can be downloaded or deleted individually.

The Pi does not use LittleFS or NVS. Configuration is stored in ~/bcmeter/bcMeter_config.json.

Service Management

The bcMeter software runs as a systemd service (bcMeter.service). Do not use systemctl stop — stopping the service also disables the WiFi access point, cutting off remote access. Use the web interface Reboot or Shutdown buttons, or systemctl restart if a restart is needed from the terminal.

The firmware update endpoint (POST /api/update) accepts a .tar.gz or .zip archive, extracts it over the code directory, and runs sudo systemctl restart bcMeter.service automatically.

Maintenance Log Bundle

The Raspberry Pi version provides an additional endpoint, GET /api/maintenance-logs, which downloads a zip bundle for support purposes. The bundle contains:

  • Rotating bcmeter.log files
  • Syslog and dmesg output
  • The 10 most recent CSV session files
  • journalctl output for the bcMeter and pigpiod services
  • The current config JSON (sensitive keys redacted)
  • The incident log

This endpoint does not exist on the ESP32, which uses the structured /api/logs endpoint and crash report email for equivalent diagnostics.

ADC Hardware

The Raspberry Pi version uses the ADS8344E (18-bit, SPI) or MCP3428 (I2C, legacy) ADC, rather than the ADS1220 used on the ESP32. Calibration and measurement procedures are identical from the user's perspective.