mindaffect/pymindaffectBCI

Update software now does not run.

Closed this issue · 3 comments

Hello I recently upgraded the mindaffectBCI python library and since then, the examples do not run. When I try to run the framrate check example I get the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/framerate_check.py", line 109, in <module>
    doFrameRateTest()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/framerate_check.py", line 100, in doFrameRateTest
    window = selectionMatrix.initPyglet(fullscreen=False)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 851, in initPyglet
    window.lastfliptime=getTimeStamp()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 815, in getTimeStamp
    return nt.getTimeStamp()
NameError: name 'nt' is not defined

and when I try to run the selection matrix I get

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 918, in <module>
    pyglet.app.run()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/pyglet/app/__init__.py", line 107, in run
    event_loop.run()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/pyglet/app/base.py", line 167, in run
    timeout = self.idle()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/pyglet/app/base.py", line 237, in idle
    redraw_all = self.clock.call_scheduled_functions(dt)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/pyglet/clock.py", line 255, in call_scheduled_functions
    item.func(dt, *item.args, **item.kwargs)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 859, in draw
    ss.draw(dt)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 688, in draw
    self.screen.draw(t)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/examples/presentation/selectionMatrix.py", line 568, in draw
    self.noisetag.updateStimulusState()
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/noisetag.py", line 455, in updateStimulusState
    self.stimulusStateMachineStack.next(t)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/noisetag.py", line 53, in next
    self.stack[-1].next(t)
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/noisetag.py", line 285, in next
    self.utopiaController.modeChange("Calibration.supervised")
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/utopiaController.py", line 118, in modeChange
    ModeChange(self.getTimeStamp(), newmode))
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/utopiaclient.py", line 818, in sendMessage
    self.sendRaw(msg.serialize()) # send the raw message directly
  File "/media/jadin/45ae8d0f-4043-48a9-b89c-31634a6d5989/Programming/AnotherEEGLib/venv/lib/python3.6/site-packages/mindaffectBCI/utopiaclient.py", line 803, in sendRaw
    raise IOError('Not connected to utopia server')
OSError: Not connected to utopia server

Despite my PC being connected to the decoders hot spot network.

Hi Jadin, we have been working towards releasing the fully open source version of our system. It seems as part it the we broke the master branch. There are 2 solutions I can suggest for you for now:

  1. Revert to an earlier version of master. Say from early July.
  2. Become an early tester for our open source release by switching to the 'doc' branch. We are currently writing the documentation, but the cure functionality remains the same, with the addition of pure python codes for offline analysis of saved data, and an online pure python decoder (so you do not need the rasberry)

Hi Jason, with all due respect I would like to get the core functionality working before becoming an early tester. I only upgraded to the new branch at your recommendation that it would fix my problems with the stimulus timing. I already tried reverting back to the old branch and I am getting issues still. I will outline them here.

  1. I took the Decoder somewhere that I could connect it to the internet and update it. While the decoder was able to connect to the internet, I was not able to update the software as it kept giving me an error about server permissions no matter how many times I retried.
  2. The the --framesperbit option only accepts integer values. While this is fine for my 100 Hz monitor, as most monitors are 60Hz, the stimulus is unable to be time-scaled properly.
  3. I can not access the data on the decoder to get the training data out like you requested earlier. When I open up the file explorer it just closes back down immediately.

Hi Jadin,

I understand, and again apologize for the issues with master. I've been looking at the issues and have fixed some issues and need additional input on others.

  1. For the framerate_check.py, this was indeed a mistake on our part, we have now fixed the issue, and if you update from the github this should now work correctly.

  2. For the connection issue in selectionMatrix.py. Unfortunately, we cannot replicate the issue. however I have an idea it may be caused by a mismatch between pip and github versions. If you update your pip version then I hope this will be resolved. You can do this by:
    python3 -m pip install --upgrade mindaffectBCI
    You should then upgrade to version 0.9.13

  3. Indeed the --framesperbit only accepts integer arguments -- this is by design as for frame-accurate timing we have to work in multiples of individual frames. However, this should be enough for your usage as the exact frame rate is not an significant parameter for our system -- (this is one of the indirect benefits of the 'noise-tagging' framework :-)). Thus, for a 100hz monitor I suggest --framesperbit 2, so the effective display rate is 50hz. For a 60hz display then the default of 1 will give a 60hz display.

  4. To access the data on the controller, the easiest way is via. the raspberry PI's configuration website. (which should be on http://10.0.0.5 when using the hostspot network.) On this page is a like to the data page which contains all the saved data from previous runs.

I hope this helps. We can also try a real-time support via gitter to make it more direct.