Skip to content

Winlink panel never shows Inbox/Outbox/Compose on local install (Pat enabled in rig-bridge) #1281

Open

Description

@billgenter-cmd

Version: v26.11.2, local install, rig-bridge winlink plugin enabled with pat.enabled true (127.0.0.1:8080). Pat v1.0.1 is running and receiving mail.

What happens: The Winlink panel keeps saying inbox, outbox and compose need the Rig Bridge Winlink plugin, even though it's enabled and Pat is reachable.

Cause: src/hooks/useWinlink.js fetches /api/winlink/status, /winlink/inbox, /winlink/outbox, /winlink/compose and /winlink/connect from the OHC server, not from rig-bridge. The server's own /api/winlink/status (server/routes/winlink.js) returns only gateway-cache info (apiKeyConfigured, etc.), with no enabled or patEnabled fields, so WinlinkPanel hides the Pat tabs. The /winlink/* routes exist only in rig-bridge (plugins/winlink-gateway.js), and the OHC server doesn't proxy them.

Suggested fix: Either proxy /winlink/* and rig-bridge's winlink status through the OHC server (as is done for /api/aprs/tnc-status), or have the hook call rig-bridge directly in local mode, the same way the digital-mode plugins use the SSE stream.

Activity

  1. accius commented on Nov 23, 2026

    @accius
    Owner

    Thanks again, and again your diagnosis was spot on. The panel was reading the OHC server's Winlink status, which only describes the shared gateway list and never says whether Pat is enabled. The inbox, outbox, compose and connect routes only exist on Rig Bridge.

    Fixed on Staging in 1516d62. On a local install, the Winlink panel now gets status, inbox, outbox, compose and connect straight from Rig Bridge, so the Pat tabs appear when Pat is enabled and reachable. Gateway search still tries the server's shared list first and falls back to Rig Bridge's list. Compose and connect send your Rig Bridge API token if you've set one. Connect waits up to 10 minutes, since Pat only replies when the session ends.

    I tested it against a real Rig Bridge with the Winlink plugin and a stand-in Pat, but not against a live Pat v1.0.1. If you can try the Staging branch with your setup, that would be the real confirmation.

  2. billgenter-cmd commented on Nov 26, 2026

    @billgenter-cmd
    Author

    Here's the whole note as one post, with your station results already in it. Copy everything inside the box and paste it into #1281:

    Tested Staging (506c12a, includes 1516d62) with real Pat v1.0.1 and JS8Call. The panels now reach Rig Bridge, but sending and mail fail against the real apps.
    
    **Winlink (`rig-bridge/plugins/winlink-gateway.js`)**
    
    1. **Compose:** POSTs JSON to `/api/mailbox/out`, but Pat v1.0.1 (`api/mailbox.go`, `postOutboundMessageHandler`) only reads multipart/urlencoded form fields (`to`, `cc`, `subject`, `body`, `date`) and returns `400 Missing date value` without an RFC3339 `date`. `patFetch` doesn't check HTTP status, so the panel shows "Message queued" while nothing reaches Pat's outbox. Fix: send urlencoded, add `date`, reject non-2xx.
    2. **Connect:** calls `/api/connect?transport=…&target=…`, but Pat reads only `url` (e.g. `url=telnet` or `telnet://…`, `api/api.go` `ConnectHandler`) and otherwise returns `500 Session failure`; the UI still says "Connected".
    3. **Inbox/Outbox:** Pat returns `[{MID, Date, From:{Addr}, To:[{Addr}], Cc, Subject, Body, BodyHTML, Files, P2POnly, Unread}]` (PascalCase; confirmed on my station, 169 messages). `WinlinkPanel` reads lowercase `mid/subject/from/to/date/body` as strings, so rows render as "(no subject) / Unknown". Fix: normalize field names and flatten `From.Addr` / `To[].Addr` in the bridge.
    4. `fetchMail()` swallows errors, so failures look like an empty inbox.
    5. Winlink and digital-mode write routes use `registerRoutes`, not `registerAuthRoutes`, so the API token isn't enforced for compose, connect, freetext or halt.
    
    **JS8Call free text:** `digital-mode-base.js` sends a WSJT-X binary FREE_TEXT packet, but JS8Call's `MessageClient` (v2.2.0 through main) only parses JSON, and its WSJT-X free-text handler was disabled in 2018. The route returns success and the box clears, but JS8Call does nothing. JS8Call's API is JSON over UDP/TCP, e.g. `{"type":"TX.SEND_MESSAGE","value":"…","params":{}}`, with "Accept UDP/TCP Requests" enabled under Settings > Reporting > API. Suggest a JSON path for the js8call plugin with host/port config (TCP default 2442).
    
    **Confirmed on my station:** `/api/js8call/status` shows `appId: "JS8Call"`, connected, 10,778 decodes, so receive works and only TX is broken. `POST /winlink/compose` returns Pat's `Missing date value`.
    
    I can't test the gateway list because the Winlink team isn't issuing API keys right now, so I still can't confirm sending or receiving mail from the OpenHamClock Winlink panel.
    
    The tests mock `fetch` with fake rows and never exercise `winlink-gateway.js` against Pat's real response shapes. Happy to test again.
    
    73, Bill KE9BPB
    
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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions