alexandrebarachant / muse-lsl

Python script to stream EEG data from the muse 2016 headset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection to Muse S Gen 2 Hangs on 'Connecting to XX:XX:XX:XX:XX:XX...'

chadcwilliams opened this issue · comments

Hello,

Has anyone encountered this issue?

I am on a Windows 11 and the device is found and a connection to the device initiated Connecting to XX:XX:XX:XX:XX:XX... but then it hangs here without saying
Connected.
Streaming EEG...

I have example code below, and this code does work on other computers, so I am curious if anyone else might have an intuition on what might cause the hang. Please note that I am not interested in using BlueMuse as muselsl suggests with Windows because I want to avoid third-party applications from popping up but also because it has a major bug in the last two versions (2.3, 2.4) that makes the muse sampling rate fall off.

#Import packages
import multiprocessing
from muselsl.stream import list_muses, stream

#Find devices and first device's address
eeg_devices = list_muses(backend='bleak')
eeg_address = eeg_devices[0]['address']

#Connect to the device using multiprocessing
eeg_outlet = multiprocessing.Process(target=stream, args=(eeg_address, 'bleak'))
eeg_outlet.start()

Thanks!

For anyone encountering the same issue, this turns out to be a bug in the Windows 11 OS (so your code will work on Windows 10 but not 11) when using the Bleak backend.

I tracked this issue out of MuseLSL and into Bleak. Bleak does not work on Windows 11 when pywin32 or pkg_resources (which is a dependency of setuptools) modules are installed in your environment. If you can remove these packages, then that could solve your problem. hbldh/bleak#1262