PowerState not initialized from actual power source — spurious backhaul on backup battery at first boot
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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NorthernWidget/Okapi_Library
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de NorthernWidget/Okapi_Library
Issues similares
-
ai_p1 comp-message-queues
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ClickHouse/ClickHouse#125890 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
redis/memtier_benchmark#642 ·
Los mantenedores suelen responder en 1 día
-
Ctrl-C can abort a node: the state timer asks for the node names after shutdownPosiblemente ocupada @fmrico la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fmrico/cascade_lifecycle#24 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100