Installation Troubleshooting¶
Solutions to common issues encountered during and after PiTrac installation.
Build Issues¶
Build Fails with Missing Artifacts
Symptom: Build script reports missing pre-built artifacts
Solution:
Why it happens: Pre-built dependencies (OpenCV, lgpio, etc.) are stored using Git LFS. If Git LFS wasn't installed when you cloned, these files won't be downloaded.
Prevention:
Build Errors with Dependencies
Symptom: Compilation fails with missing headers or libraries
Solution:
# Ensure all system dependencies are installed
cd ~/PiTrac/packaging
sudo apt update
# Then force a clean rebuild
sudo ./build.sh dev force
Common missing dependencies:
build-essential-- C++ compilermeson,ninja-build-- Build toolspkg-config-- Library detectionlibboost-dev,libboost-all-dev-- Boost libraries
Insufficient Disk Space
Symptom: Build fails with "No space left on device"
Check disk space:
Solution (need at least 5GB free, 10GB recommended):
Build Hangs or Takes Too Long
Symptom: Build appears stuck or takes more than 30 minutes
Possible causes:
- Building OpenCV from source instead of using pre-built (60+ minutes)
- Low memory causing swapping
- Network issues downloading packages
Solution:
Stale Build Directory
Symptom: Linker errors or library not found errors after switching between dependency installation methods
Why it happens: If the build directory was created with dependencies installed to /opt/ (tarball extraction), switching to DEB packages (which install to /usr/) leaves stale cached paths in the build system.
Solution:
The force flag deletes the build directory and reconfigures from scratch. The build script also auto-detects this condition and cleans automatically in most cases.
Service Issues¶
Web Server Won't Start
Symptom: Web service fails to start or shows inactive
Diagnosis:
Common causes and solutions:
1. Python dependencies not installed
cd /usr/lib/pitrac/web-server
sudo pip3 install -r requirements.txt --break-system-packages
sudo systemctl restart pitrac-web
2. Port 8080 already in use
# Check what's using port 8080
sudo ss -tlnp | grep 8080
# Kill the process or change PiTrac port
# (Edit /usr/lib/pitrac/web-server/main.py to change port)
3. File permissions
PiTrac Process Won't Start
Symptom: Click "Start" in web interface but process stays stopped
Check logs (see the Files and Logs reference for the full log map):
Common causes:
1. Cameras not detected
Should show 2 cameras.
2. Configuration file errors
# Check configuration exists
ls -l ~/.pitrac/config/
# Regenerate configuration through web interface
# Or manually:
rm ~/.pitrac/config/generated_golf_sim_config.json
# Restart web server to regenerate
sudo systemctl restart pitrac-web
3. Binary permissions
# Ensure binary is executable
sudo chmod +x /usr/lib/pitrac/pitrac_lm
# Test manually
/usr/lib/pitrac/pitrac_lm --logging_level=debug
4. Stale PID files
Camera Issues¶
Camera Not Detected
Symptom: rpicam-hello --list-cameras shows no cameras or error
Check boot configuration:
Should have: camera_auto_detect=1
If missing, add it:
Verify ribbon cable connection:
- Power off Pi
- Check cable is fully inserted in both camera and Pi
- Check cable orientation (blue side up for most cameras)
- Check for damage to cable or connectors
Check libcamera environment:
Should point to: /usr/share/libcamera/pipeline/rpi/pisp/rpi_apps.yaml
Only One Camera Detected
Symptom: rpicam-hello --list-cameras shows 1 camera instead of 2
Check both ribbon cables:
- Verify both cameras are connected
- Check both CSI ports on the Pi
- Ensure both cables are secure
Identify which camera is missing:
rpicam-hello --list-cameras
# Shows camera IDs and ports
# Try each camera individually
rpicam-hello --camera 0
rpicam-hello --camera 1
Hardware checks:
- Swap ribbon cables between cameras
- Test suspected bad camera on known-good port
- Try different ribbon cable
Camera Images Too Dark/Bright
Symptom: Captured images are unusable due to exposure
Solution: Adjust camera settings in web interface
- Navigate to Configuration > Camera Settings
- Adjust "Gain" or "Exposure Time"
- For darker images: Increase gain (try 8--12)
- For brighter images: Decrease gain (try 2--4)
- Test with "Hardware Test" > "Capture Still Image"
Lighting considerations:
- IR strobes may need adjustment
- Avoid direct sunlight or bright windows
- Consistent indoor lighting works best
Web Interface Issues¶
Cannot Access Web Interface
Symptom: Browser can't connect to http://raspberrypi.local:8080
1. Verify web server is running:
2. Check firewall isn't blocking port 8080:
3. Confirm correct IP address:
hostname -I
# Note the IP (e.g., 192.168.1.100)
# Try accessing with IP instead of hostname
# http://192.168.1.100:8080
4. Test locally on the Pi:
5. Check Pi is on same network:
Web Interface Loads But Shows Errors
Symptom: Page loads but displays connection errors or missing data
Check WebSocket connection:
- Open browser developer console (F12)
- Look for WebSocket errors
- Verify WebSocket status indicator in UI
Clear browser cache:
Hard refresh: Ctrl+Shift+R (or Cmd+Shift+R on Mac)
Check web server logs:
Configuration Changes Don't Take Effect
Symptom: Changes in web interface don't affect PiTrac behavior
Solution:
- Some settings require PiTrac restart
- Look for "Restart Required" indicator in UI
- Stop and restart PiTrac process through web interface
If still not working:
Shot Detection Issues¶
No Shot Data Appearing
Symptom: Hit shots but no data appears in web interface
Checklist:
- PiTrac process is running (check status indicator)
- Both cameras show "Connected"
- Ball is visible in camera views
- IR strobes are firing (should see brief flashes)
- Ball is on tee in expected location
Test ball detection:
- Navigate to Testing Tools
- Run "Ball Detection Test"
- Review results and adjust sensitivity if needed
Check logs for clues:
Inaccurate Shot Data
Symptom: Shot data seems wrong (speed too high/low, angles off)
Calibration needed:
- Run Calibration Wizard in web interface
- Verify camera positions haven't moved
- Check calibration data:
cat ~/.pitrac/config/calibration_data.json
Environmental factors:
- Lighting changes (time of day, room lights)
- Camera position shifted
- Ball type changed (different size/reflectivity)
- Net or objects in camera view
Detection method:
- Try different detection method (HoughCircles vs YOLO)
- Adjust detection sensitivity in Configuration
System Performance Issues¶
High CPU Usage
Check what's using CPU:
Common causes:
- Multiple PiTrac instances running
- Detection method too intensive
- Logging level set too high (debug)
Solutions:
High Memory Usage
Check memory:
If low on memory:
# Increase swap space
sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
# Set CONF_SWAPSIZE=2048
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
Consider:
- Upgrade to Pi 5 with 8GB RAM
- Reduce image resolution in Configuration
- Use lighter detection method
System Feels Slow
Check temperature:
If overheating:
- Ensure proper ventilation
- Add heatsinks or fan
- Reduce processing load
Check disk I/O:
Consider:
- Upgrade to NVMe SSD (Pi 5)
- Use faster SD card (A2 class)
- Reduce image saving frequency
Getting Additional Help¶
If you're still experiencing issues:
1. Check logs:
# PiTrac process logs
tail -f ~/.pitrac/logs/pitrac.log
# Web server logs
journalctl -u pitrac-web -f
# System logs
dmesg | tail -n 50
See the Files and Logs reference for the full map of where PiTrac stores logs, config, images, and runtime state.
2. Check web server status:
3. Gather system information:
# OS version
cat /etc/os-release
# Architecture (should be aarch64)
uname -m
# Disk space
df -h
# Memory
free -h
# Camera detection (Pi 5)
rpicam-hello --list-cameras
4. Get help from the community:
- Discord Community -- Active community support
- GitHub Issues -- Report bugs or request features
- General Troubleshooting -- Broader system issues
When asking for help, include:
- What you were trying to do
- What happened instead
- Error messages from logs
- System information (Pi model, OS version, architecture)
- Steps you've already tried