Skip to content

oajm79/pi-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-scripts

Raspberry Pi utility scripts — camera tools, GUI control, and other Pi utilities.

Structure

pi-scripts/
├── camera/
│   ├── camera.sh           # Main camera control (photo, video, stream, motion, timelapse)
│   ├── camera_motion.py    # Motion detection with OpenCV + optional web stream
│   └── camera_web_stream.py # MJPEG HTTP stream server
└── gui_control.sh          # Start/stop/status for the GUI (lightdm) via VNC

camera/

camera.sh

Full-featured camera control script for Raspberry Pi Camera Module v2 (IMX219).

bash camera/camera.sh photo               # Quick photo
bash camera/camera.sh photo-hd            # Full resolution (3280x2464)
bash camera/camera.sh video 30            # Record 30s
bash camera/camera.sh stream              # TCP stream for VLC (port 8554)
bash camera/camera.sh web                 # HTTP stream for browser (port 8080)
bash camera/camera.sh motion              # Motion detection (saves photos)
bash camera/camera.sh motion --web        # Motion + live view in browser
bash camera/camera.sh timelapse 10 50     # 50 photos, 10s apart
bash camera/camera.sh list                # List captured files

Files saved in: ~/camera/{photos,videos,timelapse,motion}

camera_motion.py

Standalone motion detection using OpenCV and picamera2.

python3 camera/camera_motion.py                      # Default settings
python3 camera/camera_motion.py --web 8080           # With live web stream
python3 camera/camera_motion.py --sensitivity 15     # More sensitive
python3 camera/camera_motion.py --no-save --web      # Stream only

camera_web_stream.py

Simple MJPEG HTTP stream server. Used internally by camera.sh web.

python3 camera/camera_web_stream.py        # Port 8080
python3 camera/camera_web_stream.py 9090   # Custom port

gui_control.sh

Control the graphical environment (lightdm) for VNC access.

bash gui_control.sh on      # Start GUI
bash gui_control.sh off     # Stop GUI
bash gui_control.sh status  # Check if active

Requirements

  • Raspberry Pi OS (Bookworm or later)
  • rpicam-still, rpicam-vid, rpicam-hello (included in rpicam-apps)
  • Python: picamera2, opencv-python, numpy
  • lightdm (for gui_control.sh)

About

Raspberry Pi utility scripts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors