Implement sensor reliability improvements and error handling#2
Open
Implement sensor reliability improvements and error handling#2
Conversation
- Add sensor criticality system with configurable timeouts: * Critical sensors (cloud detection): 5min tolerance, assume dangerous if failed * Non-critical sensors (SQM, rain, UPS): 2-3min tolerance, assume safe if failed - Fix NoneType comparison crashes in weather safety evaluation - Fix SQL syntax errors from empty sensor values (convert to NULL) - Add comprehensive error handling and graceful degradation - Update documentation with troubleshooting guide This prevents single sensor failures from making the observatory inoperable while maintaining safety for critical cloud detection systems. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace empty values (::) with 'U' (unknown) before passing to rrdtool - MySQL pipeline still receives original data for failure tracking - Prevents 'Cannot convert empty string to float' RRD errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use while loop to handle multiple consecutive empty values - Converts N:::-95.08 to N:U:U:-95.08 properly - Ensures RRDtool gets the expected number of data points 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add debug logging to see what values are being returned from database - Will help identify why sensor data appears missing when it exists in DB 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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
This PR implements a comprehensive sensor reliability system that prevents single sensor failures from making the observatory inoperable while maintaining safety for critical systems.
Changes Made
🎯 Sensor Criticality System
🛠️ Error Handling Improvements
TypeError: unorderable types: NoneType() >= float()crashesN:::-95.08)check_sensor_data_age()function for data freshness validation📝 Enhanced Documentation
collector/CLAUDE.mdwith system architectureProblem Solved
Previously, any sensor failure would cause:
or SQL errors:
This made the entire observatory inoperable due to single sensor issues.
Test Plan
🤖 Generated with Claude Code