ROTCTL(1) | Hamlib Utilities | ROTCTL(1) |
rotctl - control antenna rotators
rotctl |
[-hiIlLuV] [-m id] [-r device] [-s baud] [-t char] [-C parm=val] [-v[-Z]] [command|-] |
Control antenna rotators.
rotctl accepts commands from the command line as well as in interactive mode if none are provided on the command line.
Keep in mind that Hamlib is BETA level software. While a lot of backend libraries lack complete rotator support, the basic functions are usually well supported.
Please report bugs and provide feedback at the e-mail address given in the BUGS section below. Patches and code enhancements sent to the same address are welcome.
This program follows the usual GNU command line syntax. Short options that take an argument may have the value follow immediately or be separated by a space. Long options starting with two dashes (‘-’) require an ‘=’ between the option and any argument.
Here is a summary of the supported options:
Note: Some options may not be implemented by a given backend and will return an error. This is most likely to occur with the --set-conf and --show-conf options.
Be aware that the backend for the rotator to be controlled, or the rotator itself may not support some commands. In that case, the operation will fail with a Hamlib error code.
Commands can be entered either as a single char, or as a long command name. The commands are not prefixed with a dash as the options are. They may be typed in when in interactive mode or provided as argument(s) in command line interface mode. In interactive mode commands and their arguments may be entered on a single line:
P 123 45
Since most of the Hamlib operations have a set and a get method, an upper case letter will often be used for a set method whereas the corresponding lower case letter refers to the get method. Each operation also has a long name; in interactive mode, prepend a backslash, ‘\’, to enter a long command name.
Example: Use “\get_info” in interactive mode to see the rotator's information.
Note: The backend for the rotator to be controlled, or the rotator itself may not support some commands. In that case, the operation will fail with a Hamlib error message.
As an alternative to the READLINE interactive command entry or a single command for each run, rotctl features a special option where a single dash (‘-’) may be used to read commands from standard input (stdin). Commands must be separated by whitespace similar to the commands given on the command line. Comments may be added using the ‘#’ character, all text up until the end of the current line including the ‘#’ character is ignored.
A simple example:
$ cat <<.EOF. >cmds.txt > # File of commands > set_pos 180.0 10.0 # rotate > pause 30 # wait for action to complete > get_pos # query rotator > .EOF. $ rotctl -m 1 - <cmds.txt set_pos 180.0 10.0 pause 30 get_pos 180.000000 10.000000 $
A summary of commands is included below (In the case of set commands the quoted italicized string is replaced by the value in the description. In the case of get commands the quoted italicized string is the key name of the value returned.):
P 163.0 41.0
These commands offer conversions of Degrees Minutes Seconds to other formats, Maidenhead square locator conversions and distance and azimuth conversions.
L -170.0 -85.0 12
Locator: AA55AA00AA00
l AA55AA00AA00
Longitude: -169.999983 Latitude: -84.999991
If Readline library development files are found at configure time, rotctl will be conditonally built with Readline support for command and argument entry. Readline command key bindings are at their defaults as described in the Readline manual. rotctl sets the name “rotctl” which can be used in Conditional Init Constructs in the Readline Init File ($HOME/.inputrc by default) for custom keybindings unique to rotctl.
Command history is available with Readline support as described in the Readline History manual. Command and argument strings are stored as single lines even when arguments are prompted for input individually. Commands and arguments are not validated and are stored as typed with values separated by a single space.
Normally session history is not saved, however, use of either of the -i/--read-history or -I/--save-history options when starting rotctl will cause any previously saved history to be read in and/or the current and any previous session history (assuming the -i and -I options are given together) will be written out when rotctl is closed. Each option is mutually exclusive, i.e. either may be given separately or in combination. This is useful to save a set of commands and then read them later but not write the modified history for a consistent set of test commands in interactive mode, for example.
History is stored in $HOME/.rotctl_history by default although the destination directory may be changed by setting the ROTCTL_HIST_DIR environment variable. When ROTCTL_HIST_DIR is unset, the value of the HOME environment variable is used instead. Only the destination directory may be changed at this time.
If Readline support is not found at configure time the original internal command handler is used. Readline is not used for rotctl commands entered on the command line regardless if Readline support is built in or not.
Note: Readline support is not included in the MS Windows 32 or 64 bit binary builds supplied by the Hamlib Project. Running rotctl on the MS Windows platform in the ‘cmd’ shell does give session command line history, however, it is not saved to disk between sessions.
The -v, --verbose option allows different levels of diagnostics to be output to stderr and correspond to -v for BUG, -vv for ERR, -vvv for WARN, -vvvv for VERBOSE, or -vvvvv for TRACE.
A given verbose level is useful for providing needed debugging information to the email address below. For example, TRACE output shows all of the values sent to and received from the radio which is very useful for radio backend library development and may be requested by the developers.
rotctl exits with:
Start rotctl for RotorEZ using the first serial port on Linux:
$ rotctl -m 401 -r /dev/ttyS0
Start rotctl for RotorEZ using COM2 on MS Windows:
$ rotctl -m 401 -r COM2
Connect to a running rotctld with rotator model 2 (“NET rotctl”) on the local host and specifying the TCP port, and querying the position:
$ rotctl -m 2 -r localhost:4533 \get_pos
Report bugs to:
This file is part of Hamlib, a project to develop a library that simplifies radio and rotator control functions for developers of software primarily of interest to radio amateurs and those interested in radio communications.
Copyright © 2001-2011 Stephane Fillod
Copyright © 2002-2017 the Hamlib Group (various contributors)
Copyright © 2003-2018 Nate Bargmann
This is free software; see the file COPYING for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot archives:
2018-04-29 | Hamlib |