MARS Android → Linux L2 migration¶
This document describes the one-shot migration from the legacy MARS
Android L2 application to the new Linux edge-service
(okto-edge-service package).
Prerequisites¶
rootaccess on the Android host (MARS lines already run rooted).adbon the operator laptop.- Linux IPC pre-installed with
okto-edge-service(Debian) or the RPM (RED OS). okto-migrateJAR:
Step-by-step¶
1. Capture the Android dump¶
mkdir android-dump && cd android-dump
adb shell run-as ru.okto.android tar c shared_prefs databases | tar x
2. Convert SharedPreferences → edge-service.yaml¶
Edit the generated file and set:
device.identifier(match the MARS line ID).line.variant(DRY/WET),line.site(LUZ/NOV/MIR/RND).- Adjust scanner / printer / PLC entries to reflect the physical wiring.
3. Export SQLite history¶
Replay the history into the new service after provisioning:
# Pilot-only helper — not production-ready, intended for cutover week.
python3 scripts/replay-history.py android-history.jsonl \
--target http://<ipc>:8080
4. Start the service¶
5. Validate¶
- Operator UI loads at
http://<ipc>:3000(Tauri / kiosk). - Dashboard shows the new cabinet entry with the correct variant / site.
- Fire a test scan from each configured scanner (through
POST /api/v1/scanners/{index}/test). - Simulate a UPS event (WET only):
Confirm the journal shows the
curl -X POST http://<ipc>:8080/api/v1/ups/simulate \ -H 'Content-Type: application/json' \ -d '{"onBattery":true,"batteryPercent":35}'UPS_ON_BATTERYevent.
Rollback¶
- Stop the Linux service:
- Power the Android host back on.
- The Android host is kept on-site for 14 days before decommissioning.
SharedPreferences mapping¶
| OLD_APP key (snake_case) | Linux config | Notes |
|---|---|---|
device_id / DEVICE_ID |
device.identifier |
|
device_name / DEVICE_NAME |
device.name |
|
line_id / production_line_id |
device.productionLineId |
|
scanner_ip / matrix_scanner_ip |
scanners[0].host |
Primary scanner |
scanner_port |
scanners[0].port |
|
printer_ip |
printers[0].host |
|
printer_port |
printers[0].port |
|
printer_type |
printers[0].type |
UPPERCASE |
modbus_ip / plc_ip |
plcs[0].host |
protocol=MODBUS_TCP |
modbus_port / plc_port |
plcs[0].port |
default 502 |
copacking_mode, task_mode… |
OperationModes (DB-persisted) |
re-enabled from UI |
New keys — enter manually or via the L2SettingsPage:
line.variant(DRY/WET)line.site(LUZ/NOV/MIR/RND)line.plcVisualisationUrl(MARS PLC UI iframe URL)ups.type(OWEN_IBP120Kon WET)gpio.backend(libgpiodon DRY, USB fallback otherwise)
Known differences¶
- Scanner IP list — legacy MARS hosts have up to 8 scanners; the new config supports 10.
- Printer multi-instance — legacy is single printer; new schema allows several (MARS SDX + mobile ZPL side-by-side).
- Event journal — new subsystem, no parity on the Android side.
- Batch accounting (Партионный учёт) — new functionality, no prior mapping.