[Feature request] Report battery voltage from an INA3221 channel

Đang mở
#3,865 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
embedded-iot

Hướng nghiên cứu

Start by reading the default getBattMilliVolts() implementation for ESP32 boards and how EnvironmentSensorManager exposes INA3221 channel voltages. Check how build flags and conflicts with PIN_VBAT_READ are handled. Done means the selected channel supplies the battery reading when configured, while the existing behavior remains without the flag; the issue leaves the access path and flag name open.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Use case: Solar repeaters often monitor panel, battery and load with an INA3221. EnvironmentSensorManager already reports all three channels as telemetry, but getBattMilliVolts() only reads an ADC pin. Boards without a PIN_VBAT_READ divider therefore report 0 V in the status, CLI stats and telemetry channel 1, even though the battery voltage is being measured.

Proposal: a build flag selecting the battery channel:

-D BATT_INA3221_CHANNEL=2   ; 1..3 as labelled on the chip

When set, the board's battery reading returns that channel's bus voltage instead of 0. Nothing changes without the flag; setting it together with PIN_VBAT_READ is a build error. Scope: ESP32 boards that use the default getBattMilliVolts().

Questions: Should the voltage come from EnvironmentSensorManager (so it uses whatever address and bus the sensor manager detected, which matters if #3325's address scanning lands), or be read directly in ESP32Board? Any preference on the flag name?

Related: #3325 (INA3221 detection and shunt value).

Hardware: Xiao S3 WIO, INA3221 '0x40', battery on CH2. Happy to submit the PR.

Ngôn ngữ chính
C
Star
3.9k
Fork
1.5k
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
61

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của meshcore-dev/MeshCore

Tất cả issue của meshcore-dev/MeshCore

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.