[Feature request] Report battery voltage from an INA3221 channel

Aperta
#3,865 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c
Ambito
embedded-iot

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C
Stelle
3.9k
Fork
1.5k
Merge medio
2g 19h
PR unite (30g)
61

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di meshcore-dev/MeshCore

Tutte le issue di meshcore-dev/MeshCore

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.