{% extends "base.html" %} {% block title %}OpenLCB{% endblock %} {% block content %}

OpenLCB / LCC bus

{% if not olcb_active %}

The active connection isn't OpenLCB. This page only works when ctx.connection is an OlcbConnection. Configure an OpenLCB connection to see discovered nodes here.

{% else %} {% include "_openlcb_identity.html" %} {# Bus health — extracted into a fragment so htmx can poll just this card without re-rendering the whole page. #}
{% include "_openlcb_health.html" %}

Discovered nodes

Bus monitor → sweeping…
{# Auto-poll every 5s so a peer joining the bus surfaces without a manual click. The Refresh + Prune buttons still work — their own hx-post/hx-get responses swap in immediately and reset the polling interval. #}
{% include "_openlcb_nodes.html" %}
{# Bus-wide health sweep result target — starts empty; the sweep button swaps in a full card. Placed as a bare div so the swap replaces it wholesale without leaving an empty wrapper. #}

Roster export / import

Save the current roster (NIDs + cached SNIP/PIP + events) as JSON for backup or bug-report attachments, or reload a saved dump to seed the SNIP/PIP caches without re-probing.

Download roster JSON
{# Hosted trains — populated when the operator has wired a CommandStationNode into ctx._openlcb_cs. The add-train form below only functions when a CS is attached (server 400s otherwise). #}

Hosted trains (command station)

{% include "_openlcb_hosted.html" %}

Traction search

Find a loco by DCC address without knowing its NodeID upfront. Matches any CS on the bus hosting that address.

{% include "_openlcb_search.html" %}
{% endif %} {% endblock %}