ROTCTLD(8)

NAME
rotctld - Hamlib rotator control daemon

SYNOPSIS
rotctld [OPTION]...

DESCRIPTION
The rotctld program is an EXPERIMENTAL Hamlib rotator daemon that handles TCP client requests. This allows multiple user programs to share one rotator. Multiple rotators can be controlled on different TCP ports. The syntax of the commands are the same as rotctl. It is hoped that rotctld will be especially useful for languages such as Perl, Python, and others.

rotctld communicates to a client through a TCP socket using text commands shared with rotctl. The protocol is simple, commands are sent to rotctld on one line and rotctld responds to "get" commands with the requested values, one per line, when successful, otherwise, it responds with one line "RPTR x", where x is a negative number indicating the error code. Commands that do not return values respond with the line "RPTR x", where x is zero when successful, otherwise is a regative number indicating the error code. Each line is terminated with a newline '\n' character.

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. The API may change without publicized notice, while an advancement of the minor version (e.g. 1.1.x to 1.2.x) indicates such a change.

Please report bugs and provide feedback at the e-mail address given in the REPORTING BUGS section. Patches and code enhancements are also welcome.

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:

-m, --model=id
    Select rotator model number. See -l, "list" option below.

-r, --rot-file=device
    Use device as the file name of the port the rotator is connected. Often a serial port, but could be a USB to serial adapter. Typically /dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0, etc.

-s, --serial-speed=baud
    Set serial speed to baud rate. Uses maximum serial speed from rotor backend capabilities (set by -m above) as the default.

-L, --show-conf
    List all config parameters for the rotator defined with -m above.

-C, --set-conf=parm=val[,parm=val]*
    Set config parameter. e.g. --set-conf=stop_bits=2
    Use -L option for a list.

-e, --end-marker
    Use END marker in rotctld protocol.

-t, --port=number
    Use number as the TCP listening port. The default is 4533.

-T, --listen-addr=IPADDR
    Use IPADDR as the listening IP address. The default is ANY.

-l, --list
    List all model numbers defined in Hamlib and exit.

-v, --verbose
    Set verbose mode, cumulative (see DIAGNOSTICS below).

-h, --help
    Show a summary of these options and exit.

-V, --version
    Show the version of rotctld and exit.

N.B. 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. 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 Hamlib error code.

COMMANDS
Commands can be sent over the TCP socket either as a single char, or as a long command name plus the value(s) on one '\n' terminated line. See PROTOCOL.

Since most of the Hamlib operations have a set and a get method, an upper case letter will be used for set method whereas the corresponding lower case letter refers to the get method. Each operation also has a long name, prepend a backslash to send a long command name.

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 Hamlib error message.

Here is a summary of the supported commands:

P, set_pos
    Set position: azimuth and elevation.

p, get_pos
    Get position: azimuth and elevation.

K, park
    Park the antenna.

S, stop
    Stop the rotator.

R, reset
    Reset the rotator.

M, move
    Move the rotator in a specific direction.

_, get_info
    Get misc information about the rotator.

w, send_cmd
    Send raw command string to rotator.
    For binary protocols enter values as \0xAA\0xBB

PROTOCOL
The rotctld protocol is intentionally simple. Commands are entered on a single line with any needed values. In Perl, reliable results are obtained by terminating each command string with a newline character, '\n'.

Example set (Perl code): print $socket "P 135 10\n";
print $socket "\\set_pos 135 10\n"; # escape leading '\'

Responses from rotctld are text values and match the same tokens used in the set commands. Each value is returned on its own line. To signal the end of a response the "END\n" string is sent when the '-e' option is passed.

Example get (Perl code): print $socket "p\n"; "135"
"10"
"END"

Most get functions return one to three values. Future work will focus on making this output compatible with assignment to a hash, dictionary, or other key:value variable.

DIAGNOSTICS
The -v, --version 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 rotator which is very useful for rotator backend library development and may be requested by the developers.

SECURITY
No authentication whatsoever; DO NOT leave this TCP port open wide to the Internet. Please ask if stronger security is needed.

BUGS
The daemon is not detaching and backgrounding itself. Much testing needs to be done.

REPORTING BUGS
Report bugs to <hamlib-developer@lists.sourceforge.net>.
We are already aware of the bugs in the previous section :-)

AUTHORS
Written by Stephane Fillod and the Hamlib Group
<http://www.hamlib.org>.

COPYRIGHT
Copyright © 2000-2009 Stephane Fillod and the Hamlib Group.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO
rotctl(1), hamlib(3)