Merge: dev to main, refactor rename #1

Merged
serversdown merged 16 commits from dev into main 2026-03-03 17:12:58 -05:00
3 changed files with 68 additions and 26 deletions
Showing only changes of commit 58ba506f54 - Show all commits

View File

@@ -10,27 +10,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
## [1.0.0] 2025-09-02
## [1.2.0] - 2025-12-04
### Changed
- Removed roster CSV dependency and all Dropbox refresh/hot-reload logic; heartbeat now only enumerates `.MLG` files.
- Added `MAX_EVENT_AGE_DAYS` filter to ignore stale events and log when no recent activity exists.
- Simplified heartbeat output/logging to show detected units only; logging hardened to never crash the emitter.
---
## [1.1.1] - 2025-12-02
### Added
- Example `config.ini` now ships with API heartbeat settings enabled (`API_ENABLED`, `API_URL`, `API_INTERVAL_SECONDS`, `SOURCE_ID`, `SOURCE_TYPE`).
---
## [1.1.0] - 2025-12-01
### Added
- Standardized SFM telemetry payload builder and periodic HTTP heartbeat POST via `urllib`.
- Config support for API heartbeat (`API_ENABLED`, `API_URL`, `API_INTERVAL_SECONDS`, `SOURCE_ID`, `SOURCE_TYPE`); payload includes file path/size metadata.
### Changed
- Refactored scanner to retain file paths and header sniff cache; reformatted logging/ANSI handling.
---
## [1.0.1] - 2025-11-20
### Added
- `API_URL` config key and `report_to_server` per-unit POST hook (adds `requests` dependency).
### Changed
- Example `config.ini` roster URL updated; merged into `main`.
---
## [1.0.0] - 2025-11-17
### Added
- **Automatic roster refresh** from Dropbox at a configurable interval (`ROSTER_REFRESH_MIN_SECONDS`).
- **Hot-reload** of roster file without restarting the script.
- **Failsafe reload:** if the new roster is missing or invalid, the previous good roster is retained.
- **Atomic roster downloads** (temp file replace) to avoid partial/corrupted CSVs.
- **Atomic roster downloads** (temp file in-place replace) to avoid partial/corrupted CSVs.
- **Startup config echo** printing WATCH_PATH, ROSTER_FILE, and ROSTER_URL visibility.
- **Active / Bench / Ignored** unit categories for clearer fleet status mapping.
### Fixed
- Removed stray `note=note_suffix` bug in the Unexpected Units section.
- Removed stray `note=note_suffix` bug in the Unexpected Units section.
- Removed duplicate `import time`.
- Removed duplicate roster load during startup (roster now loads once).
- Cleaned indentation for Python 3.8 compatibility.
### Changed
- Reset versioning from legacy `v5.9 beta` **v1.0.0** (clean semver baseline).
- Reset versioning from legacy `v5.9 beta` to **v1.0.0** (clean semver baseline).
- Main script normalized as `series3_emitter.py`.
---
[Unreleased]: https://example.com/compare/v1.0.0...HEAD
[Unreleased]: https://example.com/compare/v1.2.0...HEAD
[1.2.0]: https://example.com/releases/v1.2.0
[1.1.1]: https://example.com/releases/v1.1.1
[1.1.0]: https://example.com/releases/v1.1.0
[1.0.1]: https://example.com/releases/v1.0.1
[1.0.0]: https://example.com/releases/v1.0.0

View File

@@ -5,9 +5,8 @@ It scans the event folder, reads `.MLG` headers to identify unit IDs, and prints
- Last event received
- Age since last call-in
- OK / Pending / Missing states
- Bench and ignored units
- Unexpected units
- Notes from the roster file
- Detected units (no roster required)
- Optional API heartbeat to Seismograph Fleet Manager backend
This script is part of the larger **Seismograph Fleet Manager** project.
@@ -17,7 +16,6 @@ This script is part of the larger **Seismograph Fleet Manager** project.
- Python 3.8 (Windows 7 compatible)
- Blastware 10 event folder available locally
- `series3_roster.csv` in the configured path
- `config.ini` in the same directory as the script
Install dependencies with:
@@ -34,12 +32,11 @@ Run the emitter from the folder containing the script:
The script will:
1. Load the roster file
2. Scan the Blastware event folder for `.MLG` files
3. Sniff each file header for the unit ID
4. Print a status line for each active unit
5. Refresh the roster automatically if `ROSTER_URL` is set
6. Write logs into the `emitter_logs/` folder
1. Scan the Blastware event folder for `.MLG` files (within a max age window).
2. Sniff each file header for the unit ID.
3. Print a status line for each detected unit (OK / Pending / Missing).
4. Optionally POST a heartbeat payload on an interval when `API_ENABLED=true`.
5. Write logs into the `emitter_logs/` folder and auto-clean old logs.
---
@@ -49,11 +46,18 @@ All settings are stored in `config.ini`.
Key fields:
- `SERIES3_PATH` folder containing `.MLG` files
- `ROSTER_FILE` path to the local roster CSV
- `ROSTER_URL` optional URL for automatic roster downloads
- `SCAN_INTERVAL_SECONDS` how often to scan
- `OK_HOURS` / `MISSING_HOURS` thresholds for status
- `SERIES3_PATH` folder containing `.MLG` files
- `SCAN_INTERVAL_SECONDS` — how often to scan
- `OK_HOURS` / `MISSING_HOURS` — thresholds for status
- `MLG_HEADER_BYTES` how many bytes to sniff from each `.MLG` header
- `RECENT_WARN_DAYS` — log unsniffable files newer than this window
- `MAX_EVENT_AGE_DAYS` — ignore events older than this many days
- `API_ENABLED` — enable/disable heartbeat POST
- `API_URL` — heartbeat endpoint
- `API_INTERVAL_SECONDS` — heartbeat frequency
- `SOURCE_ID` / `SOURCE_TYPE` — identifiers included in the API payload
- `LOG_RETENTION_DAYS` — auto-delete logs older than this many days
- `COLORIZE` — ANSI color output (off by default for Win7)
---
@@ -68,7 +72,7 @@ Git ignores all log files but keeps the folder itself.
This repo follows **Semantic Versioning (SemVer)**.
Current release: **v1.0.0** stable baseline emitter.
Current release: **v1.2.0** — rosterless scanning with API heartbeat option.
See `CHANGELOG.md` for details.
---
@@ -76,4 +80,3 @@ See `CHANGELOG.md` for details.
## License
Private / internal project.
```

View File

@@ -9,9 +9,7 @@ SOURCE_TYPE = series3_emitter
# Paths
SERIES3_PATH = C:\Blastware 10\Event\autocall home
ROSTER_FILE = C:\SeismoEmitter\series3_roster.csv
ROSTER_URL = https://www.dropbox.com/URL
ROSTER_REFRESH_MIN_SECONDS = 0
MAX_EVENT_AGE_DAYS = 365
# Scanning