1ROTCTL(1) Hamlib Utilities ROTCTL(1)
2
3
4
6 rotctl - control antenna rotators
7
9 rotctl [-hiIlLuV] [-m id] [-r device] [-s baud] [-t char] [-C parm=val]
10 [-v[-Z]] [command|-]
11
13 Control antenna rotators.
14
15 rotctl accepts commands from the command line as well as in interactive
16 mode if none are provided on the command line.
17
18 Keep in mind that Hamlib is BETA level software. While a lot of back‐
19 end libraries lack complete rotator support, the basic functions are
20 usually well supported.
21
22 Please report bugs and provide feedback at the e-mail address given in
23 the BUGS section below. Patches and code enhancements sent to the same
24 address are welcome.
25
27 This program follows the usual GNU command line syntax. Short options
28 that take an argument may have the value follow immediately or be sepa‐
29 rated by a space. Long options starting with two dashes (‘-’) require
30 an ‘=’ between the option and any argument.
31
32 Here is a summary of the supported options:
33
34 -m, --model=id
35 Select rotator model number.
36
37 See model list (use “rotctl -l”).
38
39 Note: rotctl (or third party software using the C API) will use
40 rotator model 2 for NET rotctl (communicating with rotctld).
41
42 -r, --rot-file=device
43 Use device as the file name of the port connected to the rota‐
44 tor.
45
46 Often a serial port, but could be a USB to serial adapter. Typ‐
47 ically /dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0, etc. on Linux,
48 COM1, COM2, etc. on MS Windows. The BSD flavors and Mac OS/X
49 have their own designations. See your system's documentation.
50
51 -s, --serial-speed=baud
52 Set serial speed to baud rate.
53
54 Uses maximum serial speed from rotator backend capabilities as
55 the default.
56
57 -t, --send-cmd-term=char
58 Change the termination char for text protocol when using the
59 send_cmd command.
60
61 The default value is ASCII CR (‘0x0D’). ASCII non-printing
62 characters can be given as the ASCII number in hexadecimal for‐
63 mat prepended with “0x”. You may pass an empty string for no
64 termination char. The string “-1” tells rotctl to switch to
65 binary protocol. See the send_cmd command for further explana‐
66 tion.
67
68 Note: The semicolon (‘;’) is a common terminator for rotators
69 that accept ASCII character strings.
70
71 -L, --show-conf
72 List all configuration parameters for the rotator defined with
73 -m above.
74
75 -C, --set-conf=parm=val[,parm=val]
76 Set rotator configuration parameter(s), e.g. stop_bits=2.
77
78 Use the -L option above for a list of configuration parameters
79 for a given model number.
80
81 -u, --dump-caps
82 Dump capabilities for the rotator defined with -m above and
83 exit.
84
85 -l, --list
86 List all rotator model numbers defined in Hamlib and exit.
87
88 The list is sorted by model number.
89
90 Note: In Linux the list can be scrolled back using Shift-
91 PageUp/Shift-PageDown, or using the scrollbars of a virtual ter‐
92 minal in X or the cmd window in Windows. The output can be
93 piped to more(1) or less(1), e.g. “rotctl -l | more”.
94
95 -i, --read-history
96 Read previously saved command and argument history from a file
97 (default $HOME/.rotctl_history) for the current session.
98
99 Available when rotctl is built with Readline support (see READ‐
100 LINE below).
101
102 Note: To read a history file stored in another directory, set
103 the ROTCTL_HIST_DIR environment variable, e.g.
104 “ROTCTL_HIST_DIR=$HOME/tmp rotctl -i”. When ROTCTL_HIST_DIR is
105 not set, the value of HOME is used.
106
107 -I, --save-history
108 Write current session (and any previous session(s), if -i option
109 is also given) command and argument history to a file (default
110 $HOME/.rotctl_history) at the end of the current session.
111
112 Complete commands with arguments are saved as a single line to
113 be recalled and used or edited. Available when rotctl is built
114 with Readline support (see READLINE below).
115
116 Note: To write a history file in another directory, set the
117 ROTCTL_HIST_DIR environment variable, e.g.
118 “ROTCTL_HIST_DIR=$HOME/tmp rotctl -I”. When ROTCTL_HIST_DIR is
119 not set, the value of HOME is used.
120
121 -v, --verbose
122 Set verbose mode, cumulative (see DIAGNOSTICS below).
123
124 -Z, --debug-time-stamps
125 Enable time stamps for the debug messages.
126
127 Use only in combination with the -v option as it generates no
128 output on its own.
129
130 -h, --help
131 Show a summary of these options and exit.
132
133 -V, --version
134 Show version of rotctl and exit.
135
136 - Stop option processing and read commands from standard input.
137
138 See Standard Input below.
139
140 Note: Some options may not be implemented by a given backend and will
141 return an error. This is most likely to occur with the --set-conf and
142 --show-conf options.
143
144 Be aware that the backend for the rotator to be controlled, or the
145 rotator itself may not support some commands. In that case, the opera‐
146 tion will fail with a Hamlib error code.
147
149 Commands can be entered either as a single char, or as a long command
150 name. The commands are not prefixed with a dash as the options are.
151 They may be typed in when in interactive mode or provided as argu‐
152 ment(s) in command line interface mode. In interactive mode commands
153 and their arguments may be entered on a single line (typed text shown
154 in bold):
155
156 P 123 45
157
158 Since most of the Hamlib operations have a set and a get method, an
159 upper case letter will often be used for a set method whereas the cor‐
160 responding lower case letter refers to the get method. Each operation
161 also has a long name; in interactive mode, prepend a backslash, ‘\’, to
162 enter a long command name.
163
164 Example: Use “\get_info” in interactive mode to see the rotator's
165 information.
166
167 Note: The backend for the rotator to be controlled, or the rota‐
168 tor itself may not support some commands. In that case, the
169 operation will fail with a Hamlib error message.
170
171 Standard Input
172 As an alternative to the READLINE interactive command entry or a single
173 command for each run, rotctl features a special option where a single
174 dash (‘-’) may be used to read commands from standard input (stdin).
175 Commands must be separated by whitespace similar to the commands given
176 on the command line. Comments may be added using the ‘#’ character,
177 all text up until the end of the current line including the ‘#’ charac‐
178 ter is ignored.
179
180 A simple example:
181
182 $ cat <<.EOF. >cmds.txt
183 > # File of commands
184 > set_pos 180.0 10.0 # rotate
185 > pause 30 # wait for action to complete
186 > get_pos # query rotator
187 >.EOF.
188
189 $ rotctl -m 1 - <cmds.txt
190
191 set_pos 180.0 10.0
192 pause 30
193 get_pos 180.000000
194 10.000000
195
196 $
197
198 Rotator Commands
199 A summary of commands is included below (In the case of set commands
200 the quoted italicized string is replaced by the value in the descrip‐
201 tion. In the case of get commands the quoted italicized string is the
202 key name of the value returned.):
203
204 Q|q, exit rotctl
205 Exit rotctl in interactive mode.
206
207 When rotctl is controlling the rotator directly, will close the
208 rotator backend and port. When rotctl is connected to rotctld
209 (rotator model 2), the TCP/IP connection to rotctld is closed
210 and rotctld remains running, available for another TCP/IP net‐
211 work connection.
212
213 P, set_pos 'Azimuth' 'Elevation'
214 Set position.
215
216 'Azimuth' and 'Elevation' are floating point values.
217
218 Azimuth can be -180 to 540 depending on the rotator to allow for
219 rotators facing south and the capabilities of the rotator.
220
221 Elevation can be -20 to 210 depending on the rotator.
222
223 For example:
224
225 P 163.0 41.0
226
227 Note: If the rotator does not support setting elevation (most do
228 not) supply “0.0” for 'Elevation'.
229
230 p, get_pos
231 Get position.
232
233 'Azimuth' and 'Elevation' are returned as double precision
234 floating point values.
235
236 M, move 'Direction' 'Speed'
237 Move the rotator in a specific direction at the given rate.
238
239 'Direction' is an integer or keyword defined as ‘2’ = UP, ‘4’ =
240 DOWN, ‘8’ = LEFT or CCW and ‘16’ = RIGHT or CW
241
242 'Speed' is an integer between 1 and 100. Use -1 for no change to
243 current speed.
244
245 Note: Not all backends that implement the move command use the
246 Speed value.
247
248 S, stop
249 Stop the rotator.
250
251 K, park
252 Park the rotator.
253
254 C, set_conf 'Token' 'Value'
255 Set a configuration parameter.
256
257 'Token' is a string; see the -C option and the -L output.
258
259 'Value' is a string of up to 20 characters.
260
261 R, reset 'Reset'
262 Reset the rotator.
263
264 'Reset' accepts an integer value of ‘1’ for “Reset All”.
265
266 _, get_info
267 Get miscellaneous information about the rotator.
268
269 Returns 'Info' “Model Name” at present.
270
271 dump_state
272 Return certain state information about the rotator backend.
273
274 1, dump_caps
275 Not a real rot remote command, it just dumps capabilities, i.e.
276 what the backend knows about this model, and what it can do.
277
278 w, send_cmd 'Cmd'
279 Send a raw command string to the rotator.
280
281 ASCII CR (or --send-cmd-term value, see -t option) is appended
282 automatically at the end of the command for text protocols. For
283 binary protocols, enter hexadecimal values as “\0xAA\0xBB”.
284
285 Locator Commands
286 These commands offer conversions of Degrees Minutes Seconds to other
287 formats, Maidenhead square locator conversions and distance and azimuth
288 conversions.
289
290 L, lonlat2loc 'Longitude' 'Latitude' 'Loc Len'
291 Returns the Maidenhead 'Locator' for the given 'Longitude' and
292 'Latitude'.
293
294 Floating point values are supplied. The precision of the
295 returned square is controlled by 'Loc Len' which should be an
296 even numbered integer value between 2 and 12.
297
298 For example:
299
300 L -170.0 -85.0 12
301
302 returns:
303
304 Locator: AA55AA00AA00
305
306 l, loc2lonlat 'Locator'
307 Returns 'Longitude' and 'Latitude' in decimal degrees at the
308 approximate center of the requested Maidenhead grid square.
309
310 'Locator' can be from 2 to 12 characters in length.
311
312 West longitude is expressed as a negative value.
313
314 South latitude is expressed as a negative value.
315
316 For example:
317
318 l AA55AA00AA00
319
320 returns:
321
322 Longitude: -169.999983 Latitude: -84.999991
323
324 Note: Despite the use of double precision variables internally,
325 some rounding error occurs.
326
327 D, dms2dec 'Degrees' 'Minutes' 'Seconds' 'S/W'
328 Returns 'Dec Degrees', a signed floating point value.
329
330 'Degrees' and 'Minutes' are integer values.
331
332 'Seconds' is a floating point value.
333
334 'S/W' is a flag with ‘1’ indicating South latitude or West lon‐
335 gitude and ‘0’ North or East (the flag is needed as computers
336 don't recognize a signed zero even though only the 'Degrees'
337 value is typically signed in DMS notation).
338
339 d, dec2dms 'Dec Degrees'
340 Returns 'Degrees' 'Minutes' 'Seconds' 'S/W'.
341
342 Values are as in dms2dec above.
343
344 E, dmmm2dec 'Degrees' 'Dec Minutes' 'S/W'
345 Returns 'Dec Degrees', a signed floating point value.
346
347 'Degrees' is an integer value.
348
349 'Dec Minutes' is a floating point value.
350
351 'S/W' is a flag as in dms2dec above.
352
353 e, dec2dmmm 'Dec Deg'
354 Returns 'Degrees' 'Minutes' 'S/W'.
355
356 Values are as in dmmm2dec above.
357
358 B, qrb 'Lon 1' 'Lat 1' 'Lon 2' 'Lat 2'
359 Returns 'Distance' and 'Azimuth'.
360
361 'Distance' is in km.
362
363 'Azimuth' is in degrees.
364
365 Supplied Lon/Lat values are signed floating point numbers.
366
367 A, a_sp2a_lp 'Short Path Deg'
368 Returns 'Long Path Deg'.
369
370 Both the supplied argument and returned value are floating point
371 values within the range of 0.00 to 360.00.
372
373 Note: Supplying a negative value will return an error message.
374
375 a, d_sp2d_lp 'Short Path km'
376 Returns 'Long Path km'.
377
378 Both the supplied argument and returned value are floating point
379 values.
380
381 pause 'Seconds'
382 Pause for the given whole (integer) number of 'Seconds' before
383 sending the next command to the rotator.
384
386 If Readline library development files are found at configure time,
387 rotctl will be conditonally built with Readline support for command and
388 argument entry. Readline command key bindings are at their defaults as
389 described in the Readline manual
390 ⟨https://tiswww.cwru.edu/php/chet/readline/rluserman.html⟩. rotctl
391 sets the name “rotctl” which can be used in Conditional Init Constructs
392 in the Readline Init File ($HOME/.inputrc by default) for custom key‐
393 bindings unique to rotctl.
394
395 Command history is available with Readline support as described in the
396 Readline History manual
397 ⟨https://tiswww.case.edu/php/chet/readline/history.html#SEC1⟩. Command
398 and argument strings are stored as single lines even when arguments are
399 prompted for input individually. Commands and arguments are not vali‐
400 dated and are stored as typed with values separated by a single space.
401
402 Normally session history is not saved, however, use of either of the
403 -i/--read-history or -I/--save-history options when starting rotctl
404 will cause any previously saved history to be read in and/or the cur‐
405 rent and any previous session history (assuming the -i and -I options
406 are given together) will be written out when rotctl is closed. Each
407 option is mutually exclusive, i.e. either may be given separately or in
408 combination. This is useful to save a set of commands and then read
409 them later but not write the modified history for a consistent set of
410 test commands in interactive mode, for example.
411
412 History is stored in $HOME/.rotctl_history by default although the des‐
413 tination directory may be changed by setting the ROTCTL_HIST_DIR envi‐
414 ronment variable. When ROTCTL_HIST_DIR is unset, the value of the HOME
415 environment variable is used instead. Only the destination directory
416 may be changed at this time.
417
418 If Readline support is not found at configure time the original inter‐
419 nal command handler is used. Readline is not used for rotctl commands
420 entered on the command line regardless if Readline support is built in
421 or not.
422
423 Note: Readline support is not included in the MS Windows 32 or 64 bit
424 binary builds supplied by the Hamlib Project. Running rotctl on the MS
425 Windows platform in the ‘cmd’ shell does give session command line his‐
426 tory, however, it is not saved to disk between sessions.
427
429 The -v, --verbose option allows different levels of diagnostics to be
430 output to stderr and correspond to -v for BUG, -vv for ERR, -vvv for
431 WARN, -vvvv for VERBOSE, or -vvvvv for TRACE.
432
433 A given verbose level is useful for providing needed debugging informa‐
434 tion to the email address below. For example, TRACE output shows all
435 of the values sent to and received from the radio which is very useful
436 for radio backend library development and may be requested by the
437 developers.
438
440 rotctl exits with:
441
442 0 if all operations completed normally;
443
444 1 if there was an invalid command line option or argument;
445
446 2 if an error was returned by Hamlib.
447
449 Start rotctl for RotorEZ using the first serial port on Linux:
450
451 $ rotctl -m 401 -r /dev/ttyS0
452
453 Start rotctl for RotorEZ using COM2 on MS Windows:
454
455 > rotctl -m 401 -r COM2
456
457 Connect to a running rotctld with rotator model 2 (“NET rotctl”) on the
458 local host and specifying the TCP port, and querying the position:
459
460 $ rotctl -m 2 -r localhost:4533 t_pos
461
463 Report bugs to:
464
465 Hamlib Developer mailing list
466 ⟨hamlib-developer@lists.sourceforge.net⟩
467
469 This file is part of Hamlib, a project to develop a library that sim‐
470 plifies radio, rotator, and amplifier control functions for developers
471 of software primarily of interest to radio amateurs and those inter‐
472 ested in radio communications.
473
474 Copyright © 2001-2011 Stephane Fillod
475 Copyright © 2002-2017 the Hamlib Group (various contributors)
476 Copyright © 2003-2020 Nate Bargmann
477
478 This is free software; see the file COPYING for copying conditions.
479 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
480 PARTICULAR PURPOSE.
481
483 less(1), more(1), rotctld(1), hamlib(7)
484
486 Links to the Hamlib Wiki, Git repository, release archives, and daily
487 snapshot archives are available via hamlib.org ⟨http://www.hamlib.org⟩.
488
489
490
491Hamlib 2020-09-09 ROTCTL(1)