For a detailed architectural overview and task system design, see:
git clone https://github.com/OpenScan-org/OpenScan3.git
cd OpenScan3
python3 -m venv .venv
source .venv/bin/activate
# Install the package in editable mode with dev extras (runtime + tooling)
pip install -e .[dev]Run the API in dev mode (auto-reload):
python -m openscan_firmware serve --reload --host 0.0.0.0 --port 8000Run tests (skip hardware/camera-specific tests on non‑Pi):
pytest -q -k "not picamera2"Note: On non‑Pi systems, camera features may be unavailable; skip camera tests as shown above.
- Run the quick suite (
pytest -q -k "not picamera2") before opening a pull request; it exercises everything that does not require Pi-only camera stacks. - Hardware or camera-focused tests should be guarded with markers so they can be skipped on desktop but must pass on Raspberry Pi CI targets.
- When you fix a bug or add behavior, aim to provide a regression/unit test proving the change—optional for now because the suite is still inconsistent, but appreciated when feasible.
For camera/hardware development directly on a Raspberry Pi OS (Lite) system:
sudo apt-get update && sudo apt-get install -y \
git libgphoto2-dev libcap-dev python3-dev python3-libcamera python3-kms++ python3-opencv
# Optional (per camera): install PiVariety/libcamera packages as per vendor docs
# See Arducam IMX519 docs:
# https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/16MP-IMX519/
git clone https://github.com/OpenScan-org/OpenScan3.git
cd OpenScan3
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip install -e .[dev] # Drop [dev] if you only need runtime dependencies
# Start the API with auto-reload
python -m openscan_firmware serve --reload --host 0.0.0.0 --port 8000You need to load a device configuration specific to your hardware setup. By default, no specific configuration is loaded.
There are three ways to load a configuration:
Method 1: Using the SPA client (Recommended)
- If you booted from the official OpenScan image, the bundled SPA client is available at
http://openscan3-alpha. - Open the page in a browser on the same network; the guided setup wizard walks you through selecting the correct hardware profile.
- Confirm the suggested configuration; the SPA will push it to the firmware and trigger any required reloads automatically.
Method 2: Using the API docs
- Navigate to the API documentation at
http://openscan3-alpha:8000/latest/docs. - Find the Device Section and the PUT endpoint
/latest/device/configurations/current. - Use the "Try it out" feature.
- In the Request body, enter the name of the configuration file you want to load. For example, for an OpenScan Mini with a Greenshield, use:
You can find available default configuration files in the local
{ "config_file": "default_mini_greenshield.json" }settings/device/folder of your checkout. - Execute the request. If successful, you should receive a
200 OKresponse, and the hardware corresponding to the configuration should initialize.
Method 3: Manual File Copy
Alternatively, copy a default settings file to device_config.json and restart the service:
cp settings/device/default_mini_greenshield.json device_config.json
sudo systemctl restart openscan-firmware.serviceAfter loading the correct configuration, your OpenScan hardware should be ready to use via the web interface.