feat: Add optional system optimizations to install script, refine cron job setup, and update related documentation.

This commit is contained in:
sebseb7
2025-12-18 14:41:48 +01:00
parent 374601f2fa
commit f7663c04c6
2 changed files with 88 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ fswebcam -d /dev/video0 -r 1920x1080 --no-banner test.jpg
```bash
# View recent capture logs
tail -f /var/log/picupper.log
tail -f ~/picUploadApi/demo/picupper.log
```
### Common Issues
@@ -116,8 +116,56 @@ crontab -e
```
Examples:
- Every 5 minutes: `*/5 * * * * /home/pi/picupper-demo/capture-upload.sh`
- Every 30 seconds: Use the included systemd timer (see advanced setup)
- Every 5 minutes: `*/5 * * * * ~/picUploadApi/demo/capture-upload.sh`
- Every 30 seconds: Use systemd timer instead of cron
---
## SD Card Preservation
Reduce SD card writes to extend its lifetime:
### Option 1: Minimal Changes (Recommended)
```bash
# Disable swap
sudo swapoff -a
# Comment out swap line in /etc/fstab
sudo nano /etc/fstab
# Disable automatic apt updates
sudo systemctl disable apt-daily.timer apt-daily-upgrade.timer
```
### Option 2: Full Read-Only Mode
```bash
sudo raspi-config
# Navigate to: Performance Options → Overlay File System → Enable
```
⚠️ **Before enabling read-only mode**, change log location to tmpfs:
```bash
# Edit picupper.conf
LOG_FILE="/tmp/picupper.log"
```
---
## Auto-Reboot (Stability)
For long-running deployments, schedule automatic reboots:
```bash
sudo crontab -e
```
Add (reboots at 00:00, 06:00, 12:00, 18:00):
```
0 */6 * * * /sbin/reboot
```
---
## Hardware Requirements
@@ -129,3 +177,4 @@ Examples:
## Network Notes
The script retries failed uploads and logs all attempts. If your Pi loses network, captures continue and uploads resume when connectivity returns.