alexandrebarachant / muse-lsl

Python script to stream EEG data from the muse 2016 headset
BSD 3-Clause "New" or "Revised" License
627 stars 183 forks source link

Issue in code when connecting to Muse 2 #156

Open aryanthomare opened 3 years ago

aryanthomare commented 3 years ago

Hi, I tried running the given code in the GitHub explanation,

from muselsl import stream, list_muses

muses = list_muses() print(muses) stream('The Mac address is here')

print('Stream has ended')

But when it runs, it gives this error,

Traceback (most recent call last): File "C:/Users/aryan/PycharmProjects/Muse/mtest.py", line 5, in stream('00-55-da-b5-61-ff') File "C:\Users\aryan\PycharmProjects\Muse\venv\lib\site-packages\muselsl\stream.py", line 170, in stream while time() - muse.last_timestamp < AUTO_DISCONNECT_DELAY: AttributeError: 'Muse' object has no attribute 'last_timestamp'

Does anyone have any idea why this is happening? I just want to get real-time data from my Muse 2.

jdpigeon commented 3 years ago

Thanks for reporting this. I'm not sure why this is happening, but can look into it soon. In the meantime, can you connect to your Muse when using the CLI? e.g. muselsl stream from the terminal.

buyuk-dev commented 3 years ago

This seems to be windows-only, so I looked at the muselsl.py/muse.py and in the Muse::connect() method for the BlueMuse the last_timestamp field was not set resulting in race resulting in this error. Here is my fix suggestions: https://github.com/alexandrebarachant/muse-lsl/pull/167