Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

PowerState not initialized from actual power source — spurious backhaul on backup battery at first boot

Abierto Apto para principiantes
#5 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
cpp
Área
embedded-iot

Línea de trabajo

Empieza en begin(), alrededor de la línea 74, y sigue el resultado descartado de PowerAuto() y el miembro PowerState. Después inspecciona Run() y turnOnSDcard() para verificar que la compuerta de backhaul del primer ciclo usa la fuente de alimentación detectada. Se considera terminado cuando PowerState refleja la fuente real antes del primer evento de log, incluido el arranque con una batería de respaldo o auxiliar.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Bug

PowerState (a float member, initialized to 0) is only updated inside turnOnSDcard(), which is called from sleepNow(). Before the device sleeps for the first time, PowerState remains 0 regardless of actual power source.

The backhaul gate in Run() is:

if(LogCount >= LogCountPush && PowerState == 0) {
    IO.DigitalWrite(FeatherEN, HIGH, MCP23018::Ports::B); // turn on Feather

PowerAuto() is called in begin() (line ~74) but its return value is discarded — PowerState is not updated there.

Failure scenario

Device starts on backup/aux battery (PowerAuto() would return 1 or 2). For the entire first duty cycle (before the first sleep), PowerState is still 0, so the backhaul guard evaluates true. The Feather fires on backup power, potentially browning out the radio and draining the backup supply prematurely.

Fix

Store PowerAuto() return value into PowerState at the end of begin(), so power state is known from the first log event onward.

Severity

Medium — affects first-boot behavior only; corrects itself after the first sleep/wake cycle.

🤖 Generated with Claude Code

Lenguaje dominante
C++
Estrellas
1
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NorthernWidget/Okapi_Library

Todos los issues de NorthernWidget/Okapi_Library

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.