Configuring the ASCII Interface
Thinklogical, LLC
100 Washington Street
Milford, Connecticut 06460 U.S.A.
Telephone : 1-203-647-8700
Fax : 1-203-783-0049
www.thinklogical.com
Revision: G
®
Preface
The router is controlled via an ASCII interface. This interface is accessible via a serial RS-232
port or over the network via a TCP port. Both ports use the same syntax. The command syntax
is defined in the document:Router-ASCII-API.pdf.
The serial port is configured for 9600 baud, 1 stop bit, no parity, and software flow control. Each
line contains only one command and must end with a carriage return (CR) and line feed (LF), or
just a line feed (LF). The characters are not echoed.
The network interface listens on TCP port 17567. It accepts the same commands as the serial
interface. You may use telnet to manually open a connection and control the VxRouter.
(references to a VxRouter also apply to a HdxRouter and a MxRouter)
Router Conguration V4.0-9 and earlier
The router interface is controlled by entries in the file /etc/inittab. Listed below are the relevant
portions of the file that control the interfaces:
#run the ASCII interface program
::respawn:/usr/local/sbin/vxrapi --verbose
::respawn:/usr/local/sbin/vxrapi --serial
The line with '--verbose' starts the network connection. By default the network interface is
started unless the '--serial' option is present.
After making changes to the file /etc/inittab, you must run the commands:
kill -hup 1
killall vxrapi
for the changes to take effect.
Router Conguration V4.0-10 and later
Starting in version 4.0-10 and later, the interface program no longer requires the --serial option.
Both the serial and network interfaces are started with the one command. Listed below are the
relevant portions of the file that control the interfaces:
#run the ASCII interface program
::respawn:/usr/local/sbin/vxrapi --verbose
The version of the API program may be determined by any of the following:
1) looking in the system log file: /var/log/api for the API signon message
2) running the command: vxrapi -v on the VxRouter
3) sending the command 'xversion' to the API command port
Revision: G
API Command Line Options
Each model router has it's own API program. Examples are: vx40api, vx160api, mx48api
and vx320api. The generic name that is used in place of the actual name is: vxrapi.
The interface program has several options to control its operation. These options can be listed
by running the API program with the option '--help'. Here is the output:
~ # vxrapi --help
Version: V4.5-1
Usage: vxrapi [options]
---- network options ----
-L|--listen[=]port listen on this port, all addresses (default: 17567)
--vx[=]IP address address of VxRouter (default: 127.0.0.1)
we will send commands to the above IP address, socket: 27567
-N|--connections[=]n set the maximum number of open connections allowed (default: 12)
--mcast[=IP address] replace broadcasts with multicast to this IP address (default:
---- serial options ----
-S|--serial[=device] use this serial device (default: /dev/ttyS2)
--serial=none disables the API serial port /dev/ttyS2
-B|--baud[=]speed sets serial baud rate (default: 9600)
---- generic options ----
--CR output CRLF instead of just LF
-f|--facility[=]name syslog facility reporting level (default is local4)
valid names: auth, daemon, user, local0 through local7
see the man page for syslog.conf for more information
-D|--debug write debug messages to the log file (multiple options increase the debug
level
--api write API messages received to the log file (level: NOTICE)
--avr write AVR commands to the log file (level: NOTICE)
--clog write connection status changes to the log file (level: NOTICE)
--delay[=]delay in ms, how long an upStream output must remain off, default is 300 ms.
minimum is 50ms, maximum is 1000ms, 0 will disable the delay
-b|--bcast[=]period in ms, how long between port status broadcasts, default is 4000 ms.
minimum is 500, maximum is 15000, 0 will disable the broadcast
if multicast is enabled, it will use this time setting
--bcast=0 will disable BOTH broadcasts and multicasts
-V|--verbose enable error text in responses
-h|--help display this help and exit
-v|--version output version information and exit
239.255.13.9)
Default (no options) is to listen on socket 17567 at all IP addresses
send to socket 27567 at 127.0.0.1
accept commands from the RS232 port
broadcast switch status every 4000 milliseconds
signal SIGUSR1 will toggle api debug logging (--api)
signal SIGUSR2 will toggle avr debug logging (--avr)
signal SIGHUP will force the API to reread the P2P csv files located in /var/local/router/p2p/
To change the serial port baud rate to 115200 and send a CRLF at the end of each line, the
command syntax for the line in /etc/inittab would be:
::respawn:/usr/local/sbin/vx40api –-CR --baud=115200
Please remember that any changes you make to the router firmware will be lost if you
install a new SD card from Thinklogical®.
Revision: G