# Pyvorin Edge SDK — Raspberry Pi Benchmark Pack

One-command benchmark suite for the Pyvorin Edge SDK running on a Raspberry Pi (ARM64 Linux).

## Download

```bash
curl -O https://pypi.pyvorin.com/pifiles/run-pi-benchmarks.sh
```

## Run

```bash
bash run-pi-benchmarks.sh
```

### Prerequisites

- Raspberry Pi 4 or 5 running 64-bit Raspberry Pi OS (or any ARM64 Linux)
- `pyvorin-edge` installed in `/home/<user>/pyvorin-edge` or `/opt/pyvorin-edge`
- A Python virtual environment inside the project (`venv/` or `.venv/`)

## What It Does

1. Validates that the script is running inside a `pyvorin-edge` installation
2. Activates the virtual environment
3. Runs `examples/industry_benchmarks/run_all.py` across all 8 verticals:
   - Smart Buildings
   - Predictive Maintenance
   - Cold Chain
   - Precision Agriculture
   - Solar Farm
   - Telecom Tower
   - Smart Warehouse
   - Water Utilities
4. Generates `CASE_STUDIES.md` with per-vertical cost breakdowns in GBP (£)
5. Prints a terminal summary showing data-reduction % and monthly savings (£)

## Generated Files

| File | Location | Description |
|------|----------|-------------|
| `benchmark_results_pi.json` | `~/pyvorin-edge/` | Raw JSON metrics for all 8 verticals |
| `CASE_STUDIES_PI.md` | `~/pyvorin-edge/` | Master markdown case-study document |

## Getting Results Off the Pi

### Option 1 — `scp` (recommended)

From your laptop or workstation:

```bash
scp pi@<pi-ip>:~/pyvorin-edge/benchmark_results_pi.json ./
scp pi@<pi-ip>:~/pyvorin-edge/CASE_STUDIES_PI.md ./
```

Replace `pi` with your Pi username and `<pi-ip>` with the device IP address.

### Option 2 — `rsync`

```bash
rsync -avz pi@<pi-ip>:~/pyvorin-edge/ ./pi-results/
```

### Option 3 — Copy-paste

If you only have a terminal session, print the contents and copy them:

```bash
cat ~/pyvorin-edge/benchmark_results_pi.json
cat ~/pyvorin-edge/CASE_STUDIES_PI.md
```

## Notes

- Benchmarks assume a 1 Hz sample rate for 24 hours of simulated data per vertical.
- Cost figures are expressed in **GBP (£)** using UK-calibrated defaults.
- No network connection is required after the initial download.
