Post

Raspberry Pi Camera

Live camera feeds from Raspberry Pi Camera Module 3 in the Krill app

Raspberry Pi Camera

Raspberry Pi Camera: Live Monitoring

The Krill Platform supports live camera feeds from the Raspberry Pi Camera Module 3, viewable on all platforms (iOS, Android, Desktop, and browser). Camera nodes sit under Projects alongside Data Points, Graphs, and Diagrams — making it easy to build visual monitoring dashboards for aquariums, grow rooms, labs, or any IoT setup.

Supported Hardware

CameraStatus
Raspberry Pi Camera Module 3 (IMX708)Supported
Raspberry Pi Camera Module 3 WideSupported
Raspberry Pi Camera Module 3 NoIRSupported
Other libcamera-compatible camerasMay work (untested)

Hardware Setup

What You Need

  • Raspberry Pi 5 (or Pi 4) running Krill Server
  • Raspberry Pi Camera Module 3
  • CSI ribbon cable (included with camera)

Connecting the Camera

  1. Power off the Raspberry Pi
  2. Locate the CSI camera port (between the Ethernet port and HDMI ports on Pi 5)
  3. Lift the plastic clip on the CSI connector
  4. Insert the ribbon cable with the blue side facing the Ethernet port
  5. Press the clip down firmly to secure the cable
  6. Power on the Pi

The ribbon cable is fragile. Avoid bending it sharply or pulling on it.

Software Setup

Quick Setup

Run the camera setup script on your Krill server:

1
sudo krill-camera-setup

This script:

  • Installs rpicam-apps (the official Raspberry Pi camera tools)
  • Adds the krill user to the video group for camera access
  • Enables camera_auto_detect=1 in the boot configuration
  • Tests that the camera is detected

Manual Setup

If you prefer to set up manually:

1
2
3
4
5
6
7
8
# Install camera tools
sudo apt install rpicam-apps-core

# Add krill user to video group
sudo usermod -aG video krill

# Verify camera is detected
rpicam-still --list-cameras

Expected output for Camera Module 3:

1
2
3
4
5
6
Available cameras
-----------------
0 : imx708 [4608x2592 10-bit RGGB] (/base/axi/pcie@1000120000/rp1/i2c@80000/imx708@1a)
    Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                             2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                             4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]

After Setup

Restart the Krill server to detect the camera:

1
sudo systemctl restart krill

The server will automatically detect the camera on startup. The Krill app will show a “Camera” option when adding nodes to a Project.

Using Camera Nodes

Creating a Camera Node

  1. Open the Krill app on any platform
  2. Navigate to a Project on your Pi server
  3. Open the Project menu and select Camera
  4. The camera node appears with a live feed thumbnail

Viewing the Live Feed

Click the camera node to see the full live feed. The feed updates at approximately 2 frames per second using JPEG snapshots from the camera.

Camera Settings

In edit mode, you can configure:

SettingDefaultDescription
Resolution1280x720Output resolution (720p, 1080p, or full 4608x2592)
Framerate15Frames per second
Rotation0Image rotation (0, 90, 180, 270 degrees)
Stream Port8443Port for the MJPEG stream
EnabledtrueEnable/disable the camera

Architecture

graph TD
    A[Pi Camera Module 3] -->|CSI ribbon| B[Raspberry Pi]
    B -->|rpicam-still| C[Krill Server]
    C -->|HTTPS + Bearer auth| D[GET /camera/id/snapshot]
    D -->|JPEG frame| E[Krill App]
    E --> F[iOS]
    E --> G[Android]
    E --> H[Desktop]
    E --> I[Browser/WASM]

The camera feed is served through the existing Krill HTTPS connection with PIN-based authentication — no additional ports or firewall rules needed.

Troubleshooting

IssueCauseSolution
“No cameras available”Camera not detectedCheck ribbon cable, run sudo krill-camera-setup
Camera not in menuServer hasn’t detected cameraRestart server: sudo systemctl restart krill
Black/blank feedCamera enabled but no imageCheck rpicam-still -o test.jpg from terminal
Feed not updatingNetwork or auth issueCheck server logs at /var/log/krill/krill.log

Integration with Diagrams

The CameraRow composable can be embedded in Process Control Diagrams alongside SVG overlays. This enables building visual dashboards with live camera feeds integrated into facility maps or equipment schematics.

See Also

This post is licensed under CC BY 4.0 by Sautner Studio, LLC.