Files
camera-webui/README.md
T
Mikkeli f189a41b02 Correct the camera triage: both Pi 5 connectors take a camera
The first version told the reader a camera in "a DISP port" would never appear.
That is Pi 4 thinking. The Pi 5 has two 4-lane MIPI connectors, CAM/DISP 0 and
CAM/DISP 1, and BOTH are dual-purpose — either one accepts a camera. Left as
written it would have sent someone hunting a port mix-up that cannot happen,
and away from the likelier cause.

Promotes that likelier cause to the top: the Pi 5 uses the narrow 22-pin FPC,
while Pi 4-era camera modules ship with a 15-pin cable and need the adapter.

Also records the evidence that narrows this to hardware rather than config.
pisp_be is loaded and /dev/media0-2 exist, so the imaging pipeline is up, but
/sys/bus/i2c/devices holds only i2c-13 and i2c-14 — no camera bus was
instantiated and no CFE bound. camera_auto_detect probes at boot and loads a
sensor overlay when it finds one, so an absent bus means the firmware found
nothing to probe. Confirmed unchanged across a reboot.
2026-08-05 23:17:47 +09:00

89 lines
3.5 KiB
Markdown

# pi5-camera-webui
Camera service for a Raspberry Pi 5: a live video feed served over a small web UI, with face
recognition planned as a later stage.
Developed on the machine it runs on (`pi5`), with Codex as the coding client — see [AGENTS.md](AGENTS.md).
## Hardware
| | |
|---|---|
| Board | Raspberry Pi 5 Model B Rev 1.1 |
| OS | Debian 12 (bookworm), aarch64 |
| Camera | Pi camera module, connected to a CAM port |
| Host | `pi5`, `192.168.2.154` |
## ⚠ Current state: the camera is NOT detected
Nothing is built yet, and **the camera is not visible to the system**, so start here:
```console
$ rpicam-hello --list-cameras
No cameras available!
```
This is a *detection* problem, not a software one — the userland is already in place:
- `camera_auto_detect=1` is set in `/boot/firmware/config.txt` (the correct default; nothing to add)
- 12 `libcamera`/`rpicam` packages are installed
- **`dmesg` contains no camera probe lines at all** — no sensor (`imx*`, `ov5647`), no CFE
That last point is the diagnostic one. A camera that is seen but misconfigured still leaves probe
messages; **silence means the sensor is not being reached electrically.**
The imaging pipeline itself is fine, which narrows it further:
```console
$ lsmod | grep -iE 'pisp|cfe'
pisp_be 49152 0 # ISP backend loaded
$ ls /sys/bus/i2c/devices/
i2c-13 i2c-14 # no camera i2c bus
```
`camera_auto_detect=1` probes the connectors at boot and loads a sensor overlay when it finds
something. **No sensor i2c bus was instantiated and no CFE bound**, so the firmware found nothing to
load an overlay for. Nothing in software will change that.
So check the physical connection, power off first:
1. The Pi 5 uses the **narrower 22-pin** FPC connector. Cameras from the Pi 4 era ship with a
**15-pin** cable, which needs the 22-pin-to-15-pin adapter cable — this is the most common cause
of a camera that is connected but invisible.
2. Ribbon **orientation**: contacts face the correct side at *each* end, and the two ends are not the
same way round.
3. The connector latch is fully seated at both ends.
4. Try the **other connector** — the Pi 5 has two, `CAM/DISP 0` and `CAM/DISP 1`, and **both are
dual-purpose**, so either accepts a camera. Swapping isolates a faulty port.
Re-check with:
```bash
rpicam-hello --list-cameras # should list a sensor
dmesg | grep -iE 'imx|ov5647|cfe' # should show a probe
ls /sys/bus/i2c/devices/ # a new bus should appear
```
**Do not treat `/dev/video*` as evidence the camera works.** Those nodes exist on this Pi already
and belong to the video codec and ISP blocks — they are present with no camera attached at all.
`picamera2` is **not** installed yet (`import picamera2` fails); it is the expected capture library
once a sensor is detected.
## Planned stages
1. **Capture** — confirm a sensor, grab a still, establish resolution/format.
2. **Live feed** — MJPEG stream first (simplest thing that works in a browser); WebRTC later if
latency demands it.
3. **Web UI** — single page showing the live feed, plus basic controls.
4. **Face recognition** — detection first, recognition after; run it on a downscaled frame, not the
full stream.
Each stage should be usable on its own before the next begins.
## Development
The model endpoint and MCP gateway live on `halogen` and are reachable from this Pi by name.
Codex is installed and configured here; see [AGENTS.md](AGENTS.md) for how it is expected to work in
this repo.