feat(espnow): app-file OTA over the reliable link
New espnow_ota module, loaded on the first OTA packet (types 0x07-0x0C, status reply 0x26). Files are written by chunk index to <path>.new, checked against their sha256, and moved into place together on commit, followed by a reset. Unchanged files are skipped, and a repeated commit after the reset still gets OK. - receive ESP-NOW frames from esp.irq() so frames are not lost while presets.tick() runs; polling remains as a fallback - raise rxbuf to 2048 and the link inbox to 24 frames - file_hashes: MicroPython's sha256 has no hexdigest() - bench stats line includes esp.stats() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
940d1d0a77
commit
495da4e366
8 files changed
+577
-15
No files matched your search
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""LinkRx: reassembly, dedupe, acks, commit and digest resync."""
|
||||
import struct
|
||||
from espnow_rx import LinkRx, MSG_DATA, MSG_ACK, MSG_DIGEST, MSG_RESYNC, F_ACK, F_COMMIT
|
||||
from espnow_rx import LinkRx, MSG_DATA, MSG_ACK, MSG_DIGEST, MSG_RESYNC, F_ACK, F_COMMIT, INBOX_MAX
|
||||
from beat_sync import BeatSync
|
||||
|
||||
M = b"\x01\x02\x03\x04\x05\x06"
|
||||
@@ -124,7 +124,7 @@ def test_legacy_and_beat_frames():
|
||||
|
||||
def test_inbox_overflow_counted():
|
||||
link, _, _ = make()
|
||||
for i in range(20):
|
||||
for i in range(INBOX_MAX + 4):
|
||||
link.on_packet(M, data(i, b"x"), 0)
|
||||
assert link.stats["dropped"] == 4
|
||||
|
||||
|
||||
Reference in new issue
Block a user