Skip to content
Hardware Integration Skill logo

Hardware Integration Skill

Camera, GPIO, and hardware integration for Raspberry Pi 5. Use for camera testing, hardware diagnostics, GPIO troubleshooting, and sensor issues.

SKILL.md

Full skill instructions

Hardware Integration Skill

Complete reference for camera, GPIO, USB, and hardware integration on Raspberry Pi 5 for the PhotoBooth application.

Quick Reference

  • Camera: iPad via getUserMedia (browser-based capture)
  • Printer: Canon Selphy CP1500 via USB/​CUPS
  • Network: Wi-Fi AP mode (hostapd)
  • Storage: 256GB microSD

Raspberry Pi 5 Specifications

ComponentSpecification
CPUBroadcom BCM2712, Quad-core Cortex-A76 @ 2.4GHz
RAM8GB LPDDR4X
USB2x USB 3.0, 2x USB 2.0
GPIO40-pin header, 26 GPIO pins
NetworkGigabit Ethernet, Wi-Fi 5 (802.11ac), Bluetooth 5.0

Camera Integration

The PhotoBooth uses iPad Air as the camera device via browser's getUserMedia API.

Camera Constraints (Frontend)

const constraints: MediaStreamConstraints = {
  video: {
    facingMode: 'user',           // Front camera for selfies
    width: { ideal: 1920 },       // Full HD
    height: { ideal: 1080 },
    frameRate: { ideal: 30 }
  },
  audio: false
};

Camera Testing

# On iPad (Safari DevTools):
# Check getUserMedia support
navigator.mediaDevices.getUserMedia({ video: true })
  .then(stream => console.log('Camera OK'))
  .catch(err => console.error('Camera Error:', err));

USB Device Management

List USB Devices

# List all USB devices
lsusb

# Detailed info
lsusb -v | grep -A 10 "Canon"

# Check USB device tree
lsusb -t

USB Troubleshooting

# Check kernel messages for USB
dmesg | grep -i usb | tail -20

# Reset USB bus (if device not responding)
sudo usbreset /​dev/​bus/​usb/​001/​002  # Replace with actual device

Network (Wi-Fi AP Mode)

Configuration Files

  • /​etc/​hostapd/​hostapd.conf - AP configuration
  • /​etc/​dnsmasq.conf - DHCP configuration
  • /​etc/​dhcpcd.conf - Static IP for wlan0

hostapd Configuration

interface=wlan0
driver=nl80211
ssid=photobooth
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=photobooth-1998
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

Network Testing

# Check Wi-Fi AP status
sudo systemctl status hostapd

# List connected clients
iw dev wlan0 station dump

# Check IP assignments
cat /​var/​lib/​misc/​dnsmasq.leases

System Diagnostics

Temperature Monitoring

# CPU temperature
vcgencmd measure_temp

# Continuous monitoring
watch -n 1 vcgencmd measure_temp

Memory and CPU

# Memory usage
free -h

# CPU usage
top -bn1 | head -20

# Disk usage
df -h

Service Status

# Check all PhotoBooth services
sudo systemctl status hostapd
sudo systemctl status dnsmasq
sudo systemctl status cups
sudo systemctl status photobooth-backend
sudo systemctl status photobooth-frontend

Common Issues & Solutions

Issue: Camera not accessible from browser

Cause: HTTPS required for getUserMedia on non-localhost Solution:

  1. Use self-signed certificate for HTTPS
  2. Or add exception in Safari settings
  3. Or use localhost with port forwarding

Issue: USB device not detected

Cause: Power issues or driver problems Solution:

# Check USB power
vcgencmd get_throttled

# Reload USB driver
sudo modprobe -r usb_storage && sudo modprobe usb_storage

# Check dmesg for errors
dmesg | tail -50

Issue: Wi-Fi AP not starting

Cause: Interface conflict or config error Solution:

# Check for conflicts
sudo rfkill list

# Unblock if blocked
sudo rfkill unblock wifi

# Restart hostapd
sudo systemctl restart hostapd

Issue: High CPU temperature

Cause: Inadequate cooling or high load Solution:

# Check temperature
vcgencmd measure_temp

# If > 80°C, reduce CPU frequency temporarily
echo 1500000 | sudo tee /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_max_freq

Hardware Test Script

Create /​home/​pi/​scripts/​test-hardware.sh:

#!/​bin/​bash
echo "=== PhotoBooth Hardware Diagnostics ==="
echo ""
echo "CPU Temperature: $(vcgencmd measure_temp)"
echo "Memory: $(free -h | grep Mem | awk '{print $3"/"$2}')"
echo "Disk: $(df -h / | tail -1 | awk '{print $3"/"$2" ("$5" used)"}')"
echo ""
echo "=== USB Devices ==="
lsusb | grep -v "hub" || echo "No non-hub USB devices"
echo ""
echo "=== Network ==="
echo "Wi-Fi AP: $(systemctl is-active hostapd)"
echo "DHCP: $(systemctl is-active dnsmasq)"
echo "Connected clients: $(iw dev wlan0 station dump 2>/​dev/​null | grep Station | wc -l)"
echo ""
echo "=== Services ==="
echo "CUPS: $(systemctl is-active cups)"
echo "Backend: $(systemctl is-active photobooth-backend 2>/​dev/​null || echo 'not configured')"
echo ""
echo "=== Diagnostics Complete ==="

Related Documentation

  • docs/​DEPLOYMENT.md - Full deployment guide
  • docs/​ERROR_CODES.md - Hardware error codes (PRINTER_, STORAGE_)
  • docs/​use-cases/​UC-205-health-check.md - Health monitoring

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View