# This readme is a more highly-documented version of the actual # sensor_cfg.py located in /home/adcp/config. The program # 'sensor_cfg.py' is run when the UHDAS gui is called. It sets up # some information about eacn ADCP, and then specifies how to interact # with each serial data stream. If you change this, you must # 'stop recording', 'end cruise', and kill the gui. Then start the # gui again and it will read the file /home/adcp/config/sensor_cfg.py # DEBUGGING HINTS: This file is difficult to get right. It is a piece # of python code, so indentation and syntax must be correct. Until # you get it right, try starting UHDAS on the command line (you might # get hints by the error messages on the screen). Also look in # /home/adcp/log for log files ending with "err" or "warn". Look in # the term*.log file, DAS_while_logging.log, and DAS_while_cruise.log # The example below sets up a ship with every possible instrument # we've ever logged. Myriad comments are added below. #---------------- sensor_cfg.py ---------------------------- ## (I) -------- general setup ------------ # This configuration file is Python code. You should not # need to change it; but if you do, you need to know that # in Python, the *indentation matters*. # To effectively remove an instrument from UHDAS control, # uncomment one and only one of the "instdel = 0" and # "instdel = 1" lines, # and comment out the "instdel = None" line. # (Don't do this unless you are sure you need to.) # Then restart UHDAS; it is not enough to simply stop and # restart logging, or even a cruise. #instdel = 0 # to disable WH300 #instdel = 1 # to disable NB150 #instdel = 2 # to disable OS75 #instdel = 3 # to disable OS38 instdel = None # normally left uncommented # Again: of the lines above, one and only one MUST be left # uncommented (that is, without the "#" character in front of it), # and the uncommented line MUST start in the first column. # 2-letter abbreviation for logging file prefix and constructing dbase name; # read by procsetup.py shipabbrev = "mv" ## (II) -------- instrument setup ------------ # The next object, "ADCPs", is a list of dictionaries. # The list looks like this: # ADCPs = [ adcp1, adcp2, adcp3, adcp4] # Each instrument is a dictionary of comma-delimited name:value pairs # in matching braces. Don't forget to separate the {},{},{} by commas # until the last one (no comma after the last one), i.e. [ {},{},{} ] # # Here is what goes into the dictionary: # #{ 'instrument' : 'nb150', # instrument name # # 'setup' : 'rdi_setup', # program used to parse instrument commands # # 'terminal' : 'nb_term', # program to talk to instrument # # 'defaultcmd' : 'nb150_default.cmd', # default command set to start with # # 'commands' : (), # 'tuple' of additional direct commands # # eg. EA04500 for Workhorse # # or Ocean Surveyor # # A tuple is (a,b,c) or if # # only one, (a,) -- comma required # # 'datatypes' : ('nb150',), # names of data types with pings # # 'wakeup_baud' : 19200}, # baud rate the instrument # # starts at (set in deck unit) # # trailing comma # # NOTE trailing comma after end brace. # # This is required after all but the last # # instrument # # ## What to change: # 'commands' # (specify EA for ocean surveyor and workhorse) # 'wakeup_baud' # probably stays at 9600 for OS and WH, can set NB150 # to 19200 with dip switches ADCPs = [ { 'instrument' : 'wh300', 'setup' : 'rdi_setup', 'terminal' : 'oswh_term', 'defaultcmd' : 'wh300_default.cmd', 'commands' : ('EA04500',), # Add WM*, WV* here to override default. 'datatypes' : ('wh300',), 'wakeup_baud' : 9600 }, { 'instrument' : 'nb150', 'setup' : 'rdi_setup', 'terminal' : 'nb_term', 'defaultcmd' : 'nb150_default.cmd', 'commands' : (), 'datatypes' : ('nb150',), 'wakeup_baud' : 19200}, { 'instrument' : 'os75', 'setup' : 'rdi_setup', 'terminal' : 'oswh_term', 'defaultcmd' : 'os75_default.cmd', 'commands' : ('EA05810',), 'datatypes' : ('os75bb', 'os75nb'), 'wakeup_baud' : 9600} { 'instrument' : 'os38', 'setup' : 'rdi_setup', 'terminal' : 'oswh_term', 'defaultcmd' : 'os38_default.cmd', 'commands' : ('EA04500',), 'datatypes' : ('os38bb', 'os38nb'), 'wakeup_baud' : 9600 } ] ## (III) -------- serial setup ------------ ## serial logging is done with two "C" programs, "ser_asc" for ascii ## and "ser_bin" for binary. See ser_doc.txt for details of the switches. # # "common_opts" is configured to work correctly with UHDAS. # DO NOT EDIT THIS LINE: common_opts = '-f %s -F -m 1 -H 2 ' % (shipabbrev,) ## "sensors" is built like "ADCPs", as a list of dictionaries [ {}, {}, {} ] # # NOTE: the first "sensors" entries bust be the same as the first "ADCPs" # entries, in the same order. ## One block for an ADCP looks like this: # # # 'instrument' : 'nb150', ## instrument name (see ADCPs) # 'device' : 'ttyR1', ## logging port name # 'baud' : 19200, ## switch to this communication baud rate # 'format' : 'binary', ## ADCPs give data in binary # 'subdir' : 'nb150', ## directory we log data to # 'ext' : 'raw', ## suffix for files # 'opt' : '-rlE -c -I'}, ## raw data, write a log file, log errors ## use checksum ## initialte pinging ## One block for an ascii serial stream looks like this: # # 'instrument' : 'Ashtech', ## for title on gui panels # 'device' : 'ttyR5', ## logging port # 'baud' : 9600, ## baud rate # 'format' : 'ascii', ## these are ascii data # 'subdir' : 'ashtech', ## unique subdirectory name, one per serial port # 'ext' : 'adu', ## all strings go to file with this extension # 'strings' : ('$GPGGA', '$PASHR,ATT'), ## only accept these NMEA strings ## NOTE this is another tuple, i.e. ## a comma-delimited collection, eg. ## (a,) or (a, b, c) # 'messages' : ('gps', 'adu'), ## NMEA messages to parse into rbin files # 'opt' : '-tc'} ## preceed each line with time tag, use check sums sensors = [ ## ADCP communication setup -- same order as ADCPs above!! { 'instrument' : 'wh300', # Passive logging of WH300 'device' : 'ttyR0', 'baud' : 38400, # Some errors at 115200 'format' : 'binary', 'subdir' : 'wh300', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, # require -O for OS or WH { 'instrument' : 'nb150', # Passive logging of NB150 'device' : 'ttyR1', 'baud' : 19200, 'format' : 'binary', 'subdir' : 'nb150', 'ext' : 'raw', 'opt' : '-rlE -c -I'}, # NOTE: NO -O for OS or WH { 'instrument' : 'os75', # Passive logging of OS75 'device' : 'ttyR2', 'baud' : 38400, # Some errors at 115200. 'format' : 'binary', 'subdir' : 'os75', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, # require -O for OS or WH { 'instrument' : 'os38', # Passive logging of OS38 'device' : 'ttyR3', 'baud' : 38400, # Some errors at 115200. 'format' : 'binary', 'subdir' : 'os38', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, # # require -O for OS or WH ### begin regular ascii serial logging ## positions: { 'instrument' : 'PCODE-GPS', 'device' : 'ttyR4', 'baud' : 4800, 'format' : 'ascii', 'subdir' : 'gpsnav', 'ext' : 'gps', 'strings' : ('$GPGGA',), 'messages' : ('gps',), 'opt' : '-tc'}, { 'instrument' : 'Trimble', 'device' : 'ttyR5', 'baud' : 4800, 'format' : 'ascii', 'subdir' : 'trimble', 'ext' : 'gps', 'strings' : ('$GPGGA',), 'messages' : ('gps',), 'opt' : '-tc'}, ## gyro = primary heading source , with checksum. directory is 'gyro' { 'instrument' : 'Gyro', 'device' : 'ttyR6', 'baud' : 9600, 'format' : 'ascii', 'subdir' : 'gyro', 'ext' : 'hdg', ## 'hnc' if no checksum 'strings' : ('$HEHDT',), 'messages' : ('hdg',), ## 'hnc' if no checksum 'opt' : '-tc'}, ## 6Hz: take every 3rd message "-s3" # { 'instrument' : 'Gyro (no checksum)', # 'device' : 'ttyR7', # 'baud' : 9600, # 'format' : 'ascii', # 'subdir' : 'gyro', # 'ext' : 'hnc', # 'strings' : ('$HEHDT',), # 'messages' : ('hnc',), # 'opt' : '-t -s3'}, ## 6Hz: take every 3rd messag # ## if no checksum, use "-t" not "-tc" ## attitude data streams { 'instrument' : 'Ashtech', 'device' : 'ttyR8', 'baud' : 9600, 'format' : 'ascii', 'subdir' : 'ashtech', 'ext' : 'adu', 'strings' : ('$GPGGA', '$PASHR,ATT'), 'messages' : ('gps', 'adu'), 'opt' : '-tc'}, { 'instrument' : 'POS/MV', 'device' : 'ttyR9', 'baud' : 9600, 'format' : 'ascii', 'subdir' : 'posmv', 'ext' : 'pmv', 'strings' : ('$INGGA', '$PASHR'), #'strings' : (), 'messages' : ('gps', 'pmv'), 'opt' : '-tc'}, { 'instrument' : 'Seapath', 'device' : 'ttyR10', 'baud' : 9600, 'format' : 'ascii', 'subdir' : 'seapath', 'ext' : 'sea', 'strings' : ('$GPGGA', '$PSXN,20', '$PSXN,23'), 'messages' : ('gps_sea', 'sea'), 'opt' : '-tc'}, ## other attitude data streams { 'instrument' : 'Soundspeed', 'device' : 'ttyR11', 'baud' : 9600, 'format' : 'ascii', 'subdir' : 'sndspd', 'ext' : 'spd', 'strings' : (), 'messages' : ('spd',), 'opt' : '-ta -s20'} # comes in at 20Hz # no comma # ## end of dictionaries, no comma here ] # end of list #### DO NOT CHANGE the following ################ if instdel is not None: del(sensors[instdel]) del(ADCPs[instdel])