.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH ROTCTL "1" "March 13, 2013" "Hamlib" "Rotator Control Program" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rotctl \- control antenna rotators .SH SYNOPSIS .B rotctl [\fIOPTION\fR]... [\fICOMMAND\fR]... .SH DESCRIPTION Control antenna rotators. \fBrotctl\fP accepts \fIcommands\fP from the command line as well as in interactive mode if none are provided on the command line. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. Keep in mind that \fBHamlib\fP is BETA level software. While a lot of backend libraries lack complete rotator support, the basic functions are usually well supported. The API may change without publicized notice, while an advancement of the minor version (e.g. 1.x to 3.x) indicates such a change. .PP Please report bugs and provide feedback at the e-mail address given in the REPORTING BUGS section. Patches and code enhancements are also welcome. .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes ('-'). Here is a summary of the supported options: .TP .B \-m, --model=id Select rotator model number. See model list (use 'rotctl -l'). .sp NB: \fBrotctl\fP (or third party software) will use rotator model 2 for NET rotctl (rotctld). .TP .B \-r, --rot-file=device Use \fIdevice\fP as the file name of the port the rotator is connected. Often a serial port, but could be a USB to serial adapter or USB port device. Typically /dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0, etc. on Linux or COM1, COM2, etc. on Win32. .TP .B \-s, --serial-speed=baud Set serial speed to \fIbaud\fP rate. Uses maximum serial speed from rotator backend capabilities as default. .TP .B \-t, --send-cmd-term=char Change the termination \fIchar\fP for text protocol when using the \fIsend_cmd\fP command. The default value is . Non ASCII printable characters can be specified as an ASCII number, in hexadecimal format, prepended with 0x. You may pass an empty string for no termination char. The string -1 tells rotctl to switch to binary protocol. See the \fIsend_cmd\fP command for further explanation. .TP .B \-L, --show-conf List all config parameters for the rotor defined with -m above. .TP .B \-C, --set-conf=parm=val[,parm=val]* Set config parameter. e.g. --set_conf=stop_bits=2 .sp Use -L option for a list. .TP .B \-u, --dump-caps Dump capabilities for the rotor defined with -m above and exit. .TP .B \-l, --list List all model numbers defined in \fBHamlib\fP and exit. As of 1.2.15.1 the list is sorted by model number. .sp \fBN.B.\fP In Linux the list can be scrolled back using Shift-PageUp/ Shift-PageDown, or using the scrollbars of a virtual terminal in X or the cmd window in Windows. The output can be piped to 'more' or 'less', e.g. 'rotctl -l | more'. .TP .B \-i, --read-history Read previously saved command and argument history from a file (default '~/.rotctl_history') for the current session. Available when \fBrotctl\fP is built with Readline support (see READLINE below). .sp \fBN.B.\fP To read a history file stored in another directory, set the ROTCTL_HIST_DIR environment variable, e.g. 'ROTCTL_HIST_DIR=~/tmp rotctl -i'. When ROTCTL_HIST_DIR is not set, the value of HOME is used. .TP .B \-I, --save-history Write current session and previous session(s), if -i option is given, command and argument history to a file (default '~/.rotctl_history') at the end of the current session. Complete commands with arguments are saved as a single line to be recalled and used or edited. Available when \fBrotctl\fP is built with Readline support (see READLINE below). .sp \fBN.B.\fP To write a history file in another directory, set the ROTCTL_HIST_DIR environment variable, e.g. 'ROTCTL_HIST_DIR=~/tmp rotctl -I'. When ROTCTL_HIST_DIR is not set, the value of HOME is used. .TP .B \-v, --verbose Set verbose mode, cumulative (see DIAGNOSTICS below). .TP .B \-h, --help Show summary of these options and exit. .TP .B \-V, \-\-version Show version of \fBrotctl\fP and exit. .PP \fBN.B.\fP Some options may not be implemented by a given backend and will return an error. This is most likely to occur with the \fI\-\-set-conf\fP and \fI\-\-show-conf\fP options. .PP Please note 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 \fBHamlib\fP error code. .SH COMMANDS Commands can be entered either as a single char, or as a long command name. Basically, the commands do not take a dash in front of them, as the options do. 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: .sp Rotator command: P 123 45 .PP Since most of the \fBHamlib\fP operations have a \fIset\fP and a \fIget\fP method, an upper case letter will be used for \fIset\fP method whereas the corresponding lower case letter refers to the \fIget\fP method. Each operation also has a long name; in interactive mode, prepend a backslash to enter a long command name. .sp Example: Use "\\get_info" to see the rotor's info. .PP Please note 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 \fBHamlib\fP error message. .PP As an alternative to the READLINE command history features a special command of a single dash ('-') may be used to read commands from standard input. 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. .sp 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 -m1 - (or send-cmd-term, see \fI-t\fP option) is appended automatically at the end of the command for text protocols. For binary protocols, enter values as \\0xAA\\0xBB .PP \fBLocator Commands\fP .PP These commands offer conversions of Degrees Minutes Seconds to other formats, Maidenhead square locator conversions and distance and azimuth conversions. .TP .B L, lonlat2loc 'Longitude' 'Latitude' 'Loc Len [2-12]' Returns the Maidenhead locator for the given 'Longitude' and 'Latitude'. .sp Both are floating point values. The precision of the returned square is controlled by 'Loc Len' which should be an even numbered integer value between 2 and 12. .sp For example, "L -170.000000 -85.000000 12" returns "Locator: AA55AA00AA00". .TP .B l, loc2lonlat 'Locator' Returns 'Longitude' and 'Latitude' in decimal degrees at the approximate center of the requested grid square (despite the use of double precision variables internally, some rounding error occurs). West longitude is expressed as a negative value. South latitude is expressed as a negative value. Locator can be from 2 to 12 characters in length. .sp For example, "l AA55AA00AA00" returns "Longitude: -169.999983 Latitude: -84.999991". .TP .B D, dms2dec 'Degrees' 'Minutes' 'Seconds' 'S/W' Returns 'Dec Degrees', a signed floating point value. .sp Degrees and Minutes are integer values and Seconds is a floating point value. S/W is a flag with '1' indicating South latitude or West longitude and '0' North or East (the flag is needed as computers don't recognize a signed zero even though only the Degrees value only is typically signed in DMS notation). .TP .B d, dec2dms 'Dec Degrees' Returns 'Degrees' 'Minutes' 'Seconds' 'S/W'. .sp Values are as in dms2dec above. .TP .B E, dmmm2dec 'Degrees' 'Dec Minutes' 'S/W' Returns 'Dec Degrees', a signed floating point value. .sp Degrees is an integer value and Minutes is a floating point value. S/W is a flag with '1' indicating South latitude or West longitude and '0' North or East (the flag is needed as computers don't recognize a signed zero even though only the Degrees value only is typically signed in DMS notation). .TP .B e, dec2dmmm 'Dec Deg' Returns 'Degrees' 'Minutes' 'S/W'. .sp Values are as in dmmm2dec above. .TP .B B, qrb 'Lon 1' 'Lat 1' 'Lon 2' 'Lat 2' Returns 'Distance' 'Azimuth' where Distance is in km and Azimuth is in degrees. .sp All Lon/Lat values are signed floating point numbers. .TP .B A, a_sp2a_lp 'Short Path Deg' Returns 'Long Path Deg' or -RIG_EINVAL upon input error.. .sp Both are floating point values within the range 0.00 to 360.00. .TP .B a, d_sp2d_lp 'Short Path km' Returns 'Long Path km'. .sp Both are floating point values. .TP .B pause 'Seconds' Pause for the given whole number of seconds before sending the next command. .SH EXAMPLES Start \fBrotctl\fP for RotorEZ using the first serial port on Linux: .sp $ rotctl -m 401 -r /dev/ttyS0 .sp Start \fBrotctl\fP for RotorEZ using COM2 on Win32: .sp $ rotctl -m 401 -r COM2 .sp Connect to a running \fBrotctld\fP with rotor model 2 ("NET rotctl") on the local host and specifying the TCP port, and querying the position: .sp $ rotctl -m 2 -r localhost:4533 \\get_pos .SH READLINE If Readline library development files are found at configure time, \fBrotctl\fP 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 (\fIhttp://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html\fP) although \fBrotctl\fP sets the name 'rotctl' which can be used in Conditional Init Constructs in the Readline Init File ('~/.inputrc' by default) for custom keybindings unique to \fBrotctl\fP. Command history is available with Readline support as described in the Readline History manual (\fIhttp://cnswww.cns.cwru.edu/php/chet/readline/history.html#SEC1\fP). 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 \fI-i/--read-history\fP or \fI-I/--save-history\fP options when starting \fBrotctl\fP 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 \fBrotctl\fP 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 '~/.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 \fBrotctl\fP commands entered on the command line regardless if Readline support is built in or not. \fBN.B.\fP Readline support is not included in the Windows 32 binary builds supplied by the Hamlib Project. Running \fBrotctl\fP on the Windows 32 platform in the 'cmd' shell does give session command line history, however, it is not saved to disk between sessions. .SH DIAGNOSTICS The \fB-v\fP, \fB--version\fP option allows different levels of diagnostics to be output to \fBstderr\fP and correspond to -v for BUG, -vv for ERR, -vvv for WARN, -vvvv for VERBOSE, or -vvvvv for TRACE. .PP 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 rotor which is very useful for rotor backend library development and may be requested by the developers. .SH EXIT STATUS \fBrotctl\fP exits with: .br 0 if all operations completed normally; .br 1 if there was an invalid command line option or argument; .br 2 if an error was returned by \fBHamlib\fP. .SH BUGS .PP This suspiciously empty section... .SH REPORTING BUGS Report bugs to . .PP We are already aware of the bug in the previous section :-) .SH AUTHOR Written by Stephane Fillod, Nate Bargmann, and the Hamlib Group .PP . .SH COPYRIGHT Copyright \(co 2000-2011 Stephane Fillod .br Copyright \(co 2011-2013 Nate Bargmann .br Copyright \(co 2000-2010 the Hamlib Group .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR hamlib (3), .BR rotctld (8)