Skip to content

F-24: No automatic recovery after a WiFi, orchestrator or JMRI outage #27

Open

Description

@bazauto

Severity: HIGH · Effort: Medium · Batch: 3 · Status: Code done in #21 (b35b84c), awaiting bench verification

Found in the second full review of the firmware. Recorded with the rest of the pass (F-19…F-44) in docs/REVIEW_REMEDIATION_PLAN_2.md, which is where its status is kept.

Description

  • WiFi gives up after five immediate retries and stays FAILED for good. A router reboot takes
    longer than those retries, and nothing retries afterwards.
  • The orchestrator login is attempted once at boot. With the layout on one switch, the host
    comes up after the ESP and the device sits at FAILED.
  • JMRI auto-connect waits 30 s for WiFi and then exits without ever starting the reconnect task.

In each case the operator has no control until they fix it by hand in settings.

Plan

  1. WiFiManager: after the fast retries, keep retrying with a capped backoff until the
    operator disconnects or forgets the network.
  2. Orchestrator: a supervising task that retries login and socket with backoff until
    connected, and re-logs in (rather than relying on the WebSocket's cookie-reusing
    auto-reconnect) when the socket stays down.
  3. JMRI: wait for WiFi indefinitely and keep reconnecting once settings exist — done by the
    single jmri_conn task F-34 introduces.

Files: WiFiManager.h/.cpp, AppController.h/.cpp, JmriConnectionController.cpp

Acceptance Criteria

  • WiFiManager keeps retrying after the immediate retries (one-shot esp_timer, 5 s
    doubling to 60 s) until Disconnect or Forget, both of which the WiFi screen now offers
    while it is in FAILED.
  • orch_connect supervises for the life of the app: waits for WiFi indefinitely, retries
    a failed login with backoff, logs in afresh after 30 s without a socket, retries a failed
    roster read. The config screen's Connect wakes it instead of connecting itself.
  • jmri_conn waits for WiFi indefinitely (see F-34).
  • Bench: power-cycle the router with the device running; it reconnects without a touch.
  • Bench: boot the device before the orchestrator host; it connects when the host is up.
  • Bench: same for JMRI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions