EEG-ExPy icon indicating copy to clipboard operation
EEG-ExPy copied to clipboard

Problems with saving data file using brainflow

Open larastellamarie opened this issue 1 year ago • 2 comments

Hello,

I am currently trying to record data with the Muse 2 using the SSAEP experiment and a MMN experiment. When I run them apart using brainflow everything goes fine. Now I tried running the two experiements shortly after each other which results in only one data file being saved. The other experiment runs but does not save a data file in the end and produces this error:

[2023-05-17 22:13:08.678] [board_logger] [error] failed to send command h to device Traceback (most recent call last): File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\Scripts\eegnb.exe_main.py", line 7, in File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\click\core.py", line 1130, in call return self.main(*args, **kwargs) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\click\core.py", line 760, in invoke return _callback(*args, **kwargs) File "C:\Users\Asus\eeg-notebooks\eegnb\cli_main.py", line 90, in runexp run_experiment(experiment, eeg, recdur, outfname) File "C:\Users\Asus\eeg-notebooks\eegnb\cli\utils.py", line 56, in run_experiment module.present(duration=record_duration, eeg=eeg_device, save_fn=save_fn) # type: ignore File "C:\Users\Asus\eeg-notebooks\eegnb\experiments\auditory_ssaep\ssaep_onefreq.py", line 117, in present eeg.stop() File "C:\Users\Asus\eeg-notebooks\eegnb\devices\eeg.py", line 429, in stop self._stop_brainflow() File "C:\Users\Asus\eeg-notebooks\eegnb\devices\eeg.py", line 317, in _stop_brainflow self.board.stop_stream() File "C:\Users\Asus\anaconda3\envs\eeg-notebooks\lib\site-packages\brainflow\board_shim.py", line 1211, in stop_stream raise BrainFlowError('unable to stop streaming session', res) brainflow.exit_codes.BrainFlowError: BOARD_WRITE_ERROR:4 unable to stop streaming session

If I use bluemuse everything works fine. I don´t think that it has anything to do with the order (sometimes the first experiment elicits an error and sometimes the second) or the experiment itself. Any advice how I can avoid this problem?

larastellamarie avatar May 20 '23 20:05 larastellamarie