modules/app_cellular.py: uses the SIM868's built-in AT-command HTTP(S) client (AT+HTTPINIT/HTTPPARA/HTTPACTION/HTTPREAD) instead of a real ppp0 interface, since the module's GNSS (polled continuously by app_gps.py) and its GSM/GPRS radio share the same physical UART (/dev/serial0) - a pppd/chat dial-up would take over that port entirely and starve GNSS polling. Staying in AT-command mode lets cellular HTTP calls interleave safely through the same serial lock. Only carries small JSON tracking batches, never dashcam video - cellular is far too slow/limited for that, and the modem's HTTP AT interface has too small an internal buffer anyway. Dashcam uploads remain WiFi/Ethernet-only, unchanged. modules/app_upload.py: tracking-batch upload always tries WiFi/ Ethernet first; only on a connection-level failure (not an HTTP error status, which means the server was reached) does it retry over cellular. Exposes last_network_path/cellular_fallback_configured in /api/upload/status; UI shows which path the last batch used. Feature-flagged off by default via new YARIS_CELLULAR_ENABLED/ YARIS_CELLULAR_APN/_APN_USER/_APN_PASS keys in db/upload_creds.env (all blank by default) - has zero effect on the existing WiFi upload path unless explicitly configured. Regression-tested against the real deployed server that normal WiFi uploads are unaffected while cellular stays unconfigured. *** UNTESTED against real cellular hardware - no SIM card was *** available. See docstrings in app_cellular.py and PLAN.md for *** exactly what needs validation once a SIM card is available. Co-authored-by: Copilot <[email protected]>
27 lines
917 B
Bash
27 lines
917 B
Bash
##
|
|
## yaris-obd remote server upload client credentials
|
|
##
|
|
## Real values are set locally on the Pi only - never commit real credentials
|
|
## here. Get YARIS_DEVICE_NAME/YARIS_API_KEY by running
|
|
## `docker compose exec api python3 scripts/create_device.py <name>` on the
|
|
## server (see server/README.md).
|
|
##
|
|
|
|
YARIS_SERVER_URL = ""
|
|
YARIS_DEVICE_NAME = ""
|
|
YARIS_API_KEY = ""
|
|
|
|
##
|
|
## Optional SIM868 cellular fallback for trip/GPS-log uploads only (NOT
|
|
## dashcam video - too slow/limited over GPRS/3G). Only takes effect when a
|
|
## WiFi/Ethernet upload attempt fails outright (no route/DNS/timeout).
|
|
## UNTESTED - no SIM card was available during development, see
|
|
## modules/app_cellular.py. Leave YARIS_CELLULAR_ENABLED blank to keep this
|
|
## fully disabled (default) with zero effect on normal WiFi uploads.
|
|
##
|
|
|
|
YARIS_CELLULAR_ENABLED = ""
|
|
YARIS_CELLULAR_APN = ""
|
|
YARIS_CELLULAR_APN_USER = ""
|
|
YARIS_CELLULAR_APN_PASS = ""
|