connection to seedlink and query

Hi,
I have a question for you related to seedlink connection using python. My code is below:

from obspy.clients.seedlink.easyseedlink import *
from obspy.clients.seedlink import EasySeedLinkClient
import xml.dom.minidom

from obspy.core import trace

def on_data(trace):
    print(trace.stats.station)
    print(trace.stats.endtime)
    print()
    on_terminate()

def on_terminate():
    exit()

client = create_client('[10.15.0.238:18000](http://10.15.0.238:18000/)', on_data, on_terminate=on_terminate)
client.select_stream('GF', 'BOZB', 'EL?')
client.run()

When I run the above code, It goes into an infinite loop in the on_data function. How can I resolve this?
Best regards,
Recai.

Hello Recai,

I tried replacing your client with my own and your code worked…

client = create_client(‘rtserve.ida.ucsd.edu:18000’, on_data, on_terminate=on_terminate)
client.select_stream(‘II’, ‘BORG’, ‘BH?’)

I ran your code unchanged and it eventually returned the following…

obspy.clients.seedlink.seedlinkexception.SeedLinkException: ‘cannot connect to SeedLink server: [Errno 110] Connection timed out’

Not sure why it’s not connecting. Good luck.

SB

Hi Recai,

you can fetch real-time II data from IRIS:

rtserve.iris.washington.edu:18000

IRIS also provides archived data via FDSNWS.

Dirk