ROTCTLD(8) Rotator Control Daemon ROTCTLD(8)

Similar documents
ROTCTL(1) Rotator Control Program ROTCTL(1)

Continue reading command lines even after an execution error has caused the abandonment of aline.

Computer Data Logging Formats

FSASIM: A Simulator for Finite-State Automata

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Part III Appendices 165

Review of Fundamentals

finger-user-enum User Documentation

HexAtom User Guide. Student 1

More Scripting Todd Kelley CST8207 Todd Kelley 1

SPID Elektronik. Driver MD-02 MD-02

Output with printf Input. from a file from a command arguments from the command read

AxiCat Server. v User Manual

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program

Fundamentals of Programming Session 4

DCLI User's Guide. Data Center Command-Line Interface

File Commands. Objectives

DCLI User's Guide. Data Center Command-Line Interface 2.9.1

Task 2: TCP Communication

FM300 Network Server

McGill University School of Computer Science Sable Research Group. *J Installation. Bruno Dufour. July 5, w w w. s a b l e. m c g i l l.

K2289: Using advanced tcpdump filters

ArcaTrade Specification for Bonds

fuser - Linux Command

JANUS EXPLORER. Janus Explorer Version 1.4 Quick Guide

Project #2: A 3-Tiered Airport Lookup Service Using RPC

TABLE OF CONTENTS 2 CHAPTER 1 3 CHAPTER 2 4 CHAPTER 3 5 CHAPTER 4. Algorithm Design & Problem Solving. Data Representation.

Advanced option settings on the command line. Set the interface and ports for the OpenVPN daemons

RF HAMDESIGN. Driver MD-01 MD-01

Python Class-Lesson1 Instructor: Yao

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

DCLI User's Guide. Modified on 20 SEP 2018 Data Center Command-Line Interface

Geographic Information System

grib_api.h File Reference

HP-35s Calculator Program Closure 7A

VISUDO(8) System Manager s Manual VISUDO(8)

LCE Splunk Client 4.6 User Manual. Last Revised: March 27, 2018

Introduction to Computer Programming CSCI-UA 2. Review Midterm Exam 1

Integrated Lights-Out 3 Virtual Serial Port configuration and operation

Corporation. Once the required parameters have been entered, mouse click Generate KML File and the Path LOS buttons.

Using kgdb and the kgdb Internals

Chapter 14: Controlled Remote Tug Telemetry

PYTHON. Values and Variables

Satmaster QuickAim User Guide Mk4.x

Aaronia GPS Logger Programming Guide

Topic 2: More Shell Skills. Sub-Topic 1: Quoting. Sub-Topic 2: Shell Variables. Difference Between Single & Double Quotes

Geographic Information System version 1.0

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

This is Your Software Security Access Key: DO NOT LOSE IT!

9.2 Linux Essentials Exam Objectives

GNU CPIO September by Robert Carleton and Sergey Poznyakoff

TSI Server Configuration Mode Commands

Mastering Linux. Paul S. Wang. CRC Press. Taylor & Francis Group. Taylor & Francis Croup an informa business. A CHAPMAN St HALL BOOK

27-Sep CSCI 2132 Software Development Lecture 10: Formatted Input and Output. Faculty of Computer Science, Dalhousie University. Lecture 10 p.

VISUDO(8) System Manager s Manual VISUDO(8)

Configuring the Router ASCII Interface

rsh-grind User Documentation

Mercantile Documentation

Such JavaScript Very Wow

3.1 Units. Angle Unit. Direction Reference

Textbook. Topic 8: Files and Exceptions. Files. Types of Files

Introduction to Python Programming

Topic 2: More Shell Skills

Configuring the ASCII Interface

Distance in mm from nearest latitude line to location x 150 = seconds of latitude Distance in mm between latitude 2.5 tick marks (along the sides)

Configuring the CSS as a Client of a TACACS+ Server

AntiLogReader Command Line Application User Guide

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

Tandem-Systems, Ltd. Rhino Terminal. User s Manual

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Keepalive Configuration Mode Commands

bash Args, Signals, Functions Administrative Shell Scripting COMP2101 Fall 2017

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Obsoletes: 931 February 1993

GIS 4653/5653: Spatial Programming and GIS. More Python: Statements, Types, Functions, Modules, Classes

Simulavr. A simulator for the Atmel AVR family of microcontrollers. For simulavr version , 18 January by Theodore A.

gdbtui - Linux Command

sottotitolo A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi

Computer Components. Software{ User Programs. Operating System. Hardware

NQC User Manual. Version 2.2 r1, written by Dave Baum

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Gabriel Hugh Elkaim Spring CMPE 013/L: C Programming. CMPE 013/L: C Programming

Crate Shell. Release

Overview of the Cisco NCS Command-Line Interface

Fundamentals of Programming. Lecture 3: Introduction to C Programming

Variables and Values

4. Inputting data or messages to a function is called passing data to the function.

SSH-REVERSE-TUNNEL(1) User Commands SSH-REVERSE-TUNNEL(1)

Data::Dumper - stringified perl data structures, suitable for both printing and eval

Using the aregcmd Commands

Unix Introduction to UNIX

rowan(1) RoWAN manual page rowan(1)

PerlAPRS An Automated Control Application for APRS Networks

CC888 EZcarsharing Control System & T-Box Communication Protocol-V3.5

DTSX3000 Communications(Modbus) Guide

pydocstyle Documentation

Python Lists and for Loops. Learning Outcomes. What s a List 9/19/2012

ERRS: Homework 4 Scalability

Common JSON/RPC transport

Transcription:

NAME rotctld Hamlib TCP rotator control daemon SYNOPSIS rotctld [OPTION]... DESCRIPTION The rotctld program is an NEW Hamlib rotator control daemon ready for testing that handles client requests via TCP sockets. This allows multiple user programs to share one rotator (this needs testing). Multiple rotators can be controlled on different TCP ports by use of multiple rotctld processes. The syntax of the commands are the same as rotctl. It is hoped that rotctld will be especially useful for client authors using languages such as Perl, Python, PHP, 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 "RPRT x", where x is a negative number indicating the error code. Commands that do not return values respond with the line "RPRT 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. This protocol is primarily for use by the NET rotctl (rot model 2) backend. A separate Extended Response protocol extends the above behavior by echoing the received command string as a header, any returned values as a key: value pair, and the "RPRT x"string as the end of response marker which includes the Hamlib success or failure value. See the PROT OCOL section for details. Consider using this protocol for clients that will interact with rotctld directly through a TCP socket. 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 or USB port device. Typically /dev/ttys0, /dev/ttys1, /dev/ttyusb0, etc. on Linux or COM1, COM2, etc. on Win32. s, --serial-speed=baud Set serial speed to baud rate. Uses maximum serial speed from rotor backend capabilities (set by -m above) asthe default. T, --listen-addr=ipaddr Use IPADDR as the listening IP address. The default is ANY. t, --port=number Use number as the TCP listening port. The default is 4533. N.B.: As rigctld s default port is 4532, it is advisable to use odd numbered ports for rotctld, e.g. 4533, 4535, 4537, etc. L, --show-conf List all config parameters for the rotator defined with -m above. Hamlib March 13, 2013 1

C, --set-conf=parm=val[,parm=val]* Set config parameter. e.g. --set-conf=stop_bits=2 l, --list Use -L option for a list. List all model numbers defined in Hamlib and exit. As of 1.2.15.1 the list is sorted by model number. N.B. 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 inwindows. The output can be piped to more or less, e.g. rotctld -l more. u, --dump-caps Dump capabilities for the rotator defined with -m above and exit. v, --verbose Set verbose mode, cumulative (see DIAGNOSTICS below). h, --help Show asummary 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, orasalong command name plus the value(s) space separated on one \n terminated line. See PROT OCOL. Since most of the Hamlib operations have a set and a get method, an upper case letter will be used for set methods 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. Example (Perl): print $socket "\\dump_caps\n"; to see what the rotor s backend can do (NOTE: In Perl and many other languages a \ will need to be escaped with a preceding \ so that even though two backslash characters appear in the code, only one will be passed to rotctld. This is a possible bug, beware!). 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 (In the case of "set" commands the quoted string is replaced by the value in the description. In the case of "get" commands the quoted string is the key name of the value returned.): P, set_pos Azimuth Elevation Set position: Azimuth and Elevation as double precision floating point values. p, get_pos Get position: Azimuth and Elevation as double precision floating point values. M, move Direction Speed Move the rotator in a specific direction at the given rate. Values are integers where Direction is defined as 2 = Up, 4 = Down, 8 = Left, and 16 = Right. Speed is an integer between 1 and 100. Not all backends that implement the move command use the Speed value. At this time only the gs232a utilizes the Speed parameter. Hamlib March 13, 2013 2

S, stop Stop the rotator. K, park Park the antenna. C, set_conf Token Value Set Token to Value. Backend dependent. Needs testing. R, reset Reset Reset the rotator. Integer value of 1 for Reset All. _, get_info Get misc information about the rotator. At the moment returns Model Name. w, send_cmd Cmd Send raw command string to rotator. For binary protocols enter values as \0xAA\0xBB. Expect a Reply from the rotator which will likely be a binary block or an ASCII string. Locator Commands These commands offer conversions of Degrees Minutes Seconds to other formats, Maidenhead square locator conversions and distance and azimuth conversions. L, lonlat2loc Longitude Latitude Loc Len [2-12] Returns the Maidenhead locator for the given Longitude and Latitude. 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. For example, "+L -170.000000-85.000000 12\n" returns "Locator: AA55AA00AA00\n". 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. For example, "+l AA55AA00AA00\n" returns "Longitude: -169.999983\nLatitude: -84.999991\n". D, dms2dec Degrees Minutes Seconds S/W Returns Dec Degrees, a signed floating point value. 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). d, dec2dms Dec Degrees Returns Degrees Minutes Seconds S/W. Values are as in dms2dec above. Hamlib March 13, 2013 3

E, dmmm2dec Degrees Dec Minutes S/W Returns Dec Degrees, a signed floating point value. 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). e, dec2dmmm Dec Deg Returns Degrees Minutes S/W. Values are as in dmmm2dec above. B, qrb Lon 1 Lat 1 Lon 2 Lat 2 Returns Distance Azimuth where Distance is in km and Azimuth is in degrees. All Lon/Lat values are signed floating point numbers. A, a_sp2a_lp Short Path Deg Returns Long Path Deg or -RIG_EINVAL upon input error.. Both are floating point values within the range 0.00 to 360.00. a, d_sp2d_lp Short Path km Returns Long Path km. PROT OCOL Default Protocol Both are floating point values. 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 \ Aone line response will be sent as a reply to set commands, "RPRT x\n" where x is the Hamlib error code with 0 indicating success of the command. Responses from rotctld get commands are text values and match the same tokens used in the set commands. Each value is returned on its own line. On error the string "RPRT x\n" is returned where x is the Hamlib error code. Example get (Perl code): print $socket "p\n"; "135" "10" Most get functions return one to three values. A notable exception is the \dump_caps function which returns many lines of key:value pairs. This protocol is primarily used by the NET rotctl (rotctl model 2) backend which allows applications already written for Hamlib s C API to take advantage of rotctld without the need of rewriting application code. An application s user can select rotor model 2 ("NET rotctl") and then set rot_pathname to "localhost:4533" or other network host:port (set by the -t option above). Hamlib March 13, 2013 4

