ROTCTL(1)
π ROTCTL β control antenna rotators π
okay so this is the rotctl page from the Hamlib Utilities manual, section 1, and bestie it's literally your new favorite command. let's get into it π¦
β¨ NAME β¨
rotctl β control antenna rotators π
πΈ SYNOPSIS πΈ
rotctl [-hiIlLuV] [-m id] [-r device] [-R device2] [-s baud] [-t char]
[-C parm=val] [-o azoffset] [-O eloffset] [-v[-Z]] [command|-]
π DESCRIPTION π
Control antenna rotators. that's the whole vibe. π
rotctl accepts commands from the command line as well as in interactive mode if none are provided on the command line. so like, you can hand it a task directly, or you can just open it up and chat with it. both are valid. both are iconic. π
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. so like, she's still growing into herself, yk? but she's doing great fr fr.
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. like genuinely, they want your contributions, come through π«Ά
π OPTIONS π
this program follows the usual GNU command line syntax, no cap. 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. that's the rule, periodt.
here's a summary of the supported options, bestie β every single one, don't skip π
-m,--model=idβ select rotator model number. see model list (userotctl -l). β¨ note:rotctl(or third party software using the C API) will use rotator model2for NET rotctl (communicating withrotctld). iykyk.-r,--rot-file=deviceβ use device as the file name of the port connected to the rotator. it's often a serial port, but could be a USB to serial adapter. typically/dev/ttyS0,/dev/ttyS1,/dev/ttyUSB0, etc. on Linux,COM1,COM2, etc. on MS Windows. the BSD flavors and Mac OS/X have their own designations. see your system's documentation. π-R,--rot-file2=deviceβ use device as the file name of the port connected to the 2nd rotator, e.g. 2nd rotator used for elevation. second rotator, second vibe. still often a serial port, but could be a USB to serial adapter. typically/dev/ttyS0,/dev/ttyS1,/dev/ttyUSB0, etc. on Linux,COM1,COM2, etc. on MS Windows. the BSD flavors and Mac OS/X have their own designations. see your system's documentation. πΈ-s,--serial-speed=baudβ set serial speed to baud rate. it uses the maximum serial speed from rotator backend capabilities as the default. π₯-t,--send-cmd-term=charβ change the termination char for text protocol when using thesend_cmdcommand. the default value is ASCII CR (β0x0Dβ). ASCII non-printing characters can be given as the ASCII number in hexadecimal format prepended with β0xβ. you may pass an empty string for no termination char. the string-1tellsrotctlto switch to binary protocol. see thesend_cmdcommand for further explanation. β¨ note: the semicolon (β;β) is a common terminator for rotators that accept ASCII character strings. π-o,--set-azoffsetβ azimuth correction floating point β during set, value is added; during get, value is subtracted. math but make it cute. π§-O,--set-eloffsetβ elevation correction floating point β during set, value is added; during get, value is subtracted. same energy, different axis. π«-L,--show-confβ list all configuration parameters for the rotator defined with-mabove. peek behind the curtain bestie π-C,--set-conf=parm=val[,parm=val]β set rotator configuration parameter(s), e.g.stop_bits=2. use the-Loption above for a list of configuration parameters for a given model number. π-u,--dump-capsβ dump capabilities for the rotator defined with-mabove and exit. bye bestie, here's everything she can do π-l,--listβ list all rotator model numbers defined in Hamlib and exit. the list is sorted by model number. β¨ note: 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 tomore(1)orless(1), e.g.rotctl -l | more. π-i,--read-historyβ read previously saved command and argument history from a file (default$HOME/.rotctl_history) for the current session. available whenrotctlis built with Readline support (see READLINE below). β¨ note: to read a history file stored in another directory, set theROTCTL_HIST_DIRenvironment variable, e.g.ROTCTL_HIST_DIR=$HOME/tmp rotctl -i. whenROTCTL_HIST_DIRis not set, the value ofHOMEis used. π°οΈ-I,--save-historyβ write current session (and any previous session(s), if-ioption is also given) command and argument history to a file (default$HOME/.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 whenrotctlis built with Readline support (see READLINE below). β¨ note: to write a history file in another directory, set theROTCTL_HIST_DIRenvironment variable, e.g.ROTCTL_HIST_DIR=$HOME/tmp rotctl -I. whenROTCTL_HIST_DIRis not set, the value ofHOMEis used. πΎ-v,--verboseβ set verbose mode, cumulative (see DIAGNOSTICS below). she's a talker. π-Z,--debug-time-stampsβ enable time stamps for the debug messages. use only in combination with the-voption as it generates no output on its own. β°-h,--helpβ show a summary of these options and exit. the classic. π«Ά-V,--versionβ show version ofrotctland exit. π·οΈ-β stop option processing and read commands from standard input. see Standard Input below. β
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-confand--show-confoptions. not every rotator got the range, bestie π
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. it's giving unsupported, and that's just how it is π
π¬ COMMANDS π¬
okay so here's the tea: you can type a command as a single char or as its long name, dealer's choice bestie. Commands do not get a dash in front like the options do β that's an options thing, not a commands thing, don't mix them up π.
You can type them when you're in interactive mode, or just hand them over as argument(s) in command line interface mode. And in interactive mode? Commands and their arguments can all go on one single line, like:
P 123 45
Now, the pattern that makes everything click: most Hamlib operations have a set and a get method, so UPPERCASE letters usually mean set and the matching lowercase letter means get. Every operation has a long name too β when you're in interactive mode, slap a backslash \ in front to use the long one.
Example: type \get_info in interactive mode and boom, you see the rotator's info β¨
Heads up: the backend for the rotator you're controlling (or the rotator itself) might just not support some commands. No shade, that's just how it is. When that happens the operation fails with a Hamlib error message π.
π₯ Standard Input π₯
So instead of the READLINE interactive entry thing, or one single command per run, rotctl has a special little trick: pass a single dash - and it'll read commands from standard input (stdin) π«Ά.
Commands gotta be separated by whitespace, same vibe as the commands you'd give on the command line. And you can drop comments in with the # character β everything from the # to the end of that line, # included, gets ignored entirely. So freeing.
A lil example for you:
$ 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
$
π‘ Rotator Commands π‘
Here's the whole summary of commands (bestie, quick note on reading this: for set commands the quoted italicized string gets replaced by the value in the description, and for get commands that quoted italicized string is the key name of the value that comes back π):
Q|q,exit rotctlβ bail out ofrotctlin interactive mode. Whenrotctlis driving the rotator directly, it'll close the rotator backend and the port. But whenrotctlis connected torotctld(that's rotator model 2), it just closes the TCP/IP connection torotctldβ androtctldkeeps on living, ready for another TCP/IP network connection π.P,set_pos 'Azimuth' 'Elevation'β set the position.'Azimuth'and'Elevation'are floating point values. Azimuth can be -180 to 540 depending on the rotator (this is so rotators facing south work, and it depends on what your rotator can actually do). Elevation can be -20 to 210, again depending on the rotator. For example:
P 163.0 41.0
Note: if your rotator doesn't support setting elevation (most don't, rip), just supplyβ0.0βfor'Elevation'π .
p,get_posβ get the position.'Azimuth'and'Elevation'come back as double precision floating point values.M,move 'Direction' 'Speed'β move the rotator in a specific direction at a given rate, go bestie go π₯.'Direction'is an integer or keyword, defined as:β2β= UP,β4β= DOWN,β8β= LEFT or CCW,β16β= RIGHT or CW,β32β= UP_LEFT or UP_CCW,βR64β= UP_RIGHT = UP_CW,β128β= DOWN_LEFT or DOWN_CCW,β256β= DOWN_RIGHT or DOWN_CW. And'Speed'is an integer between 1 and 100 β use-1if you want no change to the current speed.
Note: not every backend that implements the move command even uses the Speed value. iykyk π
S,stopβ stop the rotator. Simple. Iconic.K,parkβ park the rotator.C,set_conf 'Token' 'Value'β set a configuration parameter.'Token'is a string β go peep the-Coption and the-Loutput for those.'Value'is a string of up to 20 characters.R,reset 'Reset'β reset the rotator.'Reset'takes an integer value ofβ1βfor βReset Allβ._,get_infoβ get miscellaneous info about the rotator. Returns'Info'βModel Nameβat the moment.dump_stateβ returns certain state information about the rotator backend.1,dump_capsβ not a real rot remote command, it just dumps capabilities, meaning what the backend knows about this model and what it can do. Kind of a vibes report π.w,send_cmd 'Cmd'β send a raw command string to the rotator. An ASCII CR (or whatever the--send-cmd-termvalue is, see the-toption) gets appended automatically at the end of the command for text protocols. For binary protocols, enter hexadecimal values likeβ\0xAA\0xBBβ.
πΊοΈ Locator Commands πΊοΈ
These commands are all about conversions: Degrees Minutes Seconds to other formats, Maidenhead square locator conversions, and distance + azimuth conversions. Math but make it cute πΈ.
L,lonlat2loc 'Longitude' 'Latitude' 'Loc Len'β returns the Maidenhead'Locator'for the given'Longitude'and'Latitude'. You supply floating point values. The precision of the square you get back is controlled by'Loc Len', which should be an even numbered integer value between 2 and 12. Like so:
L -170.0 -85.0 12
which returns:
Locator: AA55AA00AA00
l,loc2lonlat 'Locator'β returns'Longitude'and'Latitude'in decimal degrees, at the approximate center of the Maidenhead grid square you asked for.'Locator'can be from 2 to 12 characters in length. West longitude comes back as a negative value, south latitude comes back as a negative value. For example:
l AA55AA00AA00
returns:
Longitude: -169.999983 Latitude: -84.999991
Note: even though it's using double precision variables internally, some rounding error is gonna happen. Lowkey unavoidable π.
D,dms2dec 'Degrees' 'Minutes' 'Seconds' 'S/W'β returns'Dec Degrees', a signed floating point value.'Degrees'and'Minutes'are integer values.'Seconds'is a floating point value.'S/W'is a flag:β1βmeans South latitude or West longitude,β0βmeans North or East. Why do we need the flag? Because computers don't recognize a signed zero, even though in DMS notation it's typically only the'Degrees'value that's signed. Computers stay doing the most π.d,dec2dms 'Dec Degrees'β returns'Degrees''Minutes''Seconds''S/W'. Values work the same as indms2decabove.E,dmmm2dec 'Degrees' 'Dec Minutes' 'S/W'β returns'Dec Degrees', a signed floating point value.'Degrees'is an integer value.'Dec Minutes'is a floating point value.'S/W'is a flag, same as indms2decabove.e,dec2dmmm 'Dec Deg'β returns'Degrees''Minutes''S/W'. Values are as indmmm2decabove.B,qrb 'Lon 1' 'Lat 1' 'Lon 2' 'Lat 2'β returns'Distance'and'Azimuth'.'Distance'is in km.'Azimuth'is in degrees. The Lon/Lat values you supply are signed floating point numbers.A,a_sp2a_lp 'Short Path Deg'β returns'Long Path Deg'. Both the argument you supply and the value that comes back are floating point values within the range of 0.00 to 360.00.
Note: supplying a negative value will return an error message. So don't π.
a,d_sp2d_lp 'Short Path km'β returns'Long Path km'. Both the argument you supply and the value that comes back are floating point values.pause 'Seconds'β pause for the given whole (integer) number of'Seconds'before sending the next command to the rotator. Chill for a sec bestie π§.
β¨οΈ READLINE β¨οΈ
If the Readline library development files are found at configure time, rotctl will be conditionally built with Readline support for command and argument entry. Slay. Readline command key bindings are at their defaults, exactly as described in the Readline manual. rotctl sets the name βrotctlβ, which you can use in Conditional Init Constructs in the Readline Init File ($HOME/.inputrc by default) to get custom keybindings that are unique to rotctl β¨.
Command history is available with Readline support, as described in the Readline History manual. Command and argument strings get stored as single lines even when arguments are prompted for input one at a time. And ngl, commands and arguments are not validated β they're stored exactly as typed, with values separated by a single space.
Normally session history is not saved, but if you use either the -i/--read-history or -I/--save-history options when starting rotctl, that'll cause any previously saved history to be read in, and/or the current plus any previous session history to be written out when rotctl closes (assuming you gave -i and -I together). Each option is mutually exclusive, meaning either one may be given separately or in combination. This is lowkey so useful for saving a set of commands and reading them later β but not writing the modified history β so you get a consistent set of test commands in interactive mode, for example π.
History is stored in $HOME/.rotctl_history by default, though you can change the destination directory by setting the ROTCTL_HIST_DIR environment variable. When ROTCTL_HIST_DIR is unset, the value of the HOME environment variable is used instead. At this time, only the destination directory can be changed. That's it, that's the whole deal π.
If Readline support is not found at configure time, the original internal command handler is used instead. And heads up: Readline is not used for rotctl commands entered on the command line, regardless of whether 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. Runningrotctlon the MS Windows platform in theβcmdβshell does give you session command line history, but it is not saved to disk between sessions. Sorry babes π.
π©Ί DIAGNOSTICS π©Ί
The -v, --verbose option lets different levels of diagnostics go out to stderr, and they line up like this: -v for BUG, -vv for ERR, -vvv for WARN, -vvvv for VERBOSE, or -vvvvv for TRACE. Very demure, very escalating π.
A given verbose level is useful for giving the developers the debugging information they need at the email address below. For example, TRACE output shows all of the values sent to and received from the radio, which is extremely useful for radio backend library development β and it may be requested by the developers. So if they ask, you deliver π .
πͺ EXIT STATUS πͺ
rotctl exits with:
0β if all operations completed normally;1β if there was an invalid command line option or argument;2β if an error was returned by Hamlib.
β¨ EXAMPLES β¨
okay bestie, let's actually do the thing π here's how you spin this up for real:
Kick off 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, specifying the TCP port, and querying the position:
$ rotctl -m 2 -r localhost:4533 t_pos
Start rotctl for INDI using an address other than the default localhost:5764:
$ rotctl -m 2001 -r example.com:12345
Start rotctl for INDI using the local domain on Linux:
$ rotctl -m 2001 -r @/tmp/indiserver
INDI (Instrument Neutral Distributed Interface) is an LGPLv2 software to control astronomical equipment, including telescope mounts that can be used to rotate antennas. π°οΈβ¨
For more information see indilib.org π
π BUGS π
Found something cursed? Report bugs to:
- Hamlib Developer mailing list
(no cap, they wanna hear about it π)
π COPYING π
This file is part of Hamlib, a project to develop a library that simplifies radio, rotator, and amplifier 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-2020 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. π«Ά
π SEE ALSO π
π COLOPHON π
Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot archives are available via hamlib.org. π¦
and that's the whole page, bestie β this one's from the Hamlib era, dated 2025-09-01, and it lives at ROTCTL(1). now go point some antennas at the sky, you absolute icon ππ‘π
π¦ where this page comes from
- alpine 3.24: hamlib-doc 4.7.1-r0 Β· LGPL-2.0-or-later
- arch rolling: hamlib 4.7.2-2 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- nixos 26.05: hamlib 4.7.2
- nixpkgs unstable: hamlib 4.7.2
- opensuse-leap 16.0: hamlib 4.7.2-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: hamlib 4.7.2-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: hamlib 4.7.2-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: hamlib 4.7.2-bp160.1.1 Β· LGPL-2.1-only
- ubuntu stonking: libhamlib-utils 4.7.2-2 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms