- Clone this repository:
cd ~/projects
git clone <your-repo-url> swing-cam
cd swing-cam- This is designed to run on Raspberry Pi 5, so just copy the files over using the transfer method below.
-
Flash Raspberry Pi OS (64-bit, Bookworm or later)
- Use Raspberry Pi Imager
- Configure WiFi and SSH during imaging
-
Connect to Pi via SSH:
ssh pi@raspberrypi.local- 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/- Run setup on Pi:
cd ~/swing-cam
chmod +x setup.sh
./setup.sh- Test the camera:
source venv/bin/activate
python swing_camera.py --list- Start web interface:
python web_interface.py- Access from your phone/computer:
http://raspberrypi.local:5000
Or find Pi's IP address:
hostname -IThen visit: http://192.168.1.XXX:5000
- 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!
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-cameraCheck status:
sudo systemctl status swing-cameraAfter setup, test everything works:
cd ~/swing-cam
source venv/bin/activate
python swing_camera.pyPress 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.
vcgencmd get_cameraShould show: supported=1 detected=1
If not:
- Power off Pi
- Check camera cable connection
- Power on and run:
sudo raspi-config - Navigate to Interface Options → Camera → Enable
- Reboot
sudo usermod -aG video $USER
logoutThen log back in.
- Check Pi's IP:
hostname -I - Make sure firewall allows port 5000
- Try accessing from Pi itself:
curl http://localhost:5000
- Read
README.mdfor 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! ⛳