You are browsing as a guest. Sign up (or log in) to start making projects!

55m 45s logged

Basic anki sync achieved!

Cards are now downloaded from Anki on my laptop when the app is opened
and loaded into memory for review.

How I achieved this

I am running an anki plugin on my laptop called anki-connect which provides a REST API for interacting with cards, decks, notes etc…

The process looks like this:

  • Retrieve deck names
  • For each deck, retrieve card IDs
  • Retrieve each card by ID

Attached is a video showing 3 cards being synced.

Issues to be addressed in future

Each card is retrieved with an independent API request even though its possible to retrieve them in bulk

Why: My current implementation loads the entire response body into
memory at once then deserialises it. Each card in the response is
roughly 1KB, so loading many at once would require more memory than the
ESP32 has.

Fix: Implement a streaming approach instead where cards are saved to the
SD card as they are received, reducing memory usage.

Cards are lost when the app is exited

Why: I wanted a quick CardStore implementation to test the sync with so
cards are only stored in memory.

Fix: Implement a CardStore which saves them to the SD Card

0
2

Comments 0

No comments yet. Be the first!