Skip to content

Skip node DB fetch during --ota-update / --reboot-ota#961

Open
anton-vinogradov wants to merge 1 commit into
meshtastic:masterfrom
anton-vinogradov:ota-update-skip-node-db
Open

Skip node DB fetch during --ota-update / --reboot-ota#961
anton-vinogradov wants to merge 1 commit into
meshtastic:masterfrom
anton-vinogradov:ota-update-skip-node-db

Conversation

@anton-vinogradov

@anton-vinogradov anton-vinogradov commented Jul 18, 2026

Copy link
Copy Markdown

Problem

meshtastic --host <ip> --ota-update firmware.bin can silently fail to start the OTA on devices with a large node DB. The device never enters OTA mode (the WiFi OTA loader on :3232 never comes up) and the client ends with Connection refused.

Root cause

The OTA flow only needs the local node — to send the startOTA admin request — and then streams the firmware directly to the OTA loader over WiFi. It never reads the node DB. But the CLI still fetches the full node DB on connect.

On a device with a large node DB (e.g. ~250 nodes on an ESP32-S3 in a busy public mesh), that dump stalls and the firmware closes the API connection before it processes the OTA request:

[ServerAPI] TCP client write short (0/61 bytes), closing API service

So startOTA is never handled, the device doesn't reboot into the OTA loader, and --ota-update fails. Passing --no-nodes manually works around it.

Fix

Imply --no-nodes when --ota-update or --reboot-ota is used, since neither reads the node DB. No effect on other commands.

Verification

On a T-Beam 1W (ESP32-S3, ~250-node DB) with the unified WiFi OTA loader installed:

  • Before: meshtastic --host <ip> --ota-update fw.binConnection refused; device log shows TCP client write short (0/61 bytes), closing API service and no OTA Requested.
  • After (no --no-nodes needed): meshtastic --host <ip> --ota-update fw.binOTA update completed successfully!; device log shows OTA Requested → OTA partition contains combined BLE/WiFi OTA Loader → Rebooting to WiFi OTA → Listening on TCP port 3232.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved OTA updates and reboot-to-OTA commands by preventing unnecessary node database loading.
    • OTA-related requests now start more reliably without unwanted startup output or interference.

OTA only needs the local node to send the startOTA admin request and then
streams firmware directly to the loader over WiFi; it never reads the node DB.
On a device with a large node DB the initial dump can stall and the firmware
closes the API connection before it processes the OTA request, so OTA silently
fails. Imply --no-nodes for --ota-update / --reboot-ota.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jul 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eaf37564-8c66-4e52-85ce-d08a419d5b03

📥 Commits

Reviewing files that changed from the base of the PR and between 19d0669 and ef9cdc3.

📒 Files selected for processing (1)
  • meshtastic/__main__.py

📝 Walkthrough

Walkthrough

OTA update and OTA reboot actions now disable node database fetching before the related administrative request.

Changes

OTA request preparation

Layer / File(s) Summary
Skip node handling for OTA actions
meshtastic/__main__.py
common() sets args.no_nodes = True when --ota-update or --reboot-ota is selected.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ianmcorvidae

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: skipping node DB fetching for OTA-related commands.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants