OTA phase 5: tools and docs ready for the public export
pub-release / release (push) Successful in 32m57s
pub-release / release (push) Successful in 32m57s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97618f223f
commit
d22005a6fd
12 files changed
+704
-24
No files matched your search
+10
-3
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""Push an OTA package (tools/ota_pack.py) to a node OVER THE MESH, as admin.
|
||||
|
||||
tools/ota_mesh_push.py <companion> <dest> <package> [--apply] [--duty 1]
|
||||
@@ -39,8 +40,8 @@ Every `fw w` is idempotent on the node, so a lost reply is simply resent; the
|
||||
node checks the manifest as soon as its chunks arrive and answers ERR for a
|
||||
wrong board or base -- that stops the transfer.
|
||||
|
||||
The admin password comes from platformio.local.ini ([secrets] admin_pw) and is
|
||||
never printed. CHECK `get radio` on both ends first: this transmits.
|
||||
The admin password comes from platformio.local.ini ([secrets] admin_pw), or is
|
||||
asked for on the terminal; it is never printed. CHECK `get radio` on both ends first: this transmits.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -97,11 +98,17 @@ def w_payload(sid: int, off: int, chunk: bytes) -> bytes:
|
||||
|
||||
|
||||
def admin_pw() -> str:
|
||||
"""[secrets] admin_pw of platformio.local.ini, else asked on the terminal
|
||||
(never an argument: it would show in the process list and the history)."""
|
||||
cp = configparser.ConfigParser(interpolation=None, strict=False)
|
||||
cp.read(INI)
|
||||
pw = cp.get("secrets", "admin_pw", fallback="").strip()
|
||||
if not pw and sys.stdin.isatty():
|
||||
import getpass
|
||||
|
||||
pw = getpass.getpass("admin password of the node: ").strip()
|
||||
if not pw:
|
||||
sys.exit(f"no [secrets] admin_pw in {INI}")
|
||||
sys.exit(f"no admin password: [secrets] admin_pw in {INI}, or run it on a terminal")
|
||||
return pw
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user