Troubleshooting speedlog =========================================== Components (what talks to whom) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The speedlog program is called **DAS_speedlog.py** and it - starts when DAS.logging is True (it does not run when logging is stopped) - gets its configuration from /home/adcp/sensor_cfg.py (speedlog_config) - listens to a zmq feed with indexing information (where to read in the file) - reads ADCP data - calculates speed past the ship (forward, starboard) - puts out $VDVBW messages as configured (serial, UDP) for users - puts out $VDVBW messages via zmq for web_speedlog.py The web viewer is called **web_speedlog.py** and it: - starts at boot - reads a zmq feed from DAS_speedlog.py - puts out information via web_torrent to the network on the specified ethernet port (that port name is used to deduce the IP address and then the subnet where info is sent) speedlog configuration (in sensor_cfg.py) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: ## speedlog: enabl ed in /home/adcp/config/uhdas_cfg.py speedlog_config = { 'instrument' : 'os150', ## wh300 is disabled 'serial_device' : '/dev/ttyUSB1', # no serial out is '' 'udp' : '192.168.0.255:34567' 'baud' : 9600, # required (for historical reasons) 'zmq_from_bin' : "tcp://127.0.0.1:38010", # read os150 indexing 'pub_addr' : "tcp://127.0.0.1:38020", # publish speedlog 'eth_port' : 'enp10s0', # NIC for web_speedlog.py # 'heading_offset' : xx.x, # defaults to h_align from proc_cfg.py 'scale' : 1.0, # multiplies velocity measurement 'bins' : (1,2), # zero-based; input to python slice() 'navg' : 5, # pings to average } Normal behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Speedlog is started when “Start Recording” is clicked (after all the acquisition is started). It can be stopped with :: DAS_speedlog.py --stop it can be started in a “screen session” :: export DISPLAY=:0.0 DAS_speedlog.py Troubleshooting DAS_speedlog.py ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Follow the data**: - DAS.py should be running - Cruise should be active - Data acquisition should be occurring Look in the /home/adcp/config/sensor_cfg.py speedlog configuration block and note the following: :: instrument eg. os150 zmq_from_bin eg. tcp://127.0.0.1:38010 pub_addr eg. tcp://127.0.0.1:38020 . **Verify that the following three things are all true:** (1) The zmq feed from the ADCP data acquisition is coming out. Test with the zmq_from_bin variable: zmq_monitor.py -c 5 tcp://127.0.0.1:38010 The results should look like this: :: /home/data/DY105_part3/raw/os150/ukdy2019_193_64033.raw 47850 957 /home/data/DY105_part3/raw/os150/ukdy2019_193_64033.raw 48807 957 /home/data/DY105_part3/raw/os150/ukdy2019_193_64033.raw 49764 957 /home/data/DY105_part3/raw/os150/ukdy2019_193_64033.raw 50721 957 /home/data/DY105_part3/raw/os150/ukdy2019_193_64033.raw 51678 957 This means DAS_speedlog.py has something to read. (2) DAS_speedlog.py should be running. Test this way: :: ps -ef | grep DAS_speedlog.py The result should be something like this: :: adcp 26671 1449 0 20:43 ? 00:00:27 /usr/bin/python /usr/local/currents/bin/DAS_speedlog.py If DAS_speedlog.py is not running, check the log file and look at any warnings. :: less /home/adcp/log/DAS_speedlog.log less /home/adcp/log/DAS_speedlog.log.warn (3) If DAS_speedlog.py is running, then we should see the zmq feed. Test with the pub_addr variable: :: zmq_monitor.py -c 5 tcp://127.0.0.1:38020 The results should look like this: :: $VDVBW,0.09,-0.14,A,,,*31 $VDVBW,0.13,-0.15,A,,,*3B $VDVBW,0.19,-0.11,A,,,*35 $VDVBW,0.08,-0.20,A,,,*37 $VDVBW,0.11,-0.21,A,,,*3E $VDVBW,0.11,-0.20,A,,,*3F Speedlog is fundamentally working. You can also test the other outputs from the speedlog configuration (from the example above) Serial: (eg) ttyUSB1 (use a null-modem cable and an empty port, or another computer) UDP: :: udp_show.py -n5 192.168.0.255:34567 Troubleshooting web_speedlog.py ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Verify that the zmq feed from DAS_speedlog.py is present (see above) tcp://127.0.0.1:38020 Look in the /home/adcp/log directory for the logfile and warnings. Most common error is an incorrect ethernet port in the speedlog block of sensor_cfg.py, or a change in networking after the computer was restarted. :: less /home/adcp/log/web_speedlog.log less /home/adcp/log/web_speedlog.warn Try restarting web_speedlog.py: Identify the Process ID :: ps -ef | grep web_speedlog.py Results: PID is 1537 in the example (it’s the second column) :: root 1537 1259 0 Aug01 ? 00:00:00 su adcp -l -c /usr/local/currents/bin/web_speedlog.py (2) kill the process :: sudo kill 1537 (3) Start web_speedlog.py again -- do this in a screen session :: screen # start a screen session web_speedlog.py # start web_speedlog.py Control-a d # to detach (4) Try refreshing the web browser page