The command line interface

Antoine Beaupré edited this page Sep 27, 2017 · 4 revisions

Getting started

This is a document on how to use Pat's command-line interface.

Setting up your text editor

Pat's command-line interface relies heavily on using an external text editor. For users that are not that familiar with the unix command line environment, this can be challenging at first.

The application will invoke the default text editor for the operating system you are using, but this can be overridden by setting the EDITOR environment variable.

nano is a simple editor that is easy to get started with. It's the default on many Debian based Linux distributions. To set up nano as your default editor on Mac OS or Linux, simply run these two commands in your terminal:

echo 'export EDITOR=nano' >> ~/.profile
source ~/.profile

See howtogeek.com's beginners guide to nano to read more about how to use nano.

Configure

The default location for the configuration file is ~/.wl2k/config.json. To open the file in an editor, simply run the configure command:

pat configure

The configuration file is formatted as json.

To get "on the air" you'll first have to set up your callsign, maidenhead locator and secure login credentials. Look for the attributes mycall, locator and secure_login_password and set them appropriately. If you do not have a password yet, do not worry, Winlink will create a new one when you connect the first time, and you can run configure again to set it. It will be needed for future communications, so make sure you do configure it.

Example:

{
  "mycall": "LA5NTA",
  "locator": "JP20qe",
  "secure_login_password": "MYPASSWORD",
}

For more detailed documentation of the configuration file, see godocs.

WINMOR configuration

To configure WINMOR you'll need to locate the winmor section of the config file. It should look something like this:

"winmor": {
  "addr": "localhost:8500",
  "inbound_bandwidth": 1600,
  "rig": "",
  "ptt_ctrl": false
},

If you are going to use a WINMOR tnc instance running on your local machine, this default config should be fine.

inbound_bandwidth is the bandwidth used for inbound connections (P2P), either 500 or 1600 (Hz).

If you need/want rig control (for PTT and QSY over CAT) you will have to define which rig (listed in hamlib_rigs) the application should use. My winmor section would look like this:

"winmor": {
  "addr": "localhost:8500",
  "inbound_bandwidth": 1600,
  "rig": "ft897",
  "ptt_ctrl": true
},

Where the "ft897" rig's config looks like this (for use with rigctld):

"hamlib_rigs": {
  "ft897": {"address": "localhost:4532", "network": "tcp"}
},

Printing the help text

To print the help text for the application you can run pat help, which will provide you with an overview of all commands and options.

You can print detailed usage text for a command also. pat help connect will print detailed information on how the connect command should be used.

Composing a new email

To compose a new email, use the compose command:

pat compose

You will be prompted with some basic options before the editor opens and you can start to compose your message:

martinhpedersen@duo:~$ pat compose
From [LA5NTA]: (just hit ENTER to use the default value)
To: LA3QMA
Cc: LA4PM,LA7UM,LA5KTA
Subject: Postman Pat
Press ENTER to start composing the message body. _

When you are done editing the message, save (nano : ctrl+o followed by ENTER) and exit (nano: ctrl+x).

You will now be prompted to add attachments. If you have none, simply hit ENTER.. otherwise give the full path to the attachment.

The application will now print your newly composed message, which has been posted to your outbox (~/.wl2k/mailbox/YOURCALL/out).

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.