SeisComP / seedlink

Seedlink server to be built within SeisComP
Other
13 stars 17 forks source link

write of correct seedlink config for station with 2 dataloggers no longer works #16

Open grapagnani opened 2 hours ago

grapagnani commented 2 hours ago

Hello, I have a station BE.MEM for which I was able to simultaneously get seedlink streams from 2 dataloggers when using SC3 2017.334.05. I am now running SeisComP 6.5.0 on Ubuntu 24.04 and it no longer works.

This is my seedlink key file (that I validated using seiscomp exec scconfig on SC 6.5.0):

# Activated plugins for category sources
sources = chain0:chain,chain1:chain

# Hostname or IP of the Seedlink server.
sources.chain0.address = host55.example.com

# Port of the Seedlink server
sources.chain0.port = 18000

# List of stream selectors. If left empty all available streams will be
# requested. See slinktool manpage for more information.
sources.chain0.selectors = BDI

# Defines the input network if different from the stations
# network. Usually leave this parameter unconfigured. If
# configured and different from the stations network code
# the network code will be renamed to match the local network
# code.
sources.chain0.network = SG

# Defines the input station if different from the stations
# code. Usually leave this parameter unconfigured. If
# configured and different from the stations code
# the station code will be renamed to match the local station
# code.
sources.chain0.station = MEMB

# Hostname or IP of the Seedlink server.
sources.chain1.address = host55.example.com

# Port of the Seedlink server
sources.chain1.port = 10800

# List of stream selectors. If left empty all available streams will be
# requested. See slinktool manpage for more information.
sources.chain1.selectors = !EX?,!GEL,!GLA,!GLO

After 1 hour from starting seedlink, the BDI stream is still not retrieved by seedlink.

In the seedlink.log file, I see the message: chain0: /home/seedlink/seiscomp/var/lib/seedlink/chain0.xml:70: station ID BE.MEM is already in use

Indeed, in the chain0.xml, I notice twice the BE.MEM id:

...
  <group address="host55.example.com:10800"
         seqfile="/home/seedlink/seiscomp/var/run/seedlink/membach.oma.be:10800.seq"
         lockfile="/home/seedlink/seiscomp/var/run/seedlink/membach.oma.be:10800.pid"
         batchmode="yes">
    <station id="BE.MEM" name="MEM" network="BE" selectors="!EX? !GEL !GLA !GLO"/>
  </group>
  <group address="host55.example.com:18000"
         seqfile="/home/seedlink/seiscomp/var/run/seedlink/membach.oma.be:18000.seq"
         lockfile="/home/seedlink/seiscomp/var/run/seedlink/membach.oma.be:18000.pid"
         batchmode="yes">
    <station id="BE.MEM" name="MEMB" out_name="MEM" network="SG" out_network="BE" selectors="BDI"/>
    <station id="BE.MEMS" name="MEMS" network="BE" selectors=""/>
  </group>
...

With SC3 2017.334.05, the two groups above were split respectively into chain1.xml and chain0.xml files. And the seedlink.ini would cause spawning 2 chain plugins thanks this configuration:

* template: /home/seedlink/seiscomp/share/templates/seedlink/chain/seedlink_plugin.tpl
plugin chain0 cmd="/home/seedlink/seiscomp/share/plugins/seedlink/chain_plugin -v -f /home/seedlink/seiscomp/var/lib/seedlink/chain0.xml"
             timeout = 600
             start_retry = 60
             shutdown_wait = 15
* template: /home/seedlink/seiscomp/share/templates/seedlink/chain/seedlink_plugin.tpl
plugin chain1 cmd="/home/seedlink/seiscomp/share/plugins/seedlink/chain_plugin -v -f /home/seedlink/seiscomp/var/lib/seedlink/chain1.xml"
             timeout = 600
             start_retry = 60
             shutdown_wait = 15

On SC 6.5.0, I manually adapted chain0.xml, seedlink.ini files and created chain1.xml, mimicing the config on SC3 2017.334.05, and now seedlink does retrieve the seedlink streams from both datalogger simultaneously.

I had a look in the forum and the closed issues, as well the changelog in 6.5.1, I was not able to find any info about a similar issue. Is this a known issue ?

gempa-jabe commented 2 hours ago

I think in your case it uses sources.chain0.station as key and does not split the instances because MEM and MEMB are different. Could you try to replace sta with seedlink.sta in https://github.com/SeisComP/seedlink/blob/master/templates/chain/setup.py#L193?

luca-s commented 2 hours ago

It looks like this commit is the culprit.

The goal of that commit was to split the data from the same datalogger to 2 separate stations. Your goal, instead, is to join 2 dataloggers in one station. I didn't consider that scenario when I created the PR.

gempa-jabe commented 2 hours ago

So we could use as index a combination of both:

station_key = seedlink.net + "." + seedlink.sta + "." + sta

That should split in both cases.

grapagnani commented 1 hour ago

Setting the key like this: station_key = seedlink.net + "." + seedlink.sta + "." + sta still doesn't split.

Reverting the commit 8d10769 does produce the split.