Automated pre-warning for orienteering with support for voice and large display.
The PreWarning application is intended to be used to perform pre-warning for an Orienteering Relay event. It can be used with a display and a speaker to give both visual and audible pre-warnings. Either can be omitted to use only one of them. When using a display it is best used in the portrait orientation, but both orientations are supported. A TV can be used to get a bigger screen.
- The application fetches electronic punches from a Punch Source.
- Looks up the teams' bib number and which relay leg that punch belongs to from a Start List Source.
- Displays the punch time, bib number and relay leg on the display and reads out the bib number in the speakers.
There are multiple choices for both Punch Sources and Start List Sources.
The application can be controlled interactively or driven entirely from the configuration file. In the interactive mode the right click menu or hotkeys can be used.
One of these Punch Sources is selected to be used to fetch the electronic punches.
Fetches electronic punches from the site roc.olresultat.se. These punches have been sent to the site using a Raspberry Pi running the ROC software or an Android device running the SI-Droid ROC app.
Fetches electronic punches from the MySQL database used by the OLA event organizing software. These punches have been fetched or received using one of the built-in methods in OLA. OLA must be using MySQL as the database engine, the built-in database is not supported.
Fetches electronic punches from a running MeOS instance via its Information Server REST API (MOP protocol). MeOS must have the Information Server enabled (Services → Information Server). For real-time notifications, enable "Send and receive fast advance information" in MeOS (requires a networked setup). Optionally listens for UDP broadcast packets to trigger immediate polling between configured intervals.
One of these Start List Sources is selected to be used to look up the bib number and relay leg for the punches.
Looks up the team bib number and relay leg from the MySQL database used by the OLA event organizing software. OLA must be using MySQL as the database engine, the built-in database is not supported. If the received punch data already contains the bib number and leg no operation will be performed.
Looks up the team bib number and relay leg from a running MeOS instance via its Information Server REST API. MeOS must have the Information Server enabled (Services → Information Server). If the received punch data already contains the bib number and leg no operation will be performed.
Reads a start list file following the IOF 3.0 Data Standard and uses it to look up the team bib number and relay leg. Files generated by OLA and OS2010 have been tested. The file will be monitored and re-read if it changes.
This project uses uv for dependency management and packaging.
- uv (install once)
| Action | Command |
|---|---|
| Install/sync dependencies | uv sync |
| Run the application | uv run prewarning |
| Add a dependency | uv add <package> |
| Remove a dependency | uv remove <package> |
| Update lockfile | uv lock |
| Run tests | uv run pytest |
| Build Python package (sdist/wheel) | uv build |
| Build executable (PyInstaller) | uv run scripts/package.py |
| Clean build artifacts | uv run scripts/clean.py |
| Run all CI checks locally | uv run scripts/precommit.py |
Tests live in tests/ and use pytest. Run them with:
uv run pytest
Before pushing, run all CI checks locally:
uv run scripts/precommit.py
This runs: YAML lint, spelling, Ruff lint, Ruff format, dependency audit, mypy type checking, and pytest. The same checks run in CI on every push.
Upgrade a single dependency to the latest compatible version:
uv lock --upgrade-package <package>
Upgrade all dependencies to their latest compatible versions:
uv lock --upgrade
Upgrade a tool (e.g. PyInstaller):
uv add --dev pyinstaller@latest
uv sync
Upgrade uv itself:
uv self update
Change the Python version used by the project:
uv python pin <version>
uv sync
Then update requires-python in pyproject.toml to match.