Skip to content

vl53l: fix sensor model mismatch — component supports VL53L4CD/VL53L4CX, not VL53L0X#613

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-model-id-mismatch
Draft

vl53l: fix sensor model mismatch — component supports VL53L4CD/VL53L4CX, not VL53L0X#613
Copilot wants to merge 2 commits intomainfrom
copilot/fix-model-id-mismatch

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

The espp/vl53l component implements the VL53L4CD/VL53L4CX driver (16-bit register addressing, model ID 0xEB) but all documentation incorrectly identified the supported hardware as VL53L0X. Users with VL53L0X sensors (e.g., WHADDA WPSE337) got a misleading "Model ID mismatch" error because VL53L0X uses 8-bit register addressing and is fundamentally incompatible with this driver — the 16-bit register address 0x010F is misinterpreted, returning garbage values (0x0F, 0x01).

Documentation fixes

  • README.md, example/README.md, vl53l.rst: Replace all VL53L0X references with VL53L4CD/VL53L4CX; correct Adafruit product link to the VL53L4CD breakout (#5396); add explicit incompatibility notes for VL53L0X/VL53L1X users

Driver fixes (vl53l.hpp)

  • Split MODULE_TYPE = 0xAA into MODULE_TYPE_CD = 0xAA (VL53L4CD) and MODULE_TYPE_CX = 0x10 (VL53L4CX), so both variants are accepted in get_model_info()
  • Downgrade model ID mismatch from logger_.errorlogger_.warn since initialization proceeds regardless
  • Fix stale VL53L0X register name references in code comments

Copilot AI linked an issue Apr 19, 2026 that may be closed by this pull request
2 tasks
…L4CD/VL53L4CX

- Update README.md and example/README.md to correctly reference VL53L4CD/VL53L4CX
  and add explicit note that VL53L0X is not supported
- Update doc/en/distance_sensors/vl53l.rst with correct sensor description
- Fix vl53l.hpp class description to reference VL53L4CD/VL53L4CX
- Add MODULE_TYPE_CD (0xAA) and MODULE_TYPE_CX (0x10) constants
- Update get_model_info() to accept both VL53L4CD and VL53L4CX module types
- Change model ID mismatch log level from error to warn (init proceeds anyway)
- Fix stale VL53L0X register reference comment in init()

Agent-Logs-Url: https://github.com/esp-cpp/espp/sessions/436039d8-973e-4dff-a1c0-2978dc50d395

Co-authored-by: finger563 <213467+finger563@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix model ID mismatch for VL53L0X sensor vl53l: fix sensor model mismatch — component supports VL53L4CD/VL53L4CX, not VL53L0X Apr 19, 2026
Copilot AI requested a review from finger563 April 19, 2026 23:32
@github-actions
Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

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.

Model ID mismatch

2 participants