Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems in data streaming using Brainflow using muse2 #199

Open
Parvfect opened this issue Jul 26, 2022 Discussed in #198 · 10 comments
Open

Problems in data streaming using Brainflow using muse2 #199

Parvfect opened this issue Jul 26, 2022 Discussed in #198 · 10 comments

Comments

@Parvfect
Copy link
Collaborator

Parvfect commented Jul 26, 2022

Discussed in #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

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
Copy link
Collaborator

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

@Parvfect
Copy link
Collaborator Author

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

@JohnGriffiths
Copy link
Collaborator

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:

  • fresh clone of eeg-notebooks (rename as '_temp' or '_v2' or whatev)
  • go in to folder, create new environment, activate environment, pip install -e .
  • Turn on muse
  • On command line eegnb checksigqual -ed muse2_bfn
  • If not working: repeat a few times; make sure bluetooth is on
  • If you get errors from this, please share screenshot here.

@Parvfect
Copy link
Collaborator Author

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

@JohnGriffiths
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator

Next steps on this:

  • try again a few times; reset computer, turn off bluetooth, reset muse, etc.

  • do you have another computer you could try this on by any chance?

  • if problem still persists then post issue in brainflow-dev/brainflow github repo with the screenshot you took using the brainflow calls directly. Key information here would be if the enable_dev_board_logger has added any usable error info, such as a text snippet with error number or message or something

  • drop link to the brainflow-posted issue in comment on this thread, and also link back to this thread on the brainflow issue. Also repeat the brainflow issue post, at least in part, on this thread for clarity.

  • I believe brainflow has been having some issues with some Windows 11 releases. Solution may be to compile brainflow locally, rather than pip install. A bit of a drag but not a huge deal, easy to do. Let's see what Andrey says.

@Parvfect
Copy link
Collaborator Author

Parvfect commented Aug 3, 2022

brainflow-dev/brainflow#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
Copy link
Collaborator Author

Parvfect commented Aug 3, 2022

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.

@Parvfect Parvfect changed the title Problems in data streaming Muse2 for N170 and P300 Problems in data streaming using Brainflow Aug 3, 2022
@oreHGA oreHGA changed the title Problems in data streaming using Brainflow Problems in data streaming using Brainflow using muse2 Aug 10, 2022
@oreHGA
Copy link
Collaborator

oreHGA commented Apr 27, 2023

Summary:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants