Add CRC error count endpoint with persistent SQLite storage#88
Open
dmduran12 wants to merge 1 commit intorightup:devfrom
Open
Add CRC error count endpoint with persistent SQLite storage#88dmduran12 wants to merge 1 commit intorightup:devfrom
dmduran12 wants to merge 1 commit intorightup:devfrom
Conversation
- Add crc_errors table to SQLite with timestamp index - Add store_crc_error() and get_crc_error_count() to SQLiteHandler - Add record_crc_error() and get_crc_error_count() pass-throughs to StorageCollector - Add CRCErrorTracker logging handler that intercepts SX1262_wrapper CRC error logs - Add GET /api/crc_count?hours=24 endpoint following existing noise_floor pattern - Include crc_errors in cleanup_old_data() for automatic data retention Co-Authored-By: Warp <agent@warp.dev>
Author
|
this endpoint will allow reporting CRC errors in the dashboard @rightup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
GET /api/crc_count?hours=24endpoint that tracks and counts CRC errors detected by the SX1262 radio, with persistent SQLite storage.Problem
CRC errors (
[RX] CRC error detected - discarding packet) are logged by the radio driver but not tracked or queryable via the API. This makes it difficult to monitor radio health over time.Changes
sqlite_handler.py— Newcrc_errorstable with timestamp index,store_crc_error()andget_crc_error_count(hours)methods, cleanup incleanup_old_data()storage_collector.py—record_crc_error()andget_crc_error_count()pass-throughs (same pattern asnoise_floor)http_server.py—CRCErrorTrackerlogging handler that intercepts CRC error log messages fromSX1262_wrapperand persists them to SQLitemain.py— Register_crc_trackeron root logger alongside_log_bufferapi_endpoints.py— NewGET /api/crc_count?hours=24endpointweb/__init__.py— Export new symbolsDesign
logging.Handlernoise_floorfeature (table, handler methods, storage pass-through, API endpoint)cleanup_old_data()retention policy?hours=24time period parameter consistent with all other endpointsResponse Format
{ "success": true, "data": { "crc_error_count": 42, "hours": 24, "oldest_event": 1707350239.044, "newest_event": 1707436639.044 } }Co-Authored-By: Warp agent@warp.dev