NeuroTechX / EEG-ExPy

EEG Experiments in Python
https://neurotechx.github.io/EEG-ExPy/
BSD 3-Clause "New" or "Revised" License
420 stars 124 forks source link

Problems in data streaming using Brainflow using muse2 #199

Open Parvfect opened 1 year ago

Parvfect commented 1 year ago

Discussed in https://github.com/NeuroTechX/eeg-notebooks/discussions/198

Originally posted by **Parvfect** July 26, 2022 I am trying to run the N170 experiment, and it seemed to be working perfectly before and I have some good data from then. I am not sure what I changed, but the instruction screen seems to come up twice, the second time after running the main experiment for a few seconds. About two images get displayed when the same screen comes up for the second time. The code used is the following ```python from eegnb.devices.eeg import EEG from eegnb.experiments.visual_n170 import n170 board_name = 'muse2' record_duration = 120 eeg_device = EEG(device=board_name) n170.present(duration=record_duration, eeg=eeg_device) ``` And the runtime error is the following, issue_1 issue_2 issue_3 I am not very clear why this is happening and would really apprectiate some help. I was testing the ExperimentSubClass2 branch when this happened and switched to Master and got the same issue.
JohnGriffiths commented 1 year ago

Can you repeat and show screen outputs for device = muse2_bfn ?

Parvfect commented 1 year ago

I get a key-error when I run with muse2_bfn as the device. Am I doing something wrong?

JohnGriffiths commented 1 year ago

Yes something not right if you're using the above script and getting a key error.

We need to get back to step 1.

Please try:

Parvfect commented 1 year ago

So it works with muse2 (the signal quality check), but if I do muse2_bfn, I get this

image
JohnGriffiths commented 1 year ago

Do you mean it works with muse2 when bluemuse is running?

Try one more time: close conda terminal, close bluemuse, open new conda terminal, run _bfn signal check.

(Brainflow can get confused if there's been other recent communication with the device by currently running programs)

Parvfect commented 1 year ago

Yeah so it works with bluemuse and muse2. On closing bluemuse and independently running brainflow via the _bfn run check, I get this error as before image

JohnGriffiths commented 1 year ago

Next steps on this:

Parvfect commented 1 year ago

https://github.com/brainflow-dev/brainflow/issues/531

Issue opened in Brainflow

Unable to prepare the streaming session after finding Muse2 using direct calls to Brainflow.

Code:

from brainflow.board_shim import BoardShim, BoardIds, BrainFlowInputParams

params = BrainFlowInputParams()
board_id = BoardIds.MUSE_2_BOARD

board = BoardShim(board_id, params)
board.enable_dev_board_logger()

board.prepare_session()

Screenshot of Error image

Parvfect commented 1 year ago

Original problem with respect to data streaming has been solved by using BlueMuse backend. The problem was that my file had an open call to streaming which was fixed by adding the following,


if __name__ == '__main__':
    # Do the Experiment

However, setting up a streaming session using Brainflow is still unresolved and listed above.

oreHGA commented 1 year ago

Summary: