Skip to content

Latest commit

 

History

History
149 lines (109 loc) · 2.67 KB

File metadata and controls

149 lines (109 loc) · 2.67 KB

Quick Installation Guide

On Your Computer (for development)

  1. Clone this repository:
cd ~/projects
git clone <your-repo-url> swing-cam
cd swing-cam
  1. This is designed to run on Raspberry Pi 5, so just copy the files over using the transfer method below.

On Raspberry Pi 5

First-Time Setup

  1. Flash Raspberry Pi OS (64-bit, Bookworm or later)

    • Use Raspberry Pi Imager
    • Configure WiFi and SSH during imaging
  2. Connect to Pi via SSH:

ssh pi@raspberrypi.local
  1. Transfer files to Pi:

From your computer:

scp -r ~/projects/swing-cam pi@raspberrypi.local:~/

Or use rsync:

rsync -avz ~/projects/swing-cam/ pi@raspberrypi.local:~/swing-cam/
  1. Run setup on Pi:
cd ~/swing-cam
chmod +x setup.sh
./setup.sh
  1. Test the camera:
source venv/bin/activate
python swing_camera.py --list
  1. Start web interface:
python web_interface.py
  1. Access from your phone/computer:
http://raspberrypi.local:5000

Or find Pi's IP address:

hostname -I

Then visit: http://192.168.1.XXX:5000

  1. Configure via Web Interface:
    • Click ⚙️ Settings in the web interface
    • Adjust camera settings, load presets
    • Set up Google Drive upload (all in browser!)
    • No need to manually edit config files!

Optional: Auto-Start on Boot

To make the camera web interface start automatically:

sudo cp swing-camera.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable swing-camera
sudo systemctl start swing-camera

Check status:

sudo systemctl status swing-camera

Quick Test

After setup, test everything works:

cd ~/swing-cam
source venv/bin/activate
python swing_camera.py

Press ENTER when prompted. You should see:

Golf Swing Camera Ready!
Press ENTER to record a 10s swing video...

Press ENTER, wait 10 seconds, and check the recordings/ folder.

Troubleshooting

Camera not found

vcgencmd get_camera

Should show: supported=1 detected=1

If not:

  1. Power off Pi
  2. Check camera cable connection
  3. Power on and run: sudo raspi-config
  4. Navigate to Interface Options → Camera → Enable
  5. Reboot

Permission errors

sudo usermod -aG video $USER
logout

Then log back in.

Can't access web interface

  1. Check Pi's IP: hostname -I
  2. Make sure firewall allows port 5000
  3. Try accessing from Pi itself: curl http://localhost:5000

Next Steps

  • Read README.md for full documentation
  • Adjust settings in config.json
  • Set up automatic uploads if desired
  • Mount camera on tripod for stable capture

Enjoy capturing your golf swing! ⛳