# Error with LSLClient

**URL:** <https://mne.discourse.group/t/error-with-lslclient/1909>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [August 2, 2019, 8:03am UTC](https://mne.discourse.group/t/error-with-lslclient/1909 "2019-08-02T08:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 2, 2019, 8:03am UTC](https://mne.discourse.group/t/error-with-lslclient/1909/1 "2019-08-02T08:03:46Z")

</div>

External Email - Use Caution

Dear Python MNE community,

I am new to real-time signal acquisition and need some help here.

I have installed LSL recorder and assumed this to be server. I want to  
acquire and process the bio-signals with Python MNE real-time LSLClient.  
However i keep getting some errors as shown below, i tried to do pip  
install mne\_realtime but that does not work for me either, i am not sure  
why it is failing to connect to server

I am assuming that the LSL recorder is the server, unless i am wrong,  
please then can someone point me to the right direction where i can i find  
the LSLserver for MNE

CODE  
import matplotlib.pyplot as plt  
from mne.datasets import sample  
from [mne.io](http://mne.io) import read\_raw\_fif  
from mne.realtime import LSLClient, MockLSLStream

print(\_\_doc\_\_)  
with LSLClient(info=None,host='localhost', port=None, tmin=None, tmax=2,  
buffer\_size=1000, verbose=None) as client:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client\_info = client.get\_measurement\_info()  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfreq = int(client\_info['sfreq'])  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# let's observe ten seconds of data  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ii in range(n\_epochs):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print('Got epoch %d/%d' % (ii + 1, n\_epochs))  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plt.cla()  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;epoch = client.get\_data\_as\_epoch(n\_samples=sfreq, Picks='Audio')  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;epoch.average().plot(axes=ax)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plt.pause(1.)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plt.draw()  
print('Streams closed')

\*OUTPUT\*  
== RESTART: C:\Users\default.DMXIA\_SIMO83\Desktop\DATA WARE PROJECT\test.py

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 2, 2019, 1:45pm UTC](https://mne.discourse.group/t/error-with-lslclient/1909/2 "2019-08-02T13:45:16Z")

</div>

External Email - Use Caution

Hi Ighoyot,

I suspect you might not have configured the host and port correctly. cc-ing  
Teon as he's the expert on the LSL client. Can you give us the full steps  
to reproduce? How did you configure your LSL recorder?

Mainak
