Changes between Initial Version and Version 1 of reftek2ew


Ignore:
Timestamp:
03/20/12 00:04:12 (9 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • reftek2ew

    v1 v1  
     1[[PageOutline]] 
     2 
     3= [wiki:Earthworm Earthworm] Module: reftek2ew = 
     4'''Contributed by: ''' 
     5 
     6== Function == 
     7A Reftek data feeding program 
     8 
     9== Details == 
     10Module reftek2ew was developed and provided by Refraction Technologies, Inc. The module translates data from the Reftek data server, RTP, into Earthworm trace data format and writes Earthworm trace messages to an Earthworm shared memory ring. 
     11 
     12Refraction Technologies, Inc. has provided the source code for both the Solaris and Windows 2000 versions. Along with this module, there are several other programs provided by Reftek which are required to run reftek2ew. Those can be found in the utils subdirectory in the reftek2ew source directory: 
     13 
     14utils/solaris: 
     15 * rtpd - rtp server daemon program used to boot up Reftek boxes and control communication with them 
     16 * rtpc - rtp client program used for Reftek control 
     17 
     18utils/winnt: (among other things) 
     19 * rtpudpsvc.exe - rtp server 
     20 * fsc.exe - Field Setup Controller 
     21 * nci.exe - Network Control Interface 
     22 
     23=== INSTALLING AND CONFIGURING REFTEK DATA LOGGERS, CISCO ROUTERS, AND RTPD SERVERS === 
     24{{{ 
     25Lucky Vidmar Fri Jan 29 11:49:21 MST 1999 
     26 
     27 
     28 
     29This file contains instructions for configuring RefTek data loggers 
     30(e.g. model 72A with serial card RT422) to deliver data into a Solaris 
     31or NT machine and convert it into Earthworm packets. The instructions 
     32contained here are the result of trial-and-error, complemented with a 
     33hefty dose of tech support from RefTek. Consulting ALL of the available 
     34RefTek documentation is strongly recommended. 
     35 
     36Communication between a RefTek data logger (Data Acquisition System - 
     37DAS) and the server machine is done via the RefTek Protocol (RTP).  RTP 
     38is designed to provide full-duplex, packet-oriented transport over UDP. 
     39RTP is implemented as a client-server process with a DAS with a RT422 
     40serial card as the client, and the RTPD application as the server. RTPD 
     41is available for NT and Solaris - see instructions below for installing 
     42RPTD on each platform. 
     43 
     44RefTek recommends that RTP is implemented through a router, for example 
     45a Cisco 2509, such that the set up will consist of two class C networks 
     46(one on each side of the router).  The client DAS is on one network and 
     47will connect to the router through an asynch serial interface using 
     48PPP. The server is on the other network and the router takes care of 
     49routing the traffic between the two networks. 
     50 
     51 
     52 
     53        SERVER 
     54         RTPD 
     55     192.168.6.80 
     56          | 
     57          | 
     58          |       192.168.6.0 network 
     59      ------------------------------------------- 
     60                                      | 
     61                                      | 
     62                                      | 192.168.6.1 
     63                                 -------------------------- 
     64                                 |                        | 
     65                                 |    CISCO 2509          | 
     66                                 |                        | 
     67                                 -------------------------- 
     68                                   |                   | 
     69                                 Async1             Async2 
     70                              192.168.7.1         192.168.7.2 
     71                                   |                   | 
     72                                   |      PPP          | 
     73                                   |      LINK         | 
     74                                   |                   | 
     75                              192.168.7.9         192.168.7.10 
     76                                   |                   | 
     77                              ------------        ------------ 
     78                              |          |        |          |      
     79                              | DAS#7853 |        | DAS#7854 |      
     80                              |          |        |          |      
     81                              ------------        ------------ 
     82 
     83 
     84The Cisco router configuration for the setup shown above is as 
     85follows: 
     86 
     87hostname RefTekRouter 
     88! 
     89! 
     90username das#7853 password 0 das#7853 
     91username das#7854 password 0 das#7854 
     92! 
     93interface Ethernet0 
     94 ip address 192.168.6.1 255.255.255.0 
     95! 
     96interface Serial0 
     97 no ip address 
     98 shutdown 
     99! 
     100interface Serial1 
     101 no ip address 
     102 shutdown 
     103! 
     104interface Async1 
     105interface Async1 
     106 ip address 192.168.7.1 255.255.255.0 
     107 ip helper-address 192.168.6.255 
     108 encapsulation ppp 
     109 async mode interactive 
     110 peer default ip address 192.168.7.9 
     111 no cdp enable 
     112 ppp authentication pap callin 
     113! 
     114interface Async2 
     115interface Async2 
     116 ip address 192.168.7.2 255.255.255.0 
     117 ip helper-address 192.168.6.255 
     118 encapsulation ppp 
     119 async mode interactive 
     120 peer default ip address 192.168.7.10 
     121 no cdp enable 
     122 ppp authentication pap callin 
     123! 
     124ip http server 
     125ip classless 
     126ip forward-protocol udp 2543 
     127ip route 192.168.6.0 255.255.255.0 Ethernet0 
     128ip route 192.168.7.9 255.255.255.255 Async1 
     129ip route 192.168.7.10 255.255.255.255 Async2 
     130no logging console 
     131access-list 101 permit ip any any 
     132access-list 101 deny   igrp any host 255.255.255.255 
     133dialer-list 1 protocol ip list 101 
     134! 
     135line con 0 
     136 exec-timeout 0 0 
     137line 1 2 
     138 autoselect ppp 
     139 modem InOut 
     140 transport input all 
     141 flowcontrol hardware 
     142line 3 8 
     143 transport input all 
     144line aux 0 
     145 transport input all 
     146line vty 0 4 
     147 exec-timeout 0 0 
     148 password reftek 
     149 login 
     150! 
     151end 
     152 
     153 
     154For more information about RTP consult the RefTek Protocol Manual. 
     155}}} 
     156 
     157=== CONFIGURING RTPD SERVER === 
     158{{{ 
     159More information about installing and troubleshooting RTPD can be 
     160found in the RTPD Installation and Users Guide Manual. 
     161 
     1621.  Windows NT 4.0 
     163 
     164To configure the RTPD server as a Windows NT 4.0 service, copy the 
     165service executable rtpudpsvc.exe and the startup file rtpd.ini from the 
     166utils/winnt directory to, for example, c:\reftek. Edit the rtpd.ini 
     167file to reflect local customizations (for example, directory names, 
     168etc) then execute the following commands to install this program as a 
     169service: 
     170 
     171 c: 
     172 cd \reftek 
     173 svcins rptd_service "RefTek Data Server" c:\reftek\rtpudpsvc.exe 
     174 
     175The RTPD service can now be controlled like any other NT service, 
     176using the Services icon within the Control Panel. 
     177 
     178 
     1792.  Solaris 2.6 
     180 
     181o Copy the rtpd binary from the utils/solaris directory to whatever 
     182  directory you find convenient, and make sure it is setuid as the user 
     183  you want it to run as. 
     184 
     185This example assumes user "root", with executables in /usr/local/bin. 
     186In that case you would copy rtpd to /usr/local/bin and execute the 
     187following commands: 
     188 
     189   chown root /usr/local/bin/rtpd 
     190   chmod 4555 /usr/local/bin/rtpd 
     191 
     192 
     193o Copy the rtpd.ini file from solaris/winnt to, for example, 
     194  /usr/local/etc directory and make any local customizations to it. 
     195 
     196The Solaris version of the file is identical to the NT version, with 
     197the exception that path names are different.  You also have the choice 
     198of using the syslog logging facility.  Suppose you want to use syslog. 
     199Then select a facility and give it in the ini file like: 
     200 
     201Facility   LOCAL6 
     202 
     203Then, edit /etc/syslog.conf and include the following line: 
     204 
     205local6.debug    /var/log/local6 
     206 
     207Note that it should be a TAB between the two tokens.  Create 
     208/var/log/local6 and HUP syslogd (as root, kill -HUP ), 
     209once to get it to reread the conf file.  See syslog.conf(4) and 
     210syslogd(1M) for additional information. 
     211 
     212 
     213o Copy the startup script utils/solaris/rtpd_init to /etc/init.d  
     214  and make sure that it is executable (mode 544) and owned by root.  
     215  Change directory names and make any other local customizations.  
     216 
     217  Make the following soft links:: 
     218 
     219# ln -s /etc/init.d/rtpd_init /etc/rc3.d/S75rtpd_init 
     220# ln -s /etc/init.d/rtpd_init /etc/rc2.d/K10rtpd_init 
     221# ln -s /etc/init.d/rtpd_init /etc/rc0.d/K10rtpd_init 
     222 
     223This will cause RTPD to be started automatically at boot time, and to 
     224go down gracefully at system shutdown.   
     225 
     226The following command will manually stop the RTPD server: 
     227 
     228reftek% /etc/init.d/rtpd_init stop 
     229 
     230The following command will manually start the RTPD server: 
     231 
     232reftek% /etc/init.d/rtpd_init start 
     233}}} 
     234 
     235=== How to Compile Reftek2ew === 
     236{{{ 
     237In order to build this program, you need to define the following in 
     238your earthworm.d file: 
     239 
     240RAW_RING       - transport ring for raw packets from the RTP server 
     241MOD_IMPORT_RTP - module id for this process 
     242TYPE_REFTEK    - message type for raw RTP server packets 
     243 
     244If you want to assign pin numbers, you will need to define them in a 
     245parameter file.  See import_rtp.d for the specification syntax, and 
     246see reftek.scn for an example. 
     247 
     248All dialog with the RTP server is done via the Refraction Technology 
     249API and libraries.  You can get a copy of this toolkit from 
     250 
     251                    ftp://ftp.reftek.com:/pub/rtp 
     252 
     253Install the libraries and include files as per the instructions provided 
     254with the toolkit.  You will need to specify the installation location in 
     255your makefile.  See the comments in the makefile appropriate for your 
     256system. 
     257}}} 
     258 
     259=== Example Configuration File === 
     260{{{ 
     261# @(#)import_rtp.d      1.3 07/01/98 
     262# reftek2ew parameter file 
     263 
     264#  Basic Earthworm setup: 
     265 
     266MyModuleId         MOD_REFTEK2EW  # module id for this process 
     267WaveRing           WAVE_RING      # output ring for TRACEBUF messages 
     268RawRing            RAW_RING       # output ring for REFTEK messages 
     269HeartBeatInterval  30             # seconds between heartbeats 
     270 
     271# At least one of WaveRing and RtpRing must be defined. 
     272# 
     273# If you have selected a WaveRing to output TRACEBUF messages, then it 
     274# is necessary to define a mapping between the digitizer, stream, channel 
     275# information that is contained in each packet to the station, channel, 
     276# net, and pin number that is required by the TRACEBUF messages.  There 
     277# is no standard way to do this in vanilla Earthworm, therefore import_rtp 
     278# defines yet another parameter file.  If you don't specify this file, 
     279# then import_rtp issues a warning message on start up and then generates 
     280# its own names.  Station name is the unit id, channel name is built up 
     281# from the stream and channel values in the DT header (stream:chan), the 
     282# networm name is set to "RTP", and the pin number is set to -1. 
     283 
     284SCNLFile            reftek.scnl 
     285 
     286# Give the fully qualified host name, or the IP address of the server in 
     287# the usual decimal dot notation, followed by the port number for the RTP 
     288# service.  If you are running this on the same computer as the RTP server, 
     289# then specify "localhost" as the host name. 
     290 
     291Server             localhost    7000 
     292 
     293# The API allows you to request data from a single, specific, DAS or from 
     294# all DAS(es).  There is no provision in the API for requesting data from 
     295# a subset of the available digitizers.  If you want data from a single DAS, 
     296# give its unit id here, otherwise enter 0 to select all digitizers. 
     297 
     298DASid              0 
     299 
     300# You may filter the input based on packet type.  The following types are 
     301# supported: AD CD DS DT EH ET OM SC SH.  List the ones you want, or enter 
     302# ALL for all available. 
     303 
     304PktMask            ET DT SC 
     305 
     306# You may filter the DT packets based on stream.  List the stream id's you 
     307# want to see.  The stream codes here are the one-based values that are 
     308# used by people, not the zero-based values that are in the headers. 
     309 
     310StrMask            1 2 3 4 5 6 7 8 
     311}}} 
     312 
     313=== EXAMPLE REFTEK2EW DESCRIPTOR FILE ===  
     314{{{ 
     315modName  reftek2ew 
     316modId    MOD_REFTEK2EW 
     317instId   INST_MENLO 
     318# 
     319tsec: 60  page: 0  mail: 10 
     320# 
     321# Uncomment the "restartMe" line to enable automatic restart of this 
     322# process by statmgr/startstop.  statmgr will issue a TYPE_RESTART 
     323# message for this process_id if it declares the patient dead. 
     324# 
     325restartMe 
     326# 
     327err: 1  nerr: 1  tsec: 0  page: 0  mail: 20  
     328text: "RTP server OK." 
     329# 
     330err: 2  nerr: 1  tsec: 0  page: 0  mail: 20  
     331text: "RTP server not responding." 
     332# 
     333err: 3  nerr: 1  tsec: 0  page: 0  mail: 20  
     334text: "no data from RTP server." 
     335}}} 
     336 
     337 
     338== Helpful Hints ==