Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#5 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
cpp
領域
embedded-iot

調査の方向性

begin() の74行目付近から開始し、破棄されている PowerAuto() の結果と PowerState メンバーを追跡します。次に Run() と turnOnSDcard() を調べ、最初のサイクルのバックホールゲートが検出された電源を使用していることを確認します。最初のログイベントより前に、バックアップまたは補助バッテリーでの起動を含め、PowerState が実際の電源を反映していれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C++
スター
1
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NorthernWidget/Okapi_Library のほかの issue

NorthernWidget/Okapi_Library の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。