fleet/agents/go2/.env.example

89 lines
4.7 KiB
Plaintext

# sanad_api_go2 — copy to .env and fill in.
# ── fleet server (REQUIRED — YS Lootah gives you these two) ──────────────────
SERVER_URL=https://fleet.example.com
DEVICE_TOKEN=REPLACE_WITH_DEVICE_TOKEN
# ── identity ─────────────────────────────────────────────────────────────────
# This robot's fleet id, sent in the telemetry body as "sn". Set the real Go2 id.
SN=go2_0000
# ── DDS (reading robot state — unitree_go family) ────────────────────────────
# Interface that sees the Go2's DDS traffic (Jetson/onboard usually eth0).
DDS_INTERFACE=eth0
DDS_DOMAIN=0
# MAC_INTERFACE=eth0
# ── position options ─────────────────────────────────────────────────────────
# none (default) | sportmode (rt/lf/sportmodestate) | rosbridge (/odom).
GO2_POSITION_SOURCE=none
ROSBRIDGE_URL=ws://127.0.0.1:9090
# ── fault thresholds ─────────────────────────────────────────────────────────
LOW_SOC=50
MOTOR_TEMP_MAX=85
# ── cadence / transport ──────────────────────────────────────────────────────
POLL_INTERVAL=2
VERIFY_TLS=1
HTTP_TIMEOUT=10
# ── robot identity card (shown on the dashboard) ─────────────────────────────
ROBOT_BRAND=unitree
ROBOT_TYPE=dog
ROBOT_MODEL=go2
# Optional: Sanad data dir whose size is reported in storage (as /host/<path>
# when the installer's read-only /:/host mount is used). Empty = omit.
STORAGE_DATA_PATH=
# ── map sync (uploaded ONCE per content; status shown in telemetry "map") ────
# The installer mounts the robot's real maps dir at /data/maps (probed on the
# robot: rtabmap*.db / slam_toolbox yaml+pgm sets). Fallback = agent's own dir.
MAPS_DIR=/data/maps
DATA_DIR=/data/web_data
STATE_DIR=/data/state
MAP_SELECT=all
MAP_UPLOAD_MODE=multipart
MAP_POLL_INTERVAL=30
# ── logs + alerts ─────────────────────────────────────────────────────────────
# agent log lines shipped to /{sn}/logs every LOGS_INTERVAL; new faults POSTed
# to /{sn}/alert immediately (rising edge).
LOGS_INTERVAL=60
# ── project logs (shared alongside agent logs) ───────────────────────────────
# auto (default) = find a RUNNING Sanad project container (sanadr1, sanad-p4,
# sanad*) via the /host mount and tail its docker json-log, labeled
# "<name>-logs" in the shipped lines; telemetry shows project_logs (null=none).
# Or pin a container name / an explicit log file (PROJECT_LOG_PATH, via /host).
PROJECT_LOG_CONTAINER=auto
PROJECT_LOG_PATH=
PROJECT_LOG_LABEL=
# ── remote dashboard (register the Sanad web UI for the fleet to embed) ───────
# The agent probes these ports on the robot, finds the Sanad dashboard, and
# POSTs its URL to /{sn}/remote (kind=web) — no changes to the Sanad app.
REMOTE_ENABLE=1
REMOTE_PORTS=8001,8014,8011,8012,8013,8000,8080
REMOTE_KIND=web
# REMOTE_HOST= # default: the robot's primary LAN IP (fleet-reachable)
# REMOTE_URL= # pin an explicit URL (e.g. a public reverse-tunnel) — wins over discovery
REMOTE_INTERVAL=60
# ── control panel (READ-ONLY loco mode; remote SWITCH is off by design) ───────
# The agent reads the Sanad dashboard's /api/controller/status (no DDS, no
# motion) and reports the current mode (zero_torque/damp/lock/running) + the
# switchable set in telemetry.control. CONTROL_ENABLE stays 0: remote mode-
# SWITCHING is deliberately NOT built (it commands motion and can drop the robot;
# switching is done in person on the Sanad dashboard). Leave URL blank to use the
# auto-discovered dashboard port.
CONTROL_STATUS_URL=
CONTROL_ENABLE=0
# ── log-driven alerts (Gemini billing + any robot ERROR) ─────────────────────
# The agent scans the robot's project (sanadr1) logs; each NEW matching signature
# fires an alert (deduped per ALERT_LOG_COOLDOWN). "CODE=regex" entries split by ;;
# ALERT_LOG_PATTERNS=GEMINI_BILLING=prepayment credits.{0,40}deplet|Please go to AI Studio|Failed to connect to Gemini;;ROBOT_ERROR=\bERROR\b|Traceback|Exception|CRITICAL
ALERT_LOG_COOLDOWN=300
ALERT_SCAN_INTERVAL=10