fix: silence false-alarm boot log errors from NVS and accelerometer probe - #55
Merged
Merged
Conversation
…robe - All four persistence load() functions (CalibrationStore, DroidPersistence, ComplicationPersistence, PowerConfigStore) opened their Preferences namespace read-only, which makes nvs_open() fail with NOT_FOUND (logged as an alarming error) on a device that's never saved that namespace yet -- true on every first boot. Opening read-write instead silently creates the empty namespace; no behavior change to what's actually loaded (still falls back to defaults), just no more false "hardware is broken" errors. - Accelerometer::begin() now does a plain presence probe (address-only write, real stop condition) before attempting its repeated-start register read. On boards without this part, endTransmission(false)'s repeated-start check doesn't reliably report the missing ACK by itself -- a known ESP32 I2C driver quirk -- so Wire.requestFrom() was getting called against a device that was never there, which the Wire library logs as an error. Co-Authored-By: Claude Sonnet 5 <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
load()functions (CalibrationStore,DroidPersistence,ComplicationPersistence,PowerConfigStore) opened their Preferences namespace read-only, which makesnvs_open()fail withNOT_FOUND— logged as an alarming error — on a device that's never saved that namespace yet, i.e. every first boot. Opening read-write instead silently creates the empty namespace; no behavior change to what's actually loaded (still falls back to defaults), just no more false "hardware is broken" errors in the boot log.Accelerometer::begin()now does a plain presence probe (address-only write, real stop condition) before attempting its repeated-start register read. On boards without this part,endTransmission(false)'s repeated-start check doesn't reliably report the missing ACK by itself — a known ESP32 I2C driver quirk — soWire.requestFrom()was getting called against a device that was never there, which the Wire library logs as an error.Test plan
pio test -e native— 284/284 passing (none of these files are in the native coverage set; they're hardware-touching adapters per the existing exclusion policy)pio run -e esp32s3— builds cleannvs_open failedori2cWriteReadNonStoperrors🤖 Generated with Claude Code