Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d0ed0ab
feat: add manual test trigger functionality with haptic feedback and …
LeoLTM Sep 17, 2026
b1684a8
feat: enhance violation display for test triggers with conditional re…
LeoLTM Sep 17, 2026
55ffaef
feat: add testTrigger RPC method with response structure for violatio…
LeoLTM Sep 17, 2026
a1fa086
feat: display "TEST TRIGGER" label for negative measured speed in Las…
LeoLTM Sep 17, 2026
4e5909a
feat: implement testTrigger RPC method for capturing and storing test…
LeoLTM Sep 17, 2026
887cee5
chore: replace emdashes
LeoLTM Sep 17, 2026
390eb06
chore: remove retired electron and electronbun apps
LeoLTM Oct 28, 2026
4728361
chore: remove diagnostics suite and Electrobun leftovers
LeoLTM Oct 28, 2026
881c8f5
feat: report daemon version and commit
LeoLTM Oct 28, 2026
2f3cef5
refactor: resolve the network script in one place
LeoLTM Oct 28, 2026
b8929f8
fix: try passwordless sudo before a typed password on shutdown
LeoLTM Oct 28, 2026
9b8ddb4
fix(build): stop hard-coding library search paths
LeoLTM Oct 28, 2026
9646c2c
feat: package the daemon as an arm64 .deb
LeoLTM Oct 28, 2026
9d139cc
feat: replace the install, deploy and cleanup scripts with pi.sh
LeoLTM Oct 28, 2026
110fba4
test: replace ad-hoc server scripts with a bun test suite
LeoLTM Oct 28, 2026
c3b76d4
ci: package the .deb, attach it to releases, run integration tests
LeoLTM Oct 28, 2026
a4b13b6
docs: document the packaged install, updates and releases
LeoLTM Oct 28, 2026
35b82c5
fix(packaging): validate sudoers as root so CI's build user can run it
LeoLTM Oct 28, 2026
f1447f6
Merge pull request #56 from LeoLTM/chore/deploy-pipeline
LeoLTM Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 51 additions & 19 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ on:
default: true

jobs:
headless-build:
name: Headless-Rust — Build
headless-package:
name: Headless-Rust — Package arm64 .deb
if: inputs.build-headless
runs-on: ubuntu-latest
defaults:
Expand All @@ -28,27 +28,59 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libaravis-dev libudev-dev pkg-config

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install frontend dependencies
run: bun install

# compile embedded web assets into dist/ for rust-embed
- name: Build frontend
run: bun run build
- uses: docker/setup-buildx-action@v4

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

# verify release binary compiles cleanly; no artifact upload needed (deploy not required)
- name: Build release binary
run: cargo build --release
# Debian Bookworm cross toolchain (same image as local `bun run package`), layer-cached
- name: Build cross-compilation image
uses: docker/build-push-action@v7
with:
context: headless-rust/packaging
file: headless-rust/packaging/Containerfile
tags: speedcamera-cross:bookworm
load: true
cache-from: type=gha,scope=speedcamera-cross
cache-to: type=gha,mode=max,scope=speedcamera-cross

- name: Cache cargo registry and arm64 build
uses: actions/cache@v5
with:
path: |
headless-rust/target/cross-cache
headless-rust/target/aarch64-unknown-linux-gnu
key: cross-arm64-${{ hashFiles('headless-rust/Cargo.lock', 'headless-rust/packaging/Containerfile') }}
restore-keys: cross-arm64-

- name: Build .deb
env:
VERSION: ${{ inputs.version }}
CONTAINER_ENGINE: docker
SKIP_IMAGE_BUILD: '1'
run: |
if [ -n "$VERSION" ]; then
cargo_version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)
tag_version="${VERSION#v}"
if [ "${tag_version%%-*}" != "$cargo_version" ]; then
echo "::error::Tag $VERSION does not match Cargo.toml version $cargo_version. Bump Cargo.toml first."
exit 1
fi
# v1.2.0-canary -> 1.2.0~canary, which dpkg orders before the final 1.2.0
export SPEEDCAMERA_DEB_VERSION="$(printf %s "$tag_version" | tr - '~')"
fi
deb=$(./packaging/build-deb.sh)
mkdir -p ../dist-deb
# stable asset name so releases/latest/download/speedcamera_arm64.deb always resolves
cp "$deb" ../dist-deb/speedcamera_arm64.deb

- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: speedcamera-deb
path: dist-deb/speedcamera_arm64.deb
if-no-files-found: error
retention-days: 7

arduino-build:
name: Arduino — Build Firmware
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ jobs:
permissions:
contents: write
steps:
# only publish arduino firmware binary to release - headless-rust binaries not deployed
- name: Download firmware artifact
uses: actions/download-artifact@v8
with:
name: arduino-firmware
path: artifacts

- name: List artifacts
- name: Download Pi package
uses: actions/download-artifact@v8
with:
name: speedcamera-deb
path: artifacts

# verified by packaging/install.sh and `scripts/pi.sh deploy --release`
- name: Write checksums
working-directory: artifacts
run: |
echo "Artifacts to publish:"
ls -lh artifacts/
sha256sum * > SHA256SUMS
ls -lh
cat SHA256SUMS

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: oven-sh/setup-bun@v2

- name: Install frontend dependencies
run: bun install
run: bun install --frozen-lockfile

- name: TypeScript type-check
run: bun tsc --noEmit
Expand All @@ -32,8 +32,15 @@ jobs:
- name: Build frontend
run: bun run build

# cache-workspaces: rust-cache defaults to ./target, which misses headless-rust/target
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: headless-rust

- name: Run cargo tests
run: cargo test
run: cargo test --locked

# boots the daemon in mock mode: HTTP endpoints, Socket.io RPC, live events
- name: Run integration tests
run: bun run test:integration
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@ An end-to-end vehicle speed measurement, GigE Vision camera capture, and remote
| --------- | ----------- |
| [**`headless-rust`**](./headless-rust) | **(Recommended)** High-performance single-binary headless daemon and responsive Web UI controller for Raspberry Pi 5 built with Rust (Axum 0.8, Socket.io, native Aravis C FFI, SQLite) and embedded React + Vite frontend. Features IoT-style open AP setup hotspot (`192.168.4.1`) with captive portal redirect, Client Wi-Fi operation mode with scannable connect QR codes, and a dedicated GigE Vision Camera LAN (`192.168.1.100`). |
| [**`arduino`**](./arduino) | Microcontroller firmware (ESP8266 / ESP32) reading dual optical light barriers to calculate vehicle speeds and transmit telemetry over Serial. |
| [**`electronbun`**](./electronbun) | Desktop companion application rewrite built with Electron and Bun. |
| [**`electron`**](./electron) | *(Legacy)* Desktop companion app made with classic Electron. |

The earlier desktop apps (`electron/`, `electronbun/`) were retired in favour of `headless-rust`; they remain in the git history.

---

## Quick Deployment Commands (Raspberry Pi 5)

All deployment and maintenance commands are executed from your development laptop over SSH. The scripts pull the repository and perform all frontend asset builds and native Rust compilation directly on the Raspberry Pi.
Run from your laptop. The Pi installs a prebuilt `.deb` and never compiles anything, so updates also work over its offline hotspot.

```bash
cd headless-rust

# 1. Fresh Pi Setup (Pi connected to Home LAN/Wi-Fi with DHCP)
bun run install:pi pi@raspberrypi.local

# 2. Upgrade Existing Pi (in Client Wi-Fi Mode or Home LAN)
bun run deploy:pi pi@raspberrypi.local
# or when connected to Pi Wi-Fi hotspot during setup:
bun run deploy:pi pi@192.168.4.1
# Install or update (fresh Pi, old git-checkout install, or already packaged)
bun run deploy pi@raspberrypi.local # build the package from this checkout
bun run deploy pi@192.168.4.1 --release # latest GitHub release, via the Pi hotspot

# 3. Complete Cleanup & Reset Network to DHCP
bun run cleanup:pi pi@raspberrypi.local
# Inspect, follow logs, remove
bun run pi status pi@raspberrypi.local
bun run pi logs pi@raspberrypi.local
bun run pi uninstall pi@raspberrypi.local # --purge also deletes data
```

For full documentation on architecture, network onboarding flow, offline/client operation, dependencies, migration guide, and local mock testing, see the [**Headless Rust Documentation**](./headless-rust/README.md).
105 changes: 0 additions & 105 deletions arduino/old/old.cpp

This file was deleted.

Loading
Loading