-
Notifications
You must be signed in to change notification settings - Fork 101
fix(ota-hil): fallback date comparison #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
chrisgalanis
wants to merge
13
commits into
chris/ota-hil
Choose a base branch
from
chris/pearl-hil-ota
base: chris/ota-hil
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
d887214 to
208ddcd
Compare
This pull request introduces improvements to the OTA update process and device reboot logic, with a focus on configurability, reliability, and robustness around time synchronization and FTDI device handling. The most important changes are grouped below: **OTA Update Process Improvements:** * Added a `--skip-time-sync-before-reboot` flag to the `Ota` command, allowing users to optionally skip the NTP time synchronization check before the first reboot. Time sync is still enforced after reboot and before starting the update. [[1]](diffhunk://#diff-4417a067e971532511cd378570394d24d393625d1e510ecc9475239495917805R72-R76) [[2]](diffhunk://#diff-4417a067e971532511cd378570394d24d393625d1e510ecc9475239495917805L108-R132) * Ensured that the log directory is created or verified before starting the OTA process, improving reliability of log file handling. **Device Reboot and FTDI Handling:** * Refactored the reboot logic to use named constants for timing delays and clarified the handling of the recovery pin state, making the reboot process more maintainable and readable. [[1]](diffhunk://#diff-201f44f16c361cb2807a9ba916d437dd592b40a19e0a1b9f095b37e3ea38cd7cR26-R28) [[2]](diffhunk://#diff-201f44f16c361cb2807a9ba916d437dd592b40a19e0a1b9f095b37e3ea38cd7cL40-R48) [[3]](diffhunk://#diff-201f44f16c361cb2807a9ba916d437dd592b40a19e0a1b9f095b37e3ea38cd7cL49-R68) [[4]](diffhunk://#diff-201f44f16c361cb2807a9ba916d437dd592b40a19e0a1b9f095b37e3ea38cd7cL77-R85) **Time Synchronization Robustness:** * Enhanced the time synchronization check to detect and use either `chronyc` or `timedatectl` (preferring `chronyc` if available), with robust error handling and command timeouts. This ensures the system waits for accurate time sync using the best available tool.
…re into chris/pearl-hil-ota
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.
This pull request improves the system time synchronization logic in
hil/src/commands/ota/system.rsby introducing a fallback mechanism when NTP/chrony-based sync fails. Instead of failing immediately, the code now compares the device's time with the local PC and allows a tolerance of up to one month. This makes the OTA process more robust to minor time discrepancies.Enhancements to time synchronization robustness:
wait_for_time_syncto log a warning and fall back to a date comparison instead of failing immediately if NTP/chrony sync does not complete.check_time_difference_fallbackfunction, which compares the Orb's time with the local PC and accepts a difference of up to 30 days. This helps avoid unnecessary failures due to minor clock drift.Logging improvements:
warnfromtracingand added more informative logging to indicate fallback behavior and time difference results. [1] [2]