Update docs for auto-mode timeout and peer-sync ignore

This commit is contained in:
andrew committed 2026-11-27 15:45:01 +07:00
1 parent 581899e4a0
commit a168322194
3 files changed
+15 -2

No files matched your search

+7
View File
@@ -358,3 +358,10 @@ Request body (JSON) is forwarded to the internal control server, supporting:
`net_sack`, `net_box`, `ended_at`.
Responses include `object_labels`, `counts`, and `plate` for peer compatibility.
---
## Auto-mode peer sync
When `BATCH_MODE=auto`, `POST /api/batch/start` and `POST /api/batch/stop` forwarded with `X-Peer-Sync: 1` (peer requests) return `200` with `ignored: true` and the current batch state; the local counter keeps running. Non-peer (local dashboard) calls still work.
+3
View File
@@ -83,6 +83,9 @@ sudo systemctl restart feedmill-counter # after .env change
## Peer sync (FCP)
- When the counter is in `BATCH_MODE=auto`, peer-sync start/stop requests (forwarded with `X-Peer-Sync: 1`) are ignored and the current batch state is returned unchanged.
- In auto mode the batch timer (default 30s) is held while a truck is detected in the counting zone and counts down 30s after the truck leaves.
- FCP POSTs start/stop to dashboard `/api/batch/start` and `/api/batch/stop` with `X-API-Key: <PEER_API_TOKEN>`.
- Body is forwarded to internal control server; metadata stored on batch row (`source`, `fcp_batch_number`, `plate`, `do_numbers`, `expected_sack`, `expected_box`).
- Validate API key only when header present (dashboard UI unaffected).
+5 -2
View File
@@ -12,7 +12,7 @@ RTSP + YOLO RKNN + ByteTrack line-crossing counter for **sacks**, **boxes**, and
Batch lifecycle:
- **Manual Mode (`BATCH_MODE=manual`, default):** Operator triggers **Start Batch** / **Stop Batch** via dashboard buttons or API. One unified batch counts sacks and boxes together while reporting separate Sack and Box totals. Objects passing while stopped are ignored.
- **Auto Mode (`BATCH_MODE=auto`):** Auto-creates batch on first crossing, closes batch after idle timeout (`BATCH_TIMEOUT_SECONDS=600`).
- **Auto Mode (`BATCH_MODE=auto`):** Auto-creates batch on first crossing, closes batch after idle timeout (`BATCH_TIMEOUT_SECONDS=30`); timer is held while a truck is present in the counting zone and counts down 30s after the truck leaves. Peer-sync start/stop requests are ignored when the counter is in auto mode.
## Deploy
@@ -50,9 +50,12 @@ See **[DEPLOY.md](DEPLOY.md)**.
| `COUNT_AXIS` | `y` for downward flow |
| `CROSS_DIRECTION` | `down` (default), `up`, `ltr`, `rtl`, or `both` |
| `LINE_Y` / `LINE_Y_FRAC` | Counting line position |
| `BATCH_MODE` | `manual` or `auto` |
| `BATCH_MODE` | `manual` or `auto` (auto ignores peer start/stop) |
| `BATCH_TIMEOUT_SECONDS` | Auto-mode idle timeout (default `30`; held while truck in zone) |
| `DAILY_CUTOFF_TIME` / `CUTOFF_TIME` | Daily cutoff (`06:00`) |
| `PEER_API_TOKEN` | Shared secret for FCP peer sync (`X-API-Key`) |
| `TRUCK_ZONE_HOLD_SEC` | Seconds to hold last truck zone (default `300`) |
| `TRUCK_ZONE_PAD_X` | Pixel pad around truck bbox for zone (default `10`) |
## Files