Repository navigation
Device-initiated flashcards sync on WiFi connect (firmware 0.1.14) - #4
Merged
watchmesink merged 1 commit intoJun 11, 2026
Conversation
When WiFi comes up, the firmware runs one background sync pass against the companion web app configured in /.crosspoint/flashcards_sync.json: - SM-2++ progress bins are merged via POST /api/sync/<deck>/progress and written back only when changed - deck TXT files reconcile against GET /api/sync/<deck>/manifest: web-only files download, device-only files upload, web deletion tombstones delete locally, content conflicts resolve device-wins - at most one pass per connection (5-min retry on errors), auto-sleep is held off while syncing, module is inert without the config file Web server: adds the manifest endpoint and deletion tombstones (recorded on DELETE, cleared on PUT). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
watchmesink
merged commit Jun 11, 2026
d23e376
into
codex/flashcards-sm2pp-upload
1 of 6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The device now syncs flashcards with the companion web app by itself, whenever it connects to WiFi — no laptop-side agent needed for the common path.
Firmware (
src/network/FlashcardsWebSync.{h,cpp}, wired intomain.cpp)/api/sync/<deck>/progress; the server merges with web reviews (more-reviewed record per card wins) and the merged bin is written back only when it differs (no flash wear when idle)./flashcards/<deck>/*.txtreconcile against/api/sync/<deck>/manifest— web-only files download, device-only files upload, web deletion tombstones delete locally, content conflicts resolve device-wins (sha256 compare)./.crosspoint/flashcards_sync.json({"url", "token", "enabled"}); without it the module is fully inert.WiFiClientSecure(same pattern asHttpDownloader); progress JSON is built/parsed without ArduinoJson to keep peak heap low.Web server (
web/server.js)GET /api/sync/:deck/manifest→{files: [{name, size, sha256}], tombstones: [...]}.DELETEon a deck file records a tombstone (so the device deletes instead of re-uploading);PUTclears it.Binary
0.1.14-gleb-firmware.binbuilt from this branch (RAM 31.1%, flash 96.7%).Testing
pio run -e default). On-device validation: flash, connect WiFi, watch serial for[FSY]log lines.🤖 Generated with Claude Code