Skip to content

[Bug] sdkconfig.detector default config uses HELTEC_V3 for V4 board - causes incorrect VBAT reading (reports 0 V) #54

Description

@popshark1

Bug Report

Description

When flashing the Detector firmware on a Heltec WiFi LoRa 32 V4, battery voltage is always reported as 0 V (battery_v: 0), even with a healthy LiPo battery connected to the standard battery connector.

Root Cause

The default sdkconfig.detector example in the documentation ships with:

CONFIG_BATEAR_BOARD_HELTEC_V3=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

Even though the inline comment reads:

Board (use HELTEC_V4 + FLASHSIZE_16MB for V4)

When the firmware is built with HELTEC_V3, the VBAT monitoring logic targets the wrong GPIO/ADC configuration for the V4 hardware (GPIO1 / ADC1_CH0 gated by GPIO37 / ADC_Ctrl). The result is a 0 V reading on every telemetry packet.

Steps to Reproduce

  1. Use a Heltec WiFi LoRa 32 V4 board.
  2. Copy the default sdkconfig.detector example from the docs without modifying the board selection.
  3. Build and flash the Detector firmware.
  4. Observe battery_v: 0 in telemetry output despite a connected and charged battery.

Expected Behavior

battery_v should reflect the actual battery voltage (e.g., 3.82), and a low-battery flag should trigger when voltage drops below 3.4 V.

Proposed Fix

Update the default sdkconfig.detector example (or add a clear V4-specific block) to use:

CONFIG_BATEAR_BOARD_HELTEC_V4=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y

Environment

  • Board: Heltec WiFi LoRa 32 V4
  • Firmware role: Detector
  • Batear version: v2.2.0
  • Battery: LiPo connected to standard SH1.25 battery connector
  • Solar input: SH1.25 solar panel interface (V4-specific feature)

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