The Receiver is part of the file‑transfer suite. It connects to a TNC (using either a TCP or serial connection), listens for KISS‑framed file data, reassembles the packets into a complete file, verifies its integrity via an MD5 checksum, and either saves, executes, or outputs the file to standard output.
The Receiver program is designed to accept incoming file transfers sent using KISS framing. It continuously reads from the underlying TNC connection, extracts and unescapes KISS frames, and parses packets.
bash instead of saving it.
--stdout option, the file contents are sent directly to standard output rather than being saved to disk (the filename is only used in log messages). It is recommended to use the --one-file option in this mode.
--tcp-read-deadline option). If no data is received within the specified time, it will attempt to reconnect automatically.
--callsigns option, the Receiver processes only packets from allowed sender callsigns. Wildcards are supported (for example, MM5NDH-* or *-15).
--fileid option lets you restrict the transfer to a specific file ID (exactly 2 alphanumeric characters). This option is only allowed in conjunction with the --one-file flag.
To build the Receiver, ensure that you have Go installed and that you have installed the required packages (such as go.bug.st/serial). Then compile the program:
go build -o receiver receiver.go
The table below lists all available command‑line options for the Receiver along with descriptions and default values:
| Flag | Description | Default Value |
|---|---|---|
--my-callsign |
Your own callsign (required). This identifies you as the receiver. | none |
--connection |
Connection type to the TNC. Must be either tcp or serial.
|
tcp |
--debug |
Enable verbose debug output. | false |
--host |
TCP host to connect to (used if --connection is set to tcp).
|
127.0.0.1 |
--port |
TCP port to connect to (used if --connection is set to tcp).
|
9001 |
--serial-port |
Serial port device (e.g., /dev/ttyUSB0 or COM3). Required if using a serial connection.
|
empty |
--baud |
Baud rate for the serial connection. | 115200 |
--one-file |
Exit after successfully receiving one file. | false |
--execute |
Instead of saving the received file, if the filename matches this value the file is executed with bash. | empty |
--replace |
Overwrite existing files if a file with the same name is received. | false |
--execute-timeout |
Maximum number of seconds to allow an executed file to run (0 means no timeout). | 0 |
--stdout |
If set, the received file is output directly to standard output instead of being saved to disk. | false |
--callsigns |
A comma‑delimited list of allowed sender callsign patterns. Only packets with a sender that matches one of these patterns will be processed. Wildcards are supported (e.g. MM5NDH-* or *-15).
|
empty |
--tcp-read-deadline |
Time (in seconds) without data before triggering a reconnect (TCP only). | 600 |
--fileid |
Specify a file ID (exactly 2 alphanumeric characters). Only allowed with --one-file.
|
empty |
The following command starts the Receiver using a TCP connection to the TNC at 127.0.0.1:9001 and saves any received file.
Your callsign is set to N0CALL.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001
This command uses a serial connection on /dev/ttyUSB0 with a baud rate of 115200. Debug logging is enabled.
go run receiver.go --my-callsign=N0CALL --connection=serial --serial-port=/dev/ttyUSB0 --baud=115200 --debug
In this example, if the received file’s name matches runme.sh, the Receiver will execute the file with bash instead of saving it.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001 --execute=runme.sh
With the --stdout option, the received file will be output directly to standard output rather than being saved. The --one-file option is recommended.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001 --stdout --one-file
This command will overwrite an existing file if a new file with the same name is received and exit after a single successful transfer.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001 --replace --one-file
The following example uses the --callsigns option. Only packets sent from a sender matching one of the allowed patterns (for example, MM5NDH-* or *-15) will be processed.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001 --callsigns=MM5NDH-*,*-15
This example restricts the transfer to a specific file ID (e.g. AB). Note that --fileid can only be used with --one-file.
go run receiver.go --my-callsign=N0CALL --connection=tcp --host=127.0.0.1 --port=9001 --fileid=AB --one-file
--my-callsign is specified. If using a serial connection, --serial-port is also mandatory.
--execute flag is used, the received file will be temporarily saved, executed with bash (subject to the optional timeout), and then removed.
--stdout flag is used, the file content is written to standard output. This option is useful for piping the output to another program or command.
--tcp-read-deadline (default 600 seconds), the Receiver will automatically close the connection and attempt to reconnect.
--callsigns option, only the sender’s callsign is checked against the allowed patterns. This ensures that the Receiver processes only packets from approved senders.
--fileid option restricts file transfers to a specific file ID. It must consist of exactly 2 alphanumeric characters and can only be used when --one-file is enabled.
For further assistance, bug reports, or feature requests, please contact the project maintainer or visit the project repository.