Skip to content

AXP2101-configured devices do not report battery voltage #154

Description

@EdenNelson

Hardware and configuration

The Waveshare ESP32-S3-PhotoPainter Rev 2.0 is configured by the official esp32-s3-wspp preset with an AXP2101 sensor on I2C bus 0. Its battery is measured by the PMIC, and the preset does not configure an ESP32 analog battery-sense pin.

Problem

The normal OpenDisplay battery-voltage path does not read a configured AXP2101. It checks for a BQ27220 and otherwise uses battery_sense_pin. With neither available, it returns -1.0, which is encoded as zero in BLE manufacturer data and displayed as a blank voltage.

Separately, display_service.cpp contains an AXP2101 diagnostic reader, readAXP2101Data(), which has no callers anywhere in the tree. Its VBAT conversion does not match the AXP2101 register format, it enables every ADC channel, and it reads the battery-presence and VBUS-presence bits the wrong way round. None of that is reachable at runtime, so it is noted here as a separate defect rather than as part of this report.

Hardware evidence

The same board returned valid battery ADC data from AXP2101 registers 0x34 and 0x35 while the I2C bus was available. One captured raw sample decoded to 4,024 mV, and later samples were near 4.2 V.

Expected behavior

When SensorData configures an AXP2101, readBatteryVoltage() should obtain VBAT from that sensor using its configured bus and address, preserve unrelated ADC-control bits, and continue using the existing voltage cache and BLE encoding.

Existing BQ27220 and analog battery-sense configurations should keep their current behavior.

AI-enabled workflow disclosure: this issue was researched and drafted with AI assistance under a human-driven, human-in-the-loop process. GitHub Copilot was the harness; research, review, and hardware-log analysis were carried out across multiple AI harnesses and models, each stage reviewed by a human operator. The hardware observations were produced on attached hardware by that operator, cross-checked against ESPHome diagnostics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions