|
| 1 | +# PixEagle Sync & Restart Guide |
| 2 | + |
| 3 | +Quick reference for updating PixEagle in different installation scenarios. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## TL;DR - One Command for Everything |
| 8 | + |
| 9 | +```bash |
| 10 | +make sync-restart |
| 11 | +``` |
| 12 | + |
| 13 | +This command: |
| 14 | +- ✅ Pulls latest code from GitHub |
| 15 | +- ✅ Auto-detects installation type (native vs ARK-OS) |
| 16 | +- ✅ Restarts services appropriately |
| 17 | +- ✅ Works on local dev machine and remote Jetson/Pi |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Installation Scenarios |
| 22 | + |
| 23 | +### Scenario 1: Native/Standalone Installation |
| 24 | + |
| 25 | +**On your local dev machine:** |
| 26 | + |
| 27 | +```bash |
| 28 | +# Pull latest code + restart |
| 29 | +make sync-restart |
| 30 | + |
| 31 | +# OR manually: |
| 32 | +make sync # Pull latest code |
| 33 | +make stop # Stop services |
| 34 | +make run # Start services |
| 35 | +``` |
| 36 | + |
| 37 | +**If installed as systemd service:** |
| 38 | + |
| 39 | +```bash |
| 40 | +make sync-restart |
| 41 | + |
| 42 | +# OR manually: |
| 43 | +make sync |
| 44 | +sudo systemctl restart pixeagle |
| 45 | +``` |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +### Scenario 2: ARK-OS Managed Installation (Jetson/Pi) |
| 50 | + |
| 51 | +**Quick sync + restart:** |
| 52 | + |
| 53 | +```bash |
| 54 | +# SSH to Jetson |
| 55 | +ssh jetson@192.168.1.112 |
| 56 | + |
| 57 | +# One command to sync and restart |
| 58 | +cd ~/PixEagle |
| 59 | +make sync-restart |
| 60 | +``` |
| 61 | + |
| 62 | +**Manual method (if you prefer step-by-step):** |
| 63 | + |
| 64 | +```bash |
| 65 | +ssh jetson@192.168.1.112 |
| 66 | + |
| 67 | +# Pull latest code |
| 68 | +cd ~/PixEagle |
| 69 | +make sync |
| 70 | + |
| 71 | +# Restart service |
| 72 | +systemctl --user restart pixeagle |
| 73 | + |
| 74 | +# Check status |
| 75 | +systemctl --user status pixeagle |
| 76 | +journalctl --user -u pixeagle -f |
| 77 | +``` |
| 78 | + |
| 79 | +**Full reinstall (safest, rebuilds everything):** |
| 80 | + |
| 81 | +```bash |
| 82 | +ssh jetson@192.168.1.112 |
| 83 | + |
| 84 | +# Reinstall via ARK-OS install script |
| 85 | +cd ~/ARK-OS |
| 86 | +export INSTALL_PIXEAGLE="y" |
| 87 | +bash tools/service_control.sh install pixeagle |
| 88 | + |
| 89 | +# This does: |
| 90 | +# - git pull origin main |
| 91 | +# - Creates .env.production.local for proxy |
| 92 | +# - Runs full init.sh (rebuilds dashboard, downloads models, etc.) |
| 93 | +# - Restarts service |
| 94 | +``` |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## What Each Command Does |
| 99 | + |
| 100 | +| Command | What It Does | When to Use | |
| 101 | +|---------|--------------|-------------| |
| 102 | +| `make sync` | Pulls latest code from GitHub (auto-stashes local changes) | Just update code, don't restart yet | |
| 103 | +| `make sync-restart` | Pulls code + auto-detects installation type + restarts services | **Recommended** - safest one-liner | |
| 104 | +| `systemctl --user restart pixeagle` | Restart ARK-OS managed service | Quick restart without pulling code | |
| 105 | +| `service_control.sh install pixeagle` | Full reinstall (git pull + rebuild + restart) | Major updates or troubleshooting | |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Troubleshooting |
| 110 | + |
| 111 | +### Service won't start after sync |
| 112 | + |
| 113 | +```bash |
| 114 | +# Check logs |
| 115 | +journalctl --user -u pixeagle -n 50 |
| 116 | + |
| 117 | +# Full reinstall |
| 118 | +cd ~/ARK-OS |
| 119 | +export INSTALL_PIXEAGLE="y" |
| 120 | +bash tools/service_control.sh install pixeagle |
| 121 | +``` |
| 122 | + |
| 123 | +### Local changes conflict with sync |
| 124 | + |
| 125 | +```bash |
| 126 | +# make sync auto-stashes changes, but if you want to manually handle: |
| 127 | +git stash # Save local changes |
| 128 | +make sync # Pull updates |
| 129 | +git stash pop # Restore local changes |
| 130 | +``` |
| 131 | + |
| 132 | +### Permission issues on Jetson |
| 133 | + |
| 134 | +```bash |
| 135 | +# Fix script permissions |
| 136 | +chmod +x ~/PixEagle/scripts/**/*.sh |
| 137 | +``` |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## Testing Without Breaking Production |
| 142 | + |
| 143 | +### On Jetson (test before committing) |
| 144 | + |
| 145 | +```bash |
| 146 | +# Make local changes |
| 147 | +cd ~/PixEagle |
| 148 | +# ... edit files ... |
| 149 | + |
| 150 | +# Test without pushing to GitHub |
| 151 | +systemctl --user restart pixeagle |
| 152 | +journalctl --user -u pixeagle -f |
| 153 | + |
| 154 | +# If it works, commit + push |
| 155 | +git add . |
| 156 | +git commit -m "your changes" |
| 157 | +git push origin main |
| 158 | +``` |
| 159 | + |
| 160 | +### On dev machine (safe testing) |
| 161 | + |
| 162 | +```bash |
| 163 | +# Make changes |
| 164 | +cd c:/Users/Alireza/PixEagle |
| 165 | +# ... edit files ... |
| 166 | + |
| 167 | +# Test locally |
| 168 | +make stop |
| 169 | +make run |
| 170 | + |
| 171 | +# If it works, commit + push |
| 172 | +git add . |
| 173 | +git commit -m "your changes" |
| 174 | +git push origin main |
| 175 | + |
| 176 | +# Then sync on Jetson |
| 177 | +ssh jetson@192.168.1.112 |
| 178 | +cd ~/PixEagle && make sync-restart |
| 179 | +``` |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +## Summary |
| 184 | + |
| 185 | +**For most updates:** |
| 186 | +```bash |
| 187 | +make sync-restart |
| 188 | +``` |
| 189 | + |
| 190 | +**For major changes or troubleshooting:** |
| 191 | +```bash |
| 192 | +cd ~/ARK-OS |
| 193 | +export INSTALL_PIXEAGLE="y" |
| 194 | +bash tools/service_control.sh install pixeagle |
| 195 | +``` |
| 196 | + |
| 197 | +**Both methods work for native and ARK-OS installations without breaking anything.** |
0 commit comments