Skip to content

PTB integration (new PACTOR mode) - #529

Open
harenber wants to merge 3 commits into
la5nta:developfrom
harenber:ptb-integration
Open

PTB integration (new PACTOR mode)#529
harenber wants to merge 3 commits into
la5nta:developfrom
harenber:ptb-integration

Conversation

@harenber

@harenber harenber commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Transport for the PACTOR-TCP-bridge. See PTB git page for details. Enables listen mode on PACTOR.

@martinhpedersen

Copy link
Copy Markdown
Member

Thanks for this PR 😊

Haven't found time to review yet, but hopefully next week.

Thank you!

@martinhpedersen
martinhpedersen self-requested a review July 21, 2026 08:42
Comment thread cfg/config.go Outdated
Comment thread cli/connect.go
@martinhpedersen

Copy link
Copy Markdown
Member

I've fixed the build failure @ develop. A rebase of your branch should resolve the build check.

@harenber

Copy link
Copy Markdown
Contributor Author

Thanks for the review Martin,

I addressed both items, implemented pactor+ptb and pactor+serial as you suggested. On the long run, on can probably discontinue the old approach, but as people are actively using it, I'd leave it in for the time being. Furthermore it doesn't need an additional program to run, which might be helpful for some ops out there.

Connection tests succeeded:

cubietruck:~$ cd /tmp
cubietruck:/tmp$ PAT_DEBUG=1 ./pat connect pactor+ptb:///DL0XR
2026/07/25 14:44:37 [DEBUG] Version: v1.0.0 (9745dfa) linux/amd64 - go1.26.5
2026/07/25 14:44:37 [DEBUG] Command: connect [pactor+ptb:///DL0XR]
2026/07/25 14:44:37 [DEBUG] Mailbox dir is	'/home/harenber/.local/share/pat/mailbox'
2026/07/25 14:44:37 [DEBUG] Forms dir is	'/home/harenber/.local/share/pat/Standard_Forms'
2026/07/25 14:44:37 [DEBUG] Config file is	'/home/harenber/.config/pat/config.json'
2026/07/25 14:44:37 [DEBUG] Log file is 	'/home/harenber/.local/state/pat/pat.log'
2026/07/25 14:44:37 [DEBUG] Event log file is	'/home/harenber/.local/state/pat/eventlog.json'
2026/07/25 14:44:37 [DEBUG] new config directory /home/harenber/.config/pat already exists, we have already migrated
2026/07/25 14:44:37 [DEBUG] Failed to initialize VOACAP: failed to find executable: exec: "voacapl": executable file not found in $PATH
2026/07/25 14:44:37 [DEBUG] Checking for active Winlink account...
2026/07/25 14:44:37 [DEBUG] Skipping "account-confirmed" (last run: 386h35m0s ago)
2026/07/25 14:44:37 [DEBUG] Account confirmation error: call was rate-limited
2026/07/25 14:44:37 [DEBUG] connectStr: pactor+ptb:///DL0XR
2026/07/25 14:44:37 [DEBUG] Skipping "version_report" (last run: 3m0s ago)
2026/07/25 14:44:37 [DEBUG] Skipping "pw_recovery_email_check" (last run: 3m0s ago)
2026/07/25 14:44:37 PTB TX CMD: I DL1THM
2026/07/25 14:44:37 PTB modem initialized at localhost:8300 (data: localhost:8301)
2026/07/25 14:44:37 Connecting to DL0XR (pactor+ptb)...
2026/07/25 14:44:37 PTB TX CMD: C DL0XR
2026/07/25 14:44:38 PTB RX CMD: 4) CONNECTED to DL0XR
2026/07/25 14:44:38 Connected to ptb:DL0XR (ptb)
Open source Winlink client - getpat.io
;FW: DL0XR
[Pat-1.0.0-B2FHMG$]
; PTB:DL1THM DE DL0XR ()>
GZIP_EXPERIMENT: Gzip compression enabled in this session.
>FF
FQ
2026/07/25 14:44:49 PTB Disconnect requested.
2026/07/25 14:44:53 PTB TX CMD: D
2026/07/25 14:44:55 PTB RX CMD: 4) DISCONNECTED fm DL0XR
2026/07/25 14:44:55 Disconnected.
2026/07/25 14:44:55 [DEBUG] Starting cleanup
2026/07/25 14:44:55 [DEBUG] Closing active connection and/or listeners
2026/07/25 14:44:55 [DEBUG] Closing modems
2026/07/25 14:44:55 [DEBUG] Closing rigs
2026/07/25 14:44:55 [DEBUG] Cleanup done
cubietruck:/tmp$

and

cubietruck:/tmp$ ./pat --listen pactor+ptb --config $HOME/.config/pat/config-dl0xr.json interactive
2026/07/25 14:44:06 Listening for incoming traffic on pactor+ptb...
L[pactor+ptb]> 2026/07/25 14:44:06 PTB TX CMD: I DL0XR
2026/07/25 14:44:06 PTB modem initialized at localhost:8302 (data: localhost:8303)
2026/07/25 14:44:06 PTB TX CMD: %L 1
2026/07/25 14:44:39 PTB RX CMD: 4) CONNECTED to DL1THM
2026/07/25 14:44:39 Got connect (pactor+ptb:ptb:DL1THM)
2026/07/25 14:44:39 Connected to ptb:DL1THM (ptb)
;FW: DL1THM
[Pat-1.0.0-B2FHMG$]
; DL0XR DE DL1THM ()
GZIP_EXPERIMENT: Gzip compression enabled in this session.
FF
>FQ
2026/07/25 14:44:45 PTB Disconnect requested.
2026/07/25 14:44:49 PTB TX CMD: D
2026/07/25 14:44:54 PTB RX CMD: 4) DISCONNECTED fm DL1THM
2026/07/25 14:44:54 Disconnected.

L[pactor+ptb]> q
cubietruck:/tmp$

73s, Torsten

@martinhpedersen
martinhpedersen self-requested a review August 15, 2026 05:45

@martinhpedersen martinhpedersen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again Torsten! See inline comments :)

Comment thread app/listen.go
}
return m.NewListener()
}
func (l PTBListener) CurrentFreq() (Frequency, bool) { return 0, false }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should implement this, so the correct frequency is logged on incoming connections :)

Can probably copy code from VaraHFListener's implementation?

Comment thread cfg/pactor_engine.go
}
switch v := PactorEngine(str); v {
case "":
*p = DefaultPactorEngine()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding default engine: What's the best default going forward? Should the recommended solution be ptb?

There are two "defaults" to consider here:

  • Which should we default to for existing configurations that don't specify an engine value (upgrade)?
    • I usually lean towards a safe upgrade for existing users - i.e. "serial".
  • Which should be the default on new deployments (no configuration file exist)?
    • Depends on which engine we are going to recommend as the go-to for new users.

Comment thread cli/connect.go
ardop: ARDOP TNC
pactor: SCS PTC modems
pactor: SCS PTC modems (legacy driver)
ptb: PTB (PACTOR-TCP-Bridge) - modern PACTOR driver

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update these. It's three options now: pactor, pactor+ptb and pactor+serial.

Comment thread cli/connect.go
connect ardop:///LA3F?freq=5350 Same as above, but set dial frequency of the radio using rigcontrol.
connect pactor:///LA3F Connect to RMS HF Gateway LA3F using PACTOR.
connect pactor:///LA3F Connect to RMS HF Gateway LA3F using PACTOR engine as per configuration.
connect pactor+ptb:///LA3F Connect to LA3F using the PACTOR-TCP-Bridge (PTB) engine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably leave this one out, don't you think?

Comment thread cfg/pactor_engine.go
//
// It defaults to the serial (ptc-go) driver for backwards compatibility with
// existing pactor configurations.
func DefaultPactorEngine() PactorEngine { return PactorEngineSerial }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the ax25 engine, this function was needed in order to have different defaults for different host operating systems. In this case, I think it's sufficient to hardcode the default values where needed (two places).

Comment thread cfg/config.go
}

// PTBConfig holds PTB (PACTOR-TCP-Bridge) specific configuration
type PTBConfig struct {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to try merging this into the existing PactorConfig somehow. I'm a bit concerned this will be confusing for the user, especially if/when we finally deprecate the "legacy" (serial) driver.

But let's defer this for now. I can probably come up with a suggestion we can discuss later :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants