NAME
q330util - utility for configuring Q330 dataloggers
SYNOPSIS
q330util [-port localport] [-port_base port_base]
[-auth auth] [-sequence sequence]
[-timeout timeout] [-i local_ipaddr]
[-pfout]
{ pollsn q330ip
| ping q330ip,lport,{info|<somestring>}
| register q330ip,sn,lport
| getconfig q330ip,sn,lport,config
| control q330ip,sn,{eeprom|reboot|resync|gpson|gpsoff|gpscs}
| sauth q330ip,sn[,port_1_auth[,port_2_auth,port_3_auth,port_4_auth,config_auth,special_auth]
| sipaddr q330ip,sn,interface,newipaddress
| sbpwr q330ip,sn,interface,function,timeout
| rqannc q330ip,sn
| umsg q330ip,sn,lport,message
| ident q330ip,sn[,tport[,lport]]
| marmotfix q330ip,sn[,interface[,baudrate]]}
DESCRIPTION
q330util is a utility program for use with one or more Quanterra/Kinemetrics Q330 dataloggers.
Although the program has limited capabilities currently, it is intended to develop
q330util as an alternative configuration tool to
Willard.
q330util
is designed purposely as a completely non-graphical, command line driven program
with a minimal syntax and eventually will support most of the common Q330 configuration
tasks. Note that
q330util communicates directly with the Q330s and does
not require an acquisition
q3302orb node to be running. Also,
q330util
can communicate with one or more Q330s using any of the Q330 communication physical
interfaces, including both the ethernet and serial/SLIP interfaces, either through
the console connector or the serial connectors.
OPTIONS
-
-port localport
A local port number used by the host where q330util
is running for UDP communications. Generally this can be
any legitimate port number that is not already in use. If
this is set to 0, then the OS will assign it dynamically.
This argument is optional and
if not specified defaults to 0.
-
-port_base port_base
This is the base port number for the Q330s and is used to compute
the actual various port numbers from the Q330 logical port
numbers.
This argument is optional and
if not specified defaults to 5330.
-
-auth auth
This specifies the Q330 authorization code.
This argument is optional and
if not specified defaults to 0.
-
-sequence sequence
This specifies the starting sequence number for outgoing
UDP command packets to the Q330s.
This argument is optional and
if not specified defaults to 0.
-
-timeout timeout
This specifies a timeout value in seconds for waiting for
return UDP packets.
This argument is optional and
if not specified defaults to 5.0.
-
-i local_ipaddr
This is an ip-address that can optionally be used to
bind all local UDP sockets for communication with
Q330s. Note that this should normally not be specified
at all, which produces the default and typical behavior
of binding UDP sockets to INADDR_ANY. However, if this
parameter is specified, then it provides a means to
bind the UDP sockets to a particular host ip-address in
cases where multiple internet interfaces exist for the
host. Please be sure you know exactly what you are
doing with this parameter, as an improper value can
completely disable all communication with the Q330s.
-
-pfout
This flag if specified causes the results of the command to be
displayed in normal Antelope parameter file form on standard
output. Otherwise, the output is in a human readable form.
Parameter file output is provided for easy machine parsing.
If this option is specified then a parameter
disposition ok
will indicate successful completion of the command.
One of the following functions must be specified along with the
arguments for each function:
-
pollsn q330ip
The pollsn function will cause a C1_POLLSN command packet
(poll for serial numbers) to be
sent to the address specified by q330ip. If the ethernet interface
is to be used, q330ip can be any legitimate ip-address or
host name that can be resolved through the Name Server interfaces.
q330ip can also be set to broadcast, meaning the broadcast
address for the LAN, which will elicit responses from all Q330s
attached to the LAN. If the q330ip is in the form
<device>:<baud>:<ipaddress>, then <device> is taken
as a local physical device that supports a serial streaming interface
(this should always begin with /dev/...), <baud> is the baud rate of the
serial interface and <ipaddress> is the destination ip-address which
can be broadcast. After sending out the command q330util
waits for responses, and prints them out as received, up to the time specified in the -timeout
command line argument.
-
ping q330ip,lport,{info|<somestring>}
The ping function will send a Q330 ping to one or more dataloggers.
Ths datalogger ip-address and logical port are specified as before through
q330ip and lport. If q330ip is set to broadcast, then all
of the dataloggers on the LAN will be pinged at the same time. The ping command must be one of the following:
-
info
This returns a C1_PING info structure.
-
<somestring>
This echoes back the first 4 characters of the string (Don't put in the "<" and ">" characters).
-
register q330ip,sn,lport
The register function will cause a normal registration-deregistration sequence
to be initiated which starts with sending a C1_RQSRV
(request server registration) command to the Q330. The Q330's ip-address
is specified with q330ip as before. The Q330's 16 hexadecimal
character serial number is specified in sn and the Q330's
logical port number in lport. Note that the ip-address, serial
number and logical port are delimited by "," characters. Messages
are printed out to indicate successful registration and deregistration.
-
getconfig q330ip,sn,lport,config
The getconfig function will register with a Q330, get various Q330
configuration information, print it to standard out and deregister with the Q330.
The Q330's ip-address
is specified with q330ip as before. The Q330's 16 hexadecimal
character serial number is specified in sn and the Q330's
logical port number in lport. Note that the ip-address, serial
number and logical port are delimited by "," characters. The
type of configuration is specified in config which must be one of the
following:
-
phy
The physical interface configuration from the C1_PHY block.
-
control q330ip,sn,{eeprom|reboot|resync|gpson|gpsoff|gpscs}
The control function will initiate a number of datalogger control functions.
The datalogger ip-address and serial number are specified as before through
q330ip and sn. The control commands must be one of the following:
-
eeprom
Save the current datalogger configuration into the eeprom.
-
reboot
Cause the datalogger to reboot.
-
resync
Cause the datalogger to resync.
-
gspon
Cause the GPS engine to power up.
-
gspoff
Cause the GPS engine to power down.
-
gspcs
Cause the GPS engine to cold start.
-
sauth q330ip,sn[,port_1_auth[,port_2_auth,port_3_auth,port_4_auth,config_auth,special_auth]
This can be used to set the authorization codes on a Q330.
The datalogger ip-address and serial number are specified as before through
q330ip and sn. If the authorization codes are not specified, then all of the codes are set back to
the default values (0000000000000000). If only the port_1_auth code is specified, then all of the codes
are set to that value. If all of the codes are specified, then each code is set accordingly. Note that
Q330 authorization codes must always be 16-character hexadecimal values. Use this command carefully. You
must be able to register in order to execute this command which means you must know the configuration
port authorization code to execute this command. After authorization codes have been successfully
changed, the Q330's eeprom is set with the new codes and the Q330 is rebooted. After this you will only be
able to re-register if you can specify the altered authorization codes for the various ports using the -auth command
line argument.
-
sipaddr q330ip,sn,interface,newipaddress
This can be used to set the datalogger physical interface ip-addresses.
Needless to say, this should be used with extreme caution. Incorrectly setting the datalogger
ip addresses will usually put the datalogger into a state where it will no longer communicate
at all, except through direct connect to the console interface.
Any changes made with this command need to be followed by a control ... eeprom,reboot command
to save the ip address changes to the eeprom and to reboot the datalogger. Ip address changes only take
place at datalogger reboot time.
The datalogger ip-address and serial number are specified as before through
q330ip and sn. interface must
be one of serial1, for the first Q330 serial interface,
serial2, for the second Q330 serial interface,
serial3, for the third Q330 serial interface,
or ethernet, for the Q330 ethernet interface.
The new ip address is specified in newipaddress in the normal numerical form, xxx.xxx.xxx.xxx.
Note that there is no host name resolution for newipaddress.
-
sbpwr q330ip,sn,interface,function,timeout
This provides access to the power control for attached balers or dialers.
The datalogger ip-address and serial number are specified as before through
q330ip and sn. interface must
be one of serial1, for a baler attached to Q330 serial port 1,
serial2, for a baler attached to Q330 serial port 2,
ethernet, for a baler attached to the ethernet,
dialer1, for a dialer attached to Q330 serial port 1,
or dialer2, for a dialer attached to Q330 serial port 2.
function must be one of powerontimer, to set the baler powered on timer to timeout,
ignoretimer, to set the baler ready ignore timer to timeout,
canceltimers, to cancel all Q330 timers,
poweron, to power on the baler using timeout as the web access timeout,
cleartimeout, to clear the baler timeout counter,
cleartimeouts, to clear dialer timeouts,
offhook, to set the dialer off hook,
or onhook, to set the dialer on hook. The timeout is a time value in seconds according
to the function.
-
rqannc q330ip,sn
This requests the Q330 "Announce" structure which contains, among other things, destination POC ip-addresses.
The datalogger ip-address and serial number are specified as before through
q330ip and sn.
The announce structure is output in parameter file form on standard output.
-
umsg q330ip,sn,lport,message
The umsg function will cause a user message to be sent to a Q330.
The Q330's ip-address
is specified with q330ip as before. The Q330's 16 hexadecimal
character serial number is specified in sn and the Q330's
logical port number in lport. Note that the ip-address, serial
number and logical port are delimited by "," characters. The
message to be sent is specified in message. Embedded blanks in the message
can be accomplished by proper command line quoting.
-
ident q330ip,sn[,tport,[lport]]
This requests identification information from a Q330.
The datalogger ip-address and serial number are specified as before through
q330ip and sn. The baler net and sta tokens are
requested from the logical port tport tokens (default to 4).
The requests are made on logical port lport (default to 0).
-
marmotfix q330ip,sn[,interface,[baudrate]]
This will set the physical interface parameters for a Q330 with a C1_SPHY
command so that a Q330 can be connected to a Marmot through its serial interface
in a manner so that the Marmot Antelope software can poll for the Q330 serial number.
This is done by setting bit 10 (keep this interface unlocked) in the serial interface
flags. Also set is bit 0 to enable the serial interface and the baud rate for
the serial interface. The interface number can be specified by interface, which
must be 1, 2 or 3 and defaults to 2. The baudrate can be specified
by baudrate, which must be one of 1200, 2400, 4800,
9600, 19200, 38400, 57600, or 115200 and defaults
to 115200. Note that in order to cause this setting to be saved in the datalogger's
eeprom, another q330util control eeprom command should be issued.
BUGS AND CAVEATS
Not really in a useful state until more functions have
been implemented.
SEE ALSO
dlmon(1)
AUTHOR
Danny Harvey
Boulder Real Time Technologies, Inc.