Skip to content

fix(flash): give up a flash that makes no progress for 30 s - #592

Merged
stylesuxx merged 3 commits into
stylesuxx:developfrom
Jschmiedd:fix/flash-stall-watchdog
Nov 16, 2026
Merged

stylesuxx merged 3 commits into
stylesuxx:developfrom
Jschmiedd:fix/flash-stall-watchdog

Conversation

@Jschmiedd

@Jschmiedd Jschmiedd commented Nov 11, 2026 •

Copy link
Copy Markdown

Builds on #588 (an async retry function that throws must reject, and flashTarget() is awaited so that a failing flash resolves to null).

When the power of the ESC is cut during a flash, every command is retried with a growing delay, and the retries of the commands and of the verification steps stack up: the flash can wait for many minutes before failing, with all buttons disabled.

Add a watchdog around writeHex(): when the ESC has not answered (any ACK_OK except the keep alive, which the flight controller answers) and the progress bar has not moved for 30 s, the flash is given up. A command still waiting for an answer stops waiting, no further command is sent and retry() stops at once. The ESC is left as after any failed flash: marked FLASH*FAILED and recoverable by flashing it again. A healthy flash, even a slow one, gets an answer at least every second. The 30 s threshold is a proposal, open to discussion.

Tests: a simulated ESC whose power is cut at 8 points over the whole flash, answering with a timeout or not at all: the flash now gives up within 60 s and resolves to null. A slow but healthy ESC (900 ms per answer) is flashed completely and never given up.

@codacy-production

codacy-production Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 46 complexity · 0 duplication

Metric Results
Complexity 46
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Jschmiedd Jschmiedd changed the title Fix/flash stall watchdogfix(flash): give up a flash that makes no progress for 30 s fix(flash): give up a flash that makes no progress for 30 s Nov 11, 2026
@Jschmiedd
Jschmiedd force-pushed the fix/flash-stall-watchdog branch from 34f5f1a to 1077577 Compare November 11, 2026 21:02
When the power of the ESC is cut during a flash, every command is retried
with a growing delay, and the retries of the commands and of the
verification steps stack up: the flash can wait for many minutes before
failing, with all buttons disabled.

Add a watchdog around writeHex(): when the ESC has not answered (any
ACK_OK except the keep alive, which the flight controller answers) and
the progress bar has not moved for 30 s, the flash is given up. A command
still waiting for an answer stops waiting, no further command is sent and
retry() stops at once. The ESC is left as after any failed flash: marked
FLASH*FAILED and recoverable by flashing it again. A healthy flash,
even a slow one, gets an answer at least every second.

The 30 s threshold is a proposal, open to discussion.

Tests: a simulated ESC whose power is cut at 8 points over the whole
flash, answering with a timeout or not at all: the flash now gives up
within 60 s and resolves to null. A slow but healthy ESC (900 ms per
answer) is flashed completely and never given up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VvqUCt5QANL2A4NKbRdzyx
@Jschmiedd
Jschmiedd force-pushed the fix/flash-stall-watchdog branch from 1077577 to 2fc1f1c Compare November 11, 2026 21:33
@Jschmiedd
Jschmiedd marked this pull request as ready for review November 13, 2026 22:16
Comment thread src/utils/Errors.js Resolved
Comment thread src/translations/en/log.json Resolved
…ll message

Review of stylesuxx#592: the error class and the stall constant explain themselves,
and the log message now reads "Gave up flashing ESC {{index}} - no progress
for {{seconds}} s, check the ESC power".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
Jschmiedd pushed a commit to Jschmiedd/esc-configurator that referenced this pull request Nov 14, 2026
As asked in the review of stylesuxx#590 and stylesuxx#592: no comment where the code is
explicit enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
@Jschmiedd
Jschmiedd requested a review from stylesuxx November 15, 2026 11:53
@stylesuxx
stylesuxx merged commit 4d76e36 into stylesuxx:develop Nov 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants