1.8 KiB
1.8 KiB
Raspberry Pi Deployment Guide
Prerequisites
- Raspberry Pi 4 (recommended) or 3B+
- Raspbian OS (latest)
- Python 3.7+
- nginx (optional, for production)
Quick Start
-
Clone the repository
git clone <repository-url> /home/pi/myp-platform cd /home/pi/myp-platform
-
Install dependencies
sudo apt-get update sudo apt-get install python3-pip python3-venv nginx python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Run deployment script
python deploy_raspberry_pi.py
-
Start the application
python run_optimized.py
Production Deployment
-
Install as systemd service
sudo cp myp-platform.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable myp-platform sudo systemctl start myp-platform
-
Configure nginx (optional)
sudo cp nginx-myp-platform.conf /etc/nginx/sites-available/myp-platform sudo ln -s /etc/nginx/sites-available/myp-platform /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx
Performance Tips
- Use a fast SD card (Class 10 or better)
- Enable swap if you have less than 4GB RAM
- Use nginx for serving static files
- Monitor temperature and use cooling if needed
- Disable unnecessary services to free up resources
Monitoring
Check application status:
sudo systemctl status myp-platform
View logs:
sudo journalctl -u myp-platform -f
Troubleshooting
- If the app doesn't start, check logs with
journalctl
- Ensure all Python dependencies are installed
- Check that port 5000 is not in use
- Verify file permissions in the app directory