Skip to content

more descriptive errors - #49

Open
PaulaScharf wants to merge 7 commits into
mainfrom
feat/more-descriptive-errors
Open

PaulaScharf wants to merge 7 commits into
mainfrom
feat/more-descriptive-errors

Conversation

@PaulaScharf

@PaulaScharf PaulaScharf commented Sep 8, 2026 •

Copy link
Copy Markdown
Member
  • error messages if sensor couldnt be initialized
  • error messages if bluetooth couldnt be initialized
  • small symbol if bluetooth connected
  • box starts up regardless if sensors are not working

first merge #49 before this.

PXL_20260908_193040769 MP PXL_20260908_140026376 MP

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Header-level dependency coupling (notably Display.h including sensors and DistanceSensor.h including heavy ML headers) is likely to cause circular/expensive includes and should be restructured before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves startup resilience and user feedback by allowing the firmware to continue booting when individual sensors (or BLE) cannot be initialized, while surfacing clearer error/status information on the OLED.

Changes:

  • Add bounded init retries plus “sensor missing” tracking (isPresent()) across sensors and BLE instead of blocking forever.
  • Enhance OLED UI with a warning/error screen, a Bluetooth-connected icon, and a list of missing modules on the connection screen.
  • Update PlatformIO platform/library versions and adjust DistanceSensor VL53L8CX integration to match updated headers/APIs.
File summaries
File Description
senseBox-bike-atrai-v2/src/sensors/TempHumiditySensor/TempHumiditySensor.h Adds isPresent() API for temp/humidity sensor presence reporting.
senseBox-bike-atrai-v2/src/sensors/TempHumiditySensor/TempHumiditySensor.cpp Adds retry-based init and non-fatal missing-sensor behavior + display error.
senseBox-bike-atrai-v2/src/sensors/DustSensor/DustSensor.h Adds isPresent() and per-sensor init attempt constant.
senseBox-bike-atrai-v2/src/sensors/DustSensor/DustSensor.cpp Adds retry-based init and non-fatal missing/error behavior + display error.
senseBox-bike-atrai-v2/src/sensors/DistanceSensor/DistanceSensor.h Updates VL53L8CX include and pulls in EdgeImpulse/TFLM headers.
senseBox-bike-atrai-v2/src/sensors/DistanceSensor/DistanceSensor.cpp Adds retry-based init and non-fatal missing/error behavior + display error; updates VL53L8CX API calls.
senseBox-bike-atrai-v2/src/sensors/BatterySensor/BatterySensor.h Adds isPresent() API for battery sensor presence reporting.
senseBox-bike-atrai-v2/src/sensors/BatterySensor/BatterySensor.cpp Adds retry-based init and guards for missing battery sensor.
senseBox-bike-atrai-v2/src/sensors/BaseSensor.h Introduces shared MAX_INIT_ATTEMPTS constant for init retry loops.
senseBox-bike-atrai-v2/src/sensors/AccelerationSensor/AccelerationSensor.h Adds isPresent() and sensorFound tracking.
senseBox-bike-atrai-v2/src/sensors/AccelerationSensor/AccelerationSensor.cpp Adds retry loop across supported accel sensors and non-fatal missing behavior + display error.
senseBox-bike-atrai-v2/src/main.cpp Adjusts loop scheduling: fall back to timed reads when accel sensor is missing.
senseBox-bike-atrai-v2/src/display/Display.h Adds API for loading errors and includes module headers for presence display.
senseBox-bike-atrai-v2/src/display/Display.cpp Adds loading error screen, BT connected icon, missing-module list, and bitmap include refactor.
senseBox-bike-atrai-v2/src/display/bitmaps.h Adds warning and Bluetooth icon bitmaps.
senseBox-bike-atrai-v2/src/ble/BLEModule.h Adds isPresent() API for BLE presence reporting.
senseBox-bike-atrai-v2/src/ble/BLEModule.cpp Adds BLE presence detection and non-fatal error display on missing BLE module.
senseBox-bike-atrai-v2/platformio.ini Pins platform and bumps several library versions.
Review details
  • Files reviewed: 18/18 changed files
  • Comments generated: 10
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: PaulaScharf <48286621+PaulaScharf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants