la5nta / pat

A cross-platform Winlink client written in Go
https://getpat.io
MIT License
488 stars 86 forks source link

serial-tnc sets packet baud rate to serial baud rate #279

Closed mstyne closed 2 years ago

mstyne commented 3 years ago

Hello, and thank you for Pat! I have been using it for several weeks on a Raspberry Pi system via HF with great success.

I am now trying to set up Pat on an XUbuntu laptop with a Kenwood TH-D74A. I notice when Pat initializes the radio as part of the serial-tnc configuration, it sets the HBAUD setting of the radio's internal TNC to 9600 (PACKET96), which is the same setting as the Serial Port connection for the radio. This appears to be happening in the line below:

https://github.com/la5nta/pat/blob/eb00df2b7509f62d0819d9b9189ee2f0218fa04e/connect.go#L90-L92

This prevents Pat from connecting to 1200 baud (PACKET12) Packet Winlink stations when using a 9600 baud serial speed. I thought perhaps a workaround would be to set the TNC serial baud rate to 1200, but the slowest serial speed it supports is 2400.

I apologize if there is a configuration setting for this that I've missed.

Thanks for taking a look and 73 Mike K2MTS

martinhpedersen commented 3 years ago

Thanks for reporting this. The configuration documentation clearly states that config.SerialTNC.Baudrate should define the "Baudrate for the serial port".

The serial baud rate is actually hardcoded to 9600.

We need to define a new dial-url parameter for the serial-tnc:// scheme's serial baud rate (serial_baudrate?), and set that according to the config value. We should probably also add a hbaud config value so users can specify the default hbaud.