Skip to content

andrc1/GERTIE

Repository files navigation

GERTIE - Raspberry Pi Multi-Camera Control System

Overview

GERTIE is an integrated Raspberry Pi camera control system that enables centralized control of multiple Raspberry Pi slave devices from a master GUI. The system provides real-time video streaming, still image capture, and remote device management capabilities.

System Architecture

Master-Slave Configuration

  • Master Device: Runs the GUI interface and controls all slave devices
  • Slave Devices: Multiple Raspberry Pi units with cameras that respond to commands
  • Communication: UDP-based networking for real-time control and video streaming

Network Configuration

  • Master IP: 192.168.0.200
  • Slave IPs: 192.168.0.201 - 192.168.0.207 (7 slave devices)
  • Control Port: 5001 (UDP)
  • Video Port: 5002 (UDP)
  • Still Port: 6000 (TCP)
  • Heartbeat Port: 5003 (UDP)

Repository Structure

GERTIE/
├── camera_system_integrated_final/    # Main camera system
│   ├── master/                        # Master device code
│   │   ├── gui.py                     # Main GUI application
│   │   ├── captured_images/           # Stored captured images
│   │   └── __main__.py               # Master launcher
│   ├── slave/                        # Slave device code
│   │   ├── video_stream.py           # Video streaming logic
│   │   ├── still_capture.py          # Still image capture
│   │   ├── command_handler.py        # Command processing
│   │   └── __main__.py              # Slave launcher
│   ├── shared/                       # Shared configuration
│   │   ├── config.py                 # Network and device settings
│   │   └── logger.py                 # Logging configuration
│   ├── install.sh                    # Master installation script
│   ├── install_slave.sh              # Slave installation script
│   ├── camera_master.service         # Systemd service for master
│   ├── camera_slave.service          # Systemd service for slave
│   └── README.md                     # Original project documentation
├── docs/                             # Documentation
├── hardware/                         # Hardware configurations
│   ├── hardware-config.md            # Complete hardware setup guide
│   ├── lisiparoi.service             # LED ring systemd service
│   └── lisiparoi_startup.py          # LED ring control script

Features

Real-time Control

  • Start/stop video streaming from multiple cameras simultaneously
  • Capture high-resolution still images on command
  • Remote device management (shutdown, reboot)
  • Heartbeat monitoring for device status

GUI Interface

  • Multi-camera video display grid (2x3 layout)
  • Individual camera controls
  • Captured image gallery
  • Device status monitoring
  • Audio feedback for capture events

Network Capabilities

  • UDP streaming for low-latency video
  • TCP file transfer for high-quality images
  • Automatic device discovery via heartbeat
  • Robust error handling and reconnection

Installation

Prerequisites

On all Raspberry Pi devices:

sudo apt update
sudo apt install -y python3-opencv python3-picamera2 libcamera-apps python3-tk

Master Device Setup

cd camera_system_integrated_final
chmod +x install.sh
./install.sh

Slave Device Setup

cd camera_system_integrated_final
chmod +x install_slave.sh
./install_slave.sh

Usage

Starting the Master GUI

cd camera_system_integrated_final/master
python3 -m master

Starting Slave Services

cd camera_system_integrated_final/slave
python3 -m slave

Systemd Services (Auto-start)

# Enable master service
sudo systemctl enable --now camera_master.service

# Enable slave service (on slave devices)
sudo systemctl enable --now camera_slave.service

Configuration

Network Settings

Edit shared/config.py to modify:

  • Master and slave IP addresses
  • Port assignments
  • Device layout (grid configuration)
  • Image storage directory

Hardware Requirements

  • Raspberry Pi 3B+ or newer (recommended Pi 4 for master)
  • Pi Camera module v2 or newer
  • Network connectivity (Ethernet recommended for stability)
  • Sufficient storage for captured images

Troubleshooting

Diagnostic Tools

The repository includes comprehensive diagnostic scripts:

Comprehensive System Diagnostics

python3 camera_diagnostics.py

This script performs:

  • Network interface verification
  • Port binding tests
  • Slave connectivity checks
  • Heartbeat reception monitoring
  • Video streaming validation
  • Still image capture testing

Simple Video Test

python3 simple_video_test.py

Focused video streaming test without GUI complexity:

  • Real-time video statistics
  • FPS and data rate monitoring
  • Lightweight troubleshooting
  • Clear pass/fail results

Network Configuration Test

python3 config_test.py

Tests network configuration and connectivity.

Additional Scripts

  • startup_script.sh: System startup automation
  • restart_all_slaves.sh: Batch slave restart utility
  • gui2.py: Alternative GUI implementation

Common Issues

  1. No video streams: Check network connectivity and slave services
  2. Missing heartbeats: Verify slave IP addresses and firewall settings
  3. Image capture fails: Ensure camera modules are properly connected
  4. GUI freezing: Check system resources and video encoding settings

Detailed Troubleshooting

See Testing Guide for comprehensive troubleshooting procedures and diagnostic workflows.

Development History

This system was extracted from a Raspberry Pi backup image and represents a working multi-camera surveillance/monitoring system. The codebase includes extensive error handling, logging, and diagnostic capabilities developed through real-world deployment.

Hardware Components

Audio System (Master Device Only)

The system includes HiFiBerry DAC integration exclusively on the master control device for enhanced audio feedback during camera operations, including:

  • Camera shutter sound effects
  • System status notifications
  • User interface audio cues

Optional LED Lighting (Slave Devices)

LISIPAROI LED ring lighting system can be installed on slave devices for improved camera illumination:

  • GPIO-controlled LED rings on slave Raspberry Pi devices
  • Auto-start systemd service integration
  • Simple on/off control via BCM pin 14
  • Enhanced lighting for camera capture operations

See Hardware Configuration for detailed setup instructions.

License

[Add appropriate license information]

Support

For technical support and troubleshooting, refer to the diagnostic scripts and log files generated by the system.

About

Grouped Electronic Real-Time Imaging Environment

Resources

Stars

Watchers

Forks

Packages

No packages published