coffee_tag
A coffee machine kiosk running on a Raspberry Pi 4: badge in, brew a coffee on a Jura E6 (through juracoffeemachine), and pay from a prepaid balance.
Features
- Login with an RFID/NFC badge or by name, and self-registration.
- Brewing with presets, and a debt ceiling per account.
- Admin screens on the kiosk, with three roles: user, maintainer and owner.
- Email notifications (registration, low balance, date of departure).
- The Jura counters are logged periodically (every weekday during the day, plus once at night).
Admin web app
Open http://<pi-address>:8080/login. It lets you:
- view a dashboard (balances, stock, errors),
- manage users,
- record payments and transfers,
- browse purchases and stock,
- send and resend emails,
- export the database as SQL or CSV.
Hardware
TODO: parts list (cables, level shifter/relay if any)
TODO: schematic
TODO: Jura connector pinout and voltage levels
TODO: what GPIO23 switches on the Jura side
TODO: screen model and how it is connected
TODO: PN532 jumper settings (I2C mode, address 0x24)
Only the used pins are labelled:
| Usage | Pin | Left Signal | Right Signal | Pin | Usage |
|---|---|---|---|---|---|
| 1 | 3V3 Power | 5V Power | 2 | PN532 (red) | |
| PN532 SDA (yellow) | 3 | GPIO2 (SDA1) | 5V Power | 4 | Screen (red) |
| PN532 SCL (green) | 5 | GPIO3 (SCL1) | GND | 6 | Screen (brown) |
| 7 | GPIO4 | GPIO14 (TXD0) | 8 | Jura RX (blue) | |
| Jura (black) | 9 | GND | GPIO15 (RXD0) | 10 | Jura TX (brown) |
| 11 | GPIO17 | GPIO18 (PWM0) | 12 | ||
| 13 | GPIO27 | GND | 14 | PN532 (brown) | |
| 15 | GPIO22 | GPIO23 | 16 | Jura power (white) | |
| 17 | 3V3 Power | GPIO24 | 18 | ||
| 19 | GPIO10 (MOSI) | GND | 20 | ||
| 21 | GPIO9 (MISO) | GPIO25 | 22 | ||
| 23 | GPIO11 (SCLK) | GPIO8 (CE0) | 24 | ||
| 25 | GND | GPIO7 (CE1) | 26 | ||
| 27 | GPIO0 (ID_SD) | GPIO1 (ID_SC) | 28 | ||
| 29 | GPIO5 | GND | 30 | ||
| 31 | GPIO6 | GPIO12 (PWM0) | 32 | ||
| 33 | GPIO13 (PWM1) | GND | 34 | ||
| 35 | GPIO19 (PCM_FS) | GPIO16 | 36 | ||
| 37 | GPIO26 | GPIO20 (PCM_DIN) | 38 | ||
| 39 | GND | GPIO21 (PCM_DOUT) | 40 |
The Jura's TX/RX must be connected to the Pi's RX/TX (crossed). The NFC reader is a 13.56 MHz Waveshare PN532 NFC HAT.
Install
The Pi must run Raspberry Pi OS 64-bit (desktop, Trixie) with a user named coffee.
-
In
/boot/firmware/config.txt, set the following lines and reboot:dtparam=i2c_arm=off dtoverlay=i2c1,pins_2_3 init_uart_clock=16000000 dtoverlay=miniuart-bt dtoverlay=uart0 gpio=23=ip enable_uart=1 -
Install the dependencies and pipx:
sudo apt install -y python3-tk python3-pillow libjpeg-dev sqlite3
-
Install the app with
pipx install coffee_tag. -
Copy config.template.json to
/home/coffee/coffee/config.jsonand edit it (every key is documented in the file). -
Start the app (see Usage), register yourself on the kiosk, then make yourself an owner:
sqlite3 /home/coffee/coffee/coffee.db "UPDATE users SET permissions='owner' WHERE mail='you@example.com';"
To upgrade: close the app, copy the database, run pipx upgrade coffee_tag and restart the app.
Usage
Start the app with the command below. After this first run, it starts automatically at boot.
coffee_tag /home/coffee/coffee/config.json
Where to look when something breaks
- Screen and buttons: gui.py
- Badge not read: rfid.py and pn532/
- Coffee flow and notifications logic: coffee.py (then juracoffeemachine for the brewing itself)
- Accounts, balances and stock: database.py
- Admin web app: website/
- Emails: mail/
Development
sudo apt install python3-tk python3-pillow libjpeg-dev
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp config.template.json config.json # then edit it
python -m coffee_tag config.json --dev --read-only --verbose
--dev disables the RFID reader and the Jura (badges are typed in the console), --read-only protects the database.
python -m coffee_tag -h lists the other flags, and python -m test.mock_app runs the app with a fake Jura.
Tests run on GitLab. Every commit on the default branch is published to PyPI by GitHub Actions, so remember to bump
the version in pyproject.toml.
Contributing & license
Issues and pull requests are welcome on GitHub. See LICENSE.
Metadata
Release files for coffee-tag 0.44.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coffee_tag-0.44.2.tar.gz | 176.5 kB | With provenance | Details for coffee_tag-0.44.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coffee_tag-0.44.2-py3-none-any.whl | Python 3 | none | any | Details for coffee_tag-0.44.2-py3-none-any.whl |
Total release size: 364.8 kB
Release files / coffee_tag-0.44.2.tar.gz
| Download URL | coffee_tag-0.44.2.tar.gz |
|---|---|
| Size | 176.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6523e61fe2c9968834dc74827b39fde90c10a7286f119e6256b84601885360ee
|
|
BLAKE2b-256 checksum How to use checksums |
da8ea23678d283a9fa2fb499daf90e4c878664b1007c83f01fd9ad5df3628bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / coffee_tag-0.44.2-py3-none-any.whl
| Download URL | coffee_tag-0.44.2-py3-none-any.whl |
|---|---|
| Size | 188.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
79a6077778ef6a55f4a89017e6a5ce781b624eafe2cda1645f39627ae5f16c1e
|
|
BLAKE2b-256 checksum How to use checksums |
bb42192a4b453901b6eea3eecd4ae5c08e6a6a8c229e204b8bba0c1298501653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for coffee-tag 0.44.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for coffee_tag-0.44.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.