v1/docs/troubleshooting.md
This guide helps diagnose and resolve common issues with WiFi-DensePose. Issues are organized by category with step-by-step troubleshooting procedures.
# System health check
curl http://localhost:8000/api/v1/health
# Check system information
python -c "import wifi_densepose; wifi_densepose.print_system_info()"
# View logs
docker-compose logs -f wifi-densepose
kubectl logs -f deployment/wifi-densepose -n wifi-densepose
#!/bin/bash
# quick-health-check.sh
echo "=== WiFi-DensePose Health Check ==="
# Check if service is running
if curl -s http://localhost:8000/api/v1/health > /dev/null; then
echo "✅ API service is responding"
else
echo "❌ API service is not responding"
fi
# Check database connection
if curl -s http://localhost:8000/api/v1/health | grep -q "postgres.*healthy"; then
echo "✅ Database connection is healthy"
else
echo "❌ Database connection issues detected"
fi
# Check hardware status
if curl -s http://localhost:8000/api/v1/health | grep -q "hardware.*healthy"; then
echo "✅ Hardware service is healthy"
else
echo "❌ Hardware service issues detected"
fi
# Check pose detection
if curl -s http://localhost:8000/api/v1/pose/current > /dev/null; then
echo "✅ Pose detection is working"
else
echo "❌ Pose detection issues detected"
fi
echo "=== End Health Check ==="
# Check for common error patterns
grep -i "error\|exception\|failed" /var/log/wifi-densepose.log | tail -20
# Check hardware warnings
grep -i "hardware\|router\|csi" /var/log/wifi-densepose.log | tail -10
# Check pose processing issues
grep -i "pose\|detection\|confidence" /var/log/wifi-densepose.log | tail -10
pip install wifi-densepose failsSymptoms:
Solutions:
pip install --upgrade pip setuptools wheel
python3.9 -m pip install wifi-densepose
git clone https://github.com/ruvnet/wifi-densepose.git
cd wifi-densepose
pip install -e .
pip install --no-deps wifi-densepose
pip install -r requirements.txt
Symptoms:
Solutions:
sudo apt update
sudo apt install -y build-essential cmake
sudo apt install -y libopencv-dev python3-opencv
sudo apt install -y python3.9-dev python3.9-venv
sudo yum groupinstall -y "Development Tools"
sudo yum install -y opencv-devel python39-devel
brew install cmake opencv [email protected]
Symptoms:
Solutions:
# Add to .dockerignore
echo "data/" >> .dockerignore
echo "logs/" >> .dockerignore
echo "*.pyc" >> .dockerignore
echo "__pycache__/" >> .dockerignore
docker build --target production -t wifi-densepose:latest .
sudo usermod -aG docker $USER
newgrp docker
Symptoms:
Diagnostic Steps:
ping 192.168.1.1 # Replace with your router IP
telnet 192.168.1.1 22 # Check SSH access
ssh [email protected]
# Check if CSI extraction is enabled
cat /etc/config/wireless | grep csi
# Listen for CSI data
nc -l 5500 # Default CSI port
Solutions:
ssh [email protected]
/etc/init.d/csi-tools restart
# On router
echo "csi_enable=1" >> /etc/config/wireless
echo "csi_rate=30" >> /etc/config/wireless
wifi reload
# Flash OpenWRT with CSI patches
sysupgrade -v openwrt-csi-enabled.bin
Symptoms:
Solutions:
Optimize antenna placement:
Adjust CSI parameters:
# Increase sampling rate
echo "csi_rate=50" >> /etc/config/wireless
# Filter noise
echo "csi_filter=1" >> /etc/config/wireless
curl -X POST http://localhost:8000/api/v1/pose/calibrate
Symptoms:
Solutions:
# Ubuntu/Debian
sudo ufw allow 8000/tcp # API port
sudo ufw allow 5500/tcp # CSI data port
sudo ufw allow 8080/tcp # Metrics port
# CentOS/RHEL
sudo firewall-cmd --permanent --add-port=8000/tcp
sudo firewall-cmd --permanent --add-port=5500/tcp
sudo firewall-cmd --reload
sudo iptables -L -n | grep -E "8000|5500"
sudo ufw disable # Ubuntu
sudo systemctl stop firewalld # CentOS
Symptoms:
Diagnostic Steps:
curl http://localhost:8000/api/v1/system/status | jq '.hardware'
curl http://localhost:8000/api/v1/config | jq '.detection.confidence_threshold'
curl -X PUT http://localhost:8000/api/v1/config \
-H "Content-Type: application/json" \
-d '{"detection": {"confidence_threshold": 0.3}}'
Solutions:
curl -X POST http://localhost:8000/api/v1/pose/calibrate
Check environment setup:
Adjust detection parameters:
curl -X PUT http://localhost:8000/api/v1/config \
-H "Content-Type: application/json" \
-d '{
"detection": {
"confidence_threshold": 0.5,
"max_persons": 10,
"enable_tracking": true
}
}'
Symptoms:
Solutions:
Improve environment conditions:
Retrain or update models:
# Download latest models
curl -O https://models.wifi-densepose.com/latest/densepose_model.pth
mv densepose_model.pth /app/models/
# In configuration
{
"pose_processing": {
"batch_size": 32,
"nms_threshold": 0.5,
"keypoint_threshold": 0.3
}
}
Symptoms:
Solutions:
curl http://localhost:8000/api/v1/zones | jq '.'
curl -X PUT http://localhost:8000/api/v1/zones/zone_001 \
-H "Content-Type: application/json" \
-d '{
"coordinates": {
"x": 0, "y": 0,
"width": 500, "height": 300
}
}'
curl "http://localhost:8000/api/v1/pose/zones/zone_001/occupancy"
Symptoms:
Diagnostic Steps:
top -p $(pgrep -f wifi-densepose)
htop -p $(pgrep -f python)
curl http://localhost:8080/metrics | grep cpu
Solutions:
# Reduce batch size
export POSE_PROCESSING_BATCH_SIZE=16
# Lower frame rate
export STREAM_FPS=15
# Reduce worker count
export WORKERS=2
export ENABLE_GPU=true
export CUDA_VISIBLE_DEVICES=0
# Docker Compose
docker-compose up -d --scale wifi-densepose=3
# Kubernetes
kubectl scale deployment wifi-densepose --replicas=5
Symptoms:
Solutions:
# Docker
docker run --memory=4g wifi-densepose
# Kubernetes
resources:
limits:
memory: 4Gi
export CSI_BUFFER_SIZE=500
export POSE_HISTORY_LIMIT=1000
import gc
gc.set_threshold(700, 10, 10)
Symptoms:
Solutions:
export REDIS_URL=redis://localhost:6379/0
export ENABLE_CACHING=true
-- Add indexes
CREATE INDEX idx_pose_detections_timestamp ON pose_detections (timestamp);
CREATE INDEX idx_csi_data_timestamp ON csi_data (timestamp);
export DATABASE_POOL_SIZE=20
export DATABASE_MAX_OVERFLOW=30
Symptoms:
Diagnostic Steps:
curl -I http://localhost:8000/api/v1/health
systemctl status wifi-densepose
netstat -tlnp | grep 8000
lsof -i :8000
Solutions:
# Docker
docker-compose restart wifi-densepose
# Systemd
sudo systemctl restart wifi-densepose
# Kubernetes
kubectl rollout restart deployment/wifi-densepose
# Verify environment variables
env | grep -E "HOST|PORT|DATABASE_URL"
tail -f /var/log/wifi-densepose.log
Symptoms:
Solutions:
const ws = new WebSocket('ws://localhost:8000/ws/pose/stream');
ws.onopen = () => console.log('Connected');
ws.onerror = (error) => console.error('Error:', error);
# Nginx WebSocket support
location /ws/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
export WEBSOCKET_MAX_CONNECTIONS=100
export WEBSOCKET_TIMEOUT=300
Symptoms:
Solutions:
# Decode JWT token
echo "eyJ..." | base64 -d
curl -H "Authorization: Bearer <token>" \
http://localhost:8000/api/v1/auth/verify
curl -X POST http://localhost:8000/api/v1/auth/refresh \
-H "Authorization: Bearer <refresh-token>"
Symptoms:
Diagnostic Steps:
# Docker
docker-compose logs postgres
# Direct connection test
psql -h localhost -U postgres -d wifi_densepose
echo $DATABASE_URL
Solutions:
docker-compose restart postgres
sudo systemctl restart postgresql
-- Check connections
SELECT * FROM pg_stat_activity;
-- Check database size
SELECT pg_size_pretty(pg_database_size('wifi_densepose'));
-- Increase max connections
ALTER SYSTEM SET max_connections = 200;
SELECT pg_reload_conf();
Symptoms:
Solutions:
df -h
du -sh /app/data /app/logs /app/models
# Remove old logs
find /app/logs -name "*.log" -mtime +7 -delete
# Clean old pose data
psql -c "DELETE FROM pose_detections WHERE timestamp < NOW() - INTERVAL '30 days';"
# /etc/logrotate.d/wifi-densepose
/app/logs/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
}
Symptoms:
Solutions:
openssl x509 -in /etc/ssl/certs/wifi-densepose.crt -text -noout
certbot renew --nginx
kubectl create secret tls tls-secret \
--cert=path/to/tls.crt \
--key=path/to/tls.key
Symptoms:
Solutions:
curl -I http://localhost:8000/api/v1/pose/current
# Look for X-RateLimit-* headers
export RATE_LIMIT_REQUESTS=1000
export RATE_LIMIT_WINDOW=3600
curl -H "Authorization: Bearer <token>" \
http://localhost:8000/api/v1/pose/current
Symptoms:
Solutions:
docker-compose ps
docker-compose logs
docker-compose down
docker-compose build --no-cache
docker-compose up -d
docker network ls
docker network inspect wifi-densepose_default
Symptoms:
Solutions:
kubectl get pods -n wifi-densepose
kubectl describe pod <pod-name> -n wifi-densepose
kubectl top nodes
kubectl describe node <node-name>
# Check image availability
docker pull wifi-densepose:latest
# Update deployment
kubectl set image deployment/wifi-densepose \
wifi-densepose=wifi-densepose:latest
grep -E "ERROR|CRITICAL|Exception" /var/log/wifi-densepose.log
grep -E "slow|timeout|latency" /var/log/wifi-densepose.log
grep -E "router|hardware|csi" /var/log/wifi-densepose.log
System metrics:
Application metrics:
Hardware metrics:
Cause: Router connectivity or CSI extraction issues
Solution:
Cause: PostgreSQL connectivity issues
Solution:
Cause: GPU memory exhaustion
Solution:
Cause: Too many API requests
Solution:
Cause: Processing taking too long
Solution:
Documentation:
Community Support:
wifi-denseposeProfessional Support:
When reporting issues, include:
# System details
uname -a
python --version
docker --version
# WiFi-DensePose version
python -c "import wifi_densepose; print(wifi_densepose.__version__)"
# Environment variables (sanitized)
env | grep -E "WIFI|POSE|DATABASE" | sed 's/=.*/=***/'
# Recent logs
tail -100 /var/log/wifi-densepose.log
# Error logs
grep -E "ERROR|CRITICAL" /var/log/wifi-densepose.log | tail -20
curl http://localhost:8000/api/v1/health | jq '.'
docker-compose down
kubectl delete deployment wifi-densepose
pg_dump wifi_densepose > backup.sql
cp -r /app/data /backup/
psql wifi_densepose < backup.sql
cp -r /backup/data /app/
# Use safe defaults
export DEBUG=true
export MOCK_HARDWARE=true
docker-compose up -d
For additional support, contact the WiFi-DensePose team or consult the community resources listed above.