# Knödel Watch

[![build](https://github.com/yanxuceo/knoedel-watch/actions/workflows/build.yml/badge.svg)](https://github.com/yanxuceo/knoedel-watch/actions/workflows/build.yml)

English | [中文](README.zh.md)

**Little animated characters act out every word. Learn a language on a tiny round screen.**

> 🇩🇪 This first version teaches **German** (level A2), with English and Chinese translations. Its course is called *Deutsch mit Knödel*. More languages can follow: the deck format is not tied to German.

<p align="center"><img src="docs/img/hero.gif" width="798" alt="Three watches: Knödel celebrates with confetti, Brezel vacuums, Brezel rides a bike"></p>

Animated vocabulary cards for the M5Stack StopWatch Dev Kit (ESP32-S3, round AMOLED touch screen, speaker, motion sensor). Two characters act out every word: **Knödel**, a dumpling, shows adjectives and expressions; **Brezel**, a ginger cat, does the verbs. Nouns show the thing itself, on a disc in the colour of its gender.

Each card has up to three faces: the word with its animation, the grammar line with an example sentence and its translation, and a tip. Every German line is spoken, in synthetic voices (Microsoft Azure neural text-to-speech, not recordings of real people); short dialogues are spoken in two voices. Around the cards the watch has a practice mode with spaced repetition, a clock with a word of the day, and a focus timer. Since 0.3 it also keeps **your own sentences** (a sentence book you fill from the browser) and takes **voice notes**: hold a key, say what you have to do in any mix of Chinese, German and English, and it becomes a list you tick off (with your own OpenAI key).

> **About the content.** The cards were written by an AI and have not been proofread by a native speaker yet. If you find a mistake, please open an issue: it will be fixed in the next content pack.

## Meet Knödel and Brezel

The words are not just shown, they are acted out. Every card has its own little scene, drawn live on the watch from data: a pose, motions, effects, props and a thought bubble.

**Knödel**, a Bavarian dumpling, does feelings, states and reactions: it beams, sulks, yawns, sneezes, blushes and thinks of what it misses in a bubble.

<p align="center"><img src="docs/img/knoedel.png" width="974" alt="Knödel on eight cards: glücklich, traurig, sauer, überrascht, müde, erkältet, lustig, Herzlichen Glückwunsch"></p>

**Brezel**, a ginger cat, does the verbs, and brings props: a vacuum, a watering can, a bike, an umbrella in the rain, a bus that drives off without her, a card terminal, a piggy bank, the door of a surgery.

<p align="center"><img src="docs/img/brezel.png" width="974" alt="Brezel on eight cards: staubsaugen, Blumen gießen, Fahrrad fahren, mitnehmen, verpassen, bezahlen, sparen, vorbeikommen"></p>

Around the cards: example dialogues in two voices, a practice mode that asks with the acting alone and cheers you on, a clock with a word of the day, and a focus timer.

<p align="center"><img src="docs/img/screens.png" width="1210" alt="A dialogue example, a practice question, a celebration, the clock, the focus timer, the clock in the main menu"></p>

## Hardware

One [M5Stack StopWatch Dev Kit](https://openelab.io/products/m5stack-stopwatch-dev-kit-esp32-s3?sca_ref=12520936.Zn0RxZ6jdFG) and a USB-C cable. Nothing else is needed.

That is an affiliate link: if you buy through it, the author of this project earns a commission, at no extra cost to you. The kit is also sold by M5Stack directly and by other shops.

### Other boards

The firmware reaches the hardware through a small board layer, [`main/board/board.h`](main/board/board.h), so it runs on other ESP32-S3 boards with a round touch screen of about 460 to 480 px, two keys and a speaker. Supported so far:

| Board | Status |
|---|---|
| M5Stack StopWatch Dev Kit | the main board, tested before every release |
| [Waveshare ESP32-S3-Touch-AMOLED-1.75C](docs/boards/waveshare-175c.md) | ported and maintained by [@pockegar](https://github.com/pockegar), tested on their board as time allows |

To port it to yours, see [docs/PORTING.md](docs/PORTING.md).

## Install

No development tools needed: open the **[web installer](https://yanxuceo.github.io/knoedel-watch/)** in Chrome or Edge on a computer, connect the watch with a USB-C data cable and press *Install*. On the first install, let it erase the watch; when updating later, keep the data and your progress stays.

Prefer the command line? Each [release](https://github.com/yanxuceo/knoedel-watch/releases) also has one image with everything: `pip install esptool`, then `python3 -m esptool --chip esp32s3 write-flash 0x0 knoedel-watch-<version>-full.bin` (a fresh install: it erases progress and settings).

To build it yourself, see [Build and flash](#build-and-flash).

## First start

The watch starts in English. To switch to Chinese: *Settings* → *Language*, tap. Then set the clock: *Settings* → *Time*, tap, and set hour, minute, day, month and year in turn (keys change the value, a tap moves on, the last tap saves). Learning works without the clock; only the clock face needs it.

## The main menu

| | |
|---|---|
| **Clock** | the time and a word of the day |
| **Words** | the decks, card by card |
| **Review** | a few cards you have seen, asked again |
| **Sentences** | your own sentence book: the meaning, the German, the pattern |
| **Notes** | your voice notes: tasks to tick off, ideas, what was done |
| **Focus timer** | 25 minutes of focus, 5 of break |
| **Knödel Orbit** | a little game: tilt to fly, shoot into the vortex |
| **Settings** | language, time, volume, brightness, how notes are sent, power off |

Menus are in the language chosen in the settings. The watch remembers where you were.

## Controls

| | |
|---|---|
| KEY B (blue, right) or swipe left | next |
| KEY A (yellow, left) or swipe right | previous |
| Tap the screen | open, next face of a card, change a setting, tick a task |
| Hold KEY A | back |
| Hold KEY B, anywhere | record a voice note while held (KEY A cancels) |
| Hold the screen on a note | its menu (delete, undo a tick) |

The motion sensor adds three gestures: **pick the watch up** to wake a dimmed screen, **turn it face down** to darken it (on the focus timer this also starts the timer), and **shake it** on the clock for another word.

On battery the screen dims after a minute and the watch switches itself off after five idle minutes. On USB power it stays on and, left alone, shows the clock.

## Words

Main menu → *Words* → a deck → its cards. Tap to turn a card over:

1. the character acts the word out, with the word and its meaning;
2. the grammar line (past tense and perfect, plural, or a pattern with its case) and an example with its translation;
3. a tip.

## Review

Main menu → *Review* asks you a handful of the cards you have already seen, a minute or two at a time.

1. The character acts the word out, with no text. After two seconds the meaning appears as a hint.
2. Say the German word to yourself, then press any key or tap to see and hear the answer.
3. KEY B (blue, ✓): you knew it. KEY A (yellow, ✗): not yet; the card comes back before the session ends.

Three right answers in a row earn a short celebration. Words you know return after 1, 2, 4 … 64 days; a word you missed starts again. There is no backlog to work off and nothing to configure.

## Sentence book

Sentences you collect yourself, from a podcast or an article, kept apart from the decks. Add them on the **[sentence book page](https://yanxuceo.github.io/knoedel-watch/sentences/)** (Chrome or Edge, the watch on USB): one by one, or paste a whole exercise and check how it was split into meaning, German and pattern before it is saved. Export and import as JSON or Markdown.

On the watch: Main menu → *Sentences*. The sentences come in a new random order each time you open the book. Tap to turn: the meaning (in the language of the menus), the German, the pattern with its topic. A long text scrolls when you drag it up or down. The keys, or a sideways swipe, go to the sentence before or after.

## Voice notes

Hold KEY B anywhere and say what is on your mind; let go and the watch goes back to where it was. The memo is turned into a note online: transcribed (OpenAI `gpt-4o-mini-transcribe`) and tidied (`gpt-5-mini`) into **tasks** with their days, or an **idea**. Chinese, German and English may be mixed in one sentence; nothing is translated. "下周三" or "nächsten Freitag" become dates, counted by the watch from the day you said them.

Main menu → *Notes* lists the open tasks of all notes (by day) and the ideas, four to a page; tap to tick a task, hold one for its menu. After the tasks comes what was done: this week's count, a bar a day, the days in a row, and the list of everything done.

- **What it needs:** Wi-Fi (2.4 GHz) and **your own OpenAI API key**, both set on the **[settings page](https://yanxuceo.github.io/knoedel-watch/settings/)** over USB. Best a key of its own project with a monthly spend limit. A note costs a fraction of a cent.
- **Offline:** memos are kept (about six minutes of them) and go out when the watch is online again. On battery they go in batches to save power; on USB power, or with the notes page open, at once.
- **Privacy:** your recordings and their text go to OpenAI under your key, from the watch directly; there is no server of this project in between. The key stays on the watch and is never shown again (only its last four characters).
- **Boards:** the M5Stack StopWatch. The Waveshare board's microphones are not used yet.

## Clock

The time, the date, and a word of the day: its character acts it out, then the word and its meaning take the picture's place, in turns. Tap to hear the word; a key or a shake picks another one. The seconds run round the edge.

## Focus timer

The ring around the screen runs down with the time left: red while you focus, green during the break. Brezel writes along while you work; Knödel hums during the break. Tap to start or pause, KEY B skips to the other phase, KEY A starts the phase again. Or simply turn the watch face down: the timer starts and the screen goes dark.

When a phase ends, the watch buzzes twice, without a sound (fine in an office), and shows a German *Pause!* or *Weiter!*, even if you have left the timer screen. The Waveshare board has no motor and plays a short tune instead. A tap starts the next phase.

## Knödel Orbit

A game for the round screen, which is the arena: your ship runs along its rim, and Sauerkraut pours out of the vortex in the middle, shooting outward.

<p align="center"><img src="docs/img/orbit.png" width="1208" alt="Knödel Orbit: the title, Sauerkraut in a row, a charged beam, a Knödel bomb"><br><sub>From the web prototype the game was designed in.</sub></p>

| | |
|---|---|
| Tilt the watch | fly round the rim |
| Right key | fire; held a second and let go, a beam straight through the vortex |
| Left key | jump through the middle to the other side, taking what is in the way |
| Shake your wrist three times | a bomb that clears the screen (two a game) |
| Lay it face down | pause |
| Hold the left key | quit |

Bullets that pass close by (grazes) score and keep the combo going, and the motor ticks each time. On the title, a tap switches the steering: *marble* (the ship rolls toward the way the watch leans) or *wheel* (left and right turn it). The way you hold the watch when a game starts counts as level. The sounds and music are made by the watch itself. On the Waveshare board there is no motor, and only one sound plays at a time.

## What is on the watch

The program and the learning content are separate:

| | Program (firmware) | Content pack |
|---|---|---|
| Holds | menus, characters, clock, timer, audio player | decks, fonts, audio |
| Changes | when the code changes | when decks are added or corrected |
| Written with | `idf.py flash` | `python3 tools/flash_content.py` |

So new content does not need a new firmware, and a watch can be moved from one pack to another (say, from A2 to B1) in under a minute.

The first pack, `a2-start`, has 15 decks of 12 cards, 180 cards in all, at level A2 (two with some B1 words). Translations are in English and Chinese.

| Deck | Topic | Kind | Examples | Level | Acted by |
|---|---|---|---|---|---|
| Wie fühlst du dich? | Moods and emotions | adjectives | glücklich, traurig, nervös | A2–B1 | Knödel |
| Wie geht's dir? | Body and health | adjectives | müde, hungrig, durstig | A2 | Knödel |
| Wie bist du? | Personality | adjectives | fleißig, faul, ordentlich | A2 | Knödel |
| Hausarbeit | Household chores | verbs | aufräumen, putzen, staubsaugen | A2 | Brezel |
| Unterwegs | On the go | verbs | Fahrrad fahren, sich beeilen, verpassen | A2 | Brezel |
| Reaktionen | Quick reactions | phrases | Wie bitte?, Ach so!, Echt? | A2 | Knödel |
| Einkaufen | Shopping | verbs | aussuchen, anprobieren, passen | A2 | Brezel |
| Termine | Appointments | verbs | anrufen, zurückrufen, bestätigen | A2 | Brezel |
| Meine Wohnung | At home | nouns | das Sofa, der Teppich, die Lampe | A2 | the things themselves |
| Beim Arzt | At the doctor's | nouns | der Arzt, die Praxis, das Fieber | A2 | the things themselves |
| In den Bergen | In the mountains | nouns | der Berg, der Rucksack, die Hütte | A2 | the things themselves |
| Wir waren wandern! | Hiking | verbs | packen, wandern, klettern | A2 | Brezel and Knödel |
| Auf der Hütte | At the mountain hut | phrases | Grüß Gott!, Prost!, Zahlen, bitte! | A2 | Brezel and Knödel |
| Im Fitnessstudio | At the gym | verbs | sich aufwärmen, trainieren, Gewichte heben | A2–B1 | Brezel and Knödel |
| Sport im Freien | Outdoor sports | verbs | joggen, Fußball spielen, Ski fahren | A2–B1 | Brezel and Knödel |

The last five are two little series: a hiking trip to the Dolomites, where German is spoken and Knödel is the local dish, and a sports double episode with Knödel as the coach.

**[Browse all the cards](https://yanxuceo.github.io/knoedel-watch/decks/)** in your browser: click a card to turn it.

**More decks are on the way.** New ones come out in new content packs, installed from the [web installer](https://yanxuceo.github.io/knoedel-watch/) like the firmware. Is there a topic you would like? [Open an issue](https://github.com/yanxuceo/knoedel-watch/issues).

## Build and flash

You need [ESP-IDF](https://docs.espressif.com/projects/esp-idf/) v6.0, and for the content pack Python 3 with `pip install jsonschema pillow fonttools esptool`, plus `cmake` and SDL2 (`brew install sdl2`) for the layout check.

```bash
# 1. the program
idf.py -p <port> flash

# 2. the content pack
python3 tools/import_decks.py          # builds packs/a2-start.bin from content/
python3 tools/flash_content.py         # writes it to the watch
```

A watch without a content pack says "No content" and waits for step 2.

`import_decks.py` checks every deck, lays out every text of every language with the firmware's own drawing code, and refuses a pack with text that does not fit the round screen. To skip that check (no cmake or SDL2), pass `--skip-fit`. `--locale zh-Hans` makes Chinese the language a new watch starts in.

### Making a release

```bash
idf.py build && python3 tools/import_decks.py && python3 tools/make_release.py
```

`release/site/` is the web installer (ESP Web Tools: page, manifest, the four parts of the flash); publish it with GitHub Pages. `release/knoedel-watch-<version>-full.bin` goes to the GitHub release. The version is `PROJECT_VER` in `CMakeLists.txt`. To try the installer before publishing: `python3 -m http.server -d release/site 8000`, then open http://localhost:8000.

### Audio

The repository's audio was generated with Azure Speech. You only need a speech service if you change or add German text:

- `--paid` generates the missing clips with Azure (`SPEECH_KEY` and `SPEECH_REGION` in the environment). Without it the importer only reports what would be generated.
- `--audio edge` uses the free edge-tts instead (`pip install edge-tts`), good enough for trying your own cards. Such clips are kept out of git.

## Make your own decks

A deck is one folder, `content/<deck-id>/`, with a `deck.json`. The format is described in [FORMAT.md](FORMAT.md) and checked by `tools/check_deck.py`; `tools/build_preview.py` gives you a web preview of a deck with the same animations.

`content/library.json` names a content pack and lists its decks. For another pack, write another library file and pass it with `--library`.

Animations are data: a card names a pose, motions, effects, props and a thought bubble from `registry/<character>.json`. What those names draw is in `main/knoedel.cpp`, `main/knoedel_bubbles.cpp` and `main/katze.cpp`, with `tools/preview/*.js` as the drawing reference.

## Repository

```
main/          firmware (ESP-IDF, M5GFX)
main/board/    the hardware of each board, behind board.h
sim/           desktop build of the screens, used for the layout check
tools/         importer, deck checker, audio, web preview, flashing
content/       decks and their audio
registry/      what each character can do
curriculum/    plan of the decks to come, and every word taught so far
FORMAT.md      the deck format
docs/PORTING.md  how to port the firmware to another board
```

## Licenses

- Source code: MIT ([LICENSE](LICENSE)).
- Learning content (`content/`, `curriculum/`): CC BY-NC-SA 4.0 ([content/LICENSE](content/LICENSE)). Share and adapt it for non-commercial use, with credit and under the same license.
- The characters Knödel and Brezel and the name "Deutsch mit Knödel": all rights reserved. Build, run and modify the project with them; do not use them for your own brand, product or merchandise.

Details and third-party components: [LICENSES.md](LICENSES.md).