Extended Response Protocol An EXPERIMENTAL Extended Response protocol has been introduced into rotctld as of February 10, 2010. This protocol adds several rules to the strings returned by rotctld and adds a rule for the command syntax. 1. The command received by rotctld is echoed with its long command name followed by the value(s) (if any) received from the client terminated by the specified response separator as the first record of the response. 2. The last record of each block is the string "RPRT x\n" where x is the numeric return value of the Hamlib backend function that was called by the command. 3. Any records consisting of data values returned by the rotor backend are prepended by a string immediately followed by a colon then a space and then the value terminated by the response separator. e.g. "Azimuth: 90.000000\n" when the command was prepended by +. 4. All commands received will be acknowledged by rotctld with records from rules 1 and 2. Records from rule 3 are only returned when data values must be returned to the client. An example response to a +P command command sent from the shell prompt (note the prepended + ): $echo "+P 90 45" nc -w 1 localhost 4533 set_pos: 90 45 RPRT 0 In this case the long command name and values are returned on the first line and the second line contains the end of block marker and the numeric rotor backend return value indicating success. An example response to a +\get_pos query: $echo "+\get_pos" nc -w 1 localhost 4533 get_pos: Azimuth: 90.000000 Elevation: 45.000000 RPRT 0 In this case, as no value is passed to rotctld, the first line consists only of the long command name. The final line shows that the command was processed successfully by the rotor backend. Invoking the Extended Response protocol requires prepending a command with a punctuation character. As shown in the examples above, prepending a + character to the command results in the responses being separated by a newline character ( \n ). Any other punctuation character recognized by the C ispunct() function except \,?, or _ will cause that character to become the response separator and the entire response will be on one line. Separator character summary: + Each record of the response is appended with a newline ( \n ). ;,, or, Each record of the response is appended by the given character resulting in entire response on one line.? _ Common record separators for text representations of spreadsheet data, etc. Reserved for help in rotctl short command Reserved for \get_info short command Hamlib March 13, 2013 5

# Reserved for comments when reading a command file script Other punctuation characters have not been tested! Use at your own risk. For example, invoking a ;\get_pos query with a leading ; returns: get_pos:;azimuth: 90.000000;Elevation: 45.000000;RPRT 0 Or, using the pipe character returns: get_pos: Azimuth: 90.000000 Elevation: 45.000000 RPRT 0 And a \set_pos command prepended with a returns: set_pos: 135 22.5 RPRT 0 Such a format will allow reading a response as a single event using a preferred response separator. Other punctuation characters have not been tested! All commands with the exception of \set_conf have been tested with the Extended Response protocol and the included testrotctld.pl script. EXAMPLES Start rotctld for a Ham IV rotor with the RotorEZ installed using a USB-to-serial adapter and backgrounding: $rotctld -m 401 -r /dev/ttyusb1 & Start rotctld for RotorEZ using COM2 on Win32: $rotctl -m 401 -r COM2 Connect to the already running rotctld, and set position to 135.0 degrees azimuth and 30.0 degrees elevation with a 1 second read timeout from the shell prompt: $echo "\set_pos 135.0 30.0" nc -w 1 localhost 4533 Connect to a running rotctld with rotctl on the local host: $rotctl -m2 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. See the README.betatester and README.developer files for more information. SECURITY No authentication whatsoever; DO NOT leave this TCP port open wide to the Internet. Please ask if stronger security is needed or consider using an SSH tunnel. As rotctld does not need any greater permissions than rotctl, it is advisable to not start rotctld as root or another system user account in order to limit any vulnerability. Hamlib March 13, 2013 6

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, Nate Bargmann, and the Hamlib Group <http://www.hamlib.org>. COPYRIGHT Copyright 2000-2009 Stephane Fillod Copyright 2011-2013 Nate Bargmann Copyright 2000-2009 the Hamlib Group. This is free software; see the source for copying conditions. There is NO warranty; not even for MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO rotctl(1), hamlib(3) Hamlib March 13, 2013 7