[Mne_analysis] Error with LSLClient

Ben Ighoyota Ajenaghughrure ighoyota at tlu.ee
Fri Aug 2 04:03:46 EDT 2019
Search archives:

        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 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:
        client_info = client.get_measurement_info()
        sfreq = int(client_info['sfreq'])
        # let's observe ten seconds of data
        for ii in range(n_epochs):
            print('Got epoch %d/%d' % (ii + 1, n_epochs))
            plt.cla()
            epoch = client.get_data_as_epoch(n_samples=sfreq, Picks='Audio')
            epoch.average().plot(axes=ax)
            plt.pause(1.)
        plt.draw()
print('Streams closed')

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

Warning (from warnings module):
  File "C:\Program Files
(x86)\Python37-32\lib\site-packages\mne\utils\docs.py", line 622
    warnings.warn(msg, category=DeprecationWarning)
DeprecationWarning: Class LSLClient is deprecated; The realtime module is
being deprecated from `mne-python` and moved to its own package,
`mne-realtime`. To install, please use `$ pip install mne_realtime`.
Client: Waiting for server to start
Traceback (most recent call last):
  File "C:\Users\default.DMXIA_SIMO83\Desktop\DATA WARE PROJECT\test.py",
line 12, in <module>
    with LSLClient(info=None,host='localhost', port=None, tmin=None,
tmax=2, buffer_size=1000, verbose=None) as client:
  File "C:\Program Files
(x86)\Python37-32\lib\site-packages\mne\realtime\base_client.py", line 76,
in __enter__
    raise RuntimeError('Could not connect to Client.')
RuntimeError: Could not connect to Client.


Looking forward to your reply

Best Regards
A. Ighoyota ben
Junior Researcher HCI (PhD in-view)
Tallinn University, Estonia
School of digital Technologies.
mobile:+372582 <+372%205832%206393>78794
skype: ighoyota-ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190802/ebf96e44/attachment-0001.html 


More information about the Mne_analysis mailing list