OpenBCI_LSL errors with Ganglion

squadussquadus Los Angeles
edited July 2018 in Ganglion

Hello, after turning on my Ganglion board and dongle, I run the command:

python openbci_lsl.py --stream

and it outputs the following:

-------INSTANTIATING BOARD-------
Traceback (most recent call last):
File "openbci_lsl.py", line 56, in 
main(sys.argv[1:])
File "openbci_lsl.py", line 40, in main
lsl = streamerlsl.StreamerLSL(GUI=False)
File "C:\Program Files\MATLAB\OpenBCI_LSL\lib\streamerlsl.py", line 46, in init
self.initialize_board(autodetect=True)
File "C:\Program Files\MATLAB\OpenBCI_LSL\lib\streamerlsl.py", line 59, in initialize_board
self.board = bci.OpenBCIBoard()
File "C:\Program Files\MATLAB\OpenBCI_LSL\lib\open_bci_v3.py", line 77, in init
port = self.find_port()
File "C:\Program Files\MATLAB\OpenBCI_LSL\lib\open_bci_v3.py", line 574, in find_port
raise OSError('Cannot find OpenBCI port')
OSError: Cannot find OpenBCI port

On this page: http://docs.openbci.com/3rd%20Party%20Software/04-LSL 


One of the examples is python openbci_lsl.py /dev/ttyUSB0 --stream


However, this also outputs the same error. I have tried many different variations including the ones here http://www.fieldtriptoolbox.org/development/realtime/openbci


Does anyone know how to figure out what file/root the port number is on a Windows laptop computer?  and also the syntax for including the port number on command line? 


Comments

  • wjcroftwjcroft Mount Shasta, CA
    Squadus, hi.

    The repository here,


    Only works with the Cyton board, not Ganglion. Cyton uses a serial port, Ganglion does not.

    There is an LSL widget in the OpenBCI_GUI that can output an LSL stream, from Ganglion. Can you try that?

    You can also try a forum search such as:


    Regards,

    William
  • squadussquadus Los Angeles
    edited July 2018
    Thanks William,

    Are you saying that the Lab Streaming Layer only works with the Cyton board? I purchased a Ganglion board to connect to the Ultracortex Mark IV. Where is this widget for LSL on the OpenBCI documentation for Ganglion?

    On the product page it doesn't say anything about LSL compatibility.


    Has anyone else been able to connect their Ganglion board to LSL?
  • wjcroftwjcroft Mount Shasta, CA
    http://docs.openbci.com/OpenBCI Software/01-OpenBCI_GUI#the-openbci-gui-cool-gui-features

    There is a search button and box in the right column


    The LSL widget is a feature of the GUI and can stream out to your Matlab. Thus the widget works with all OpenBCI boards.

    There are other ways to create an LSL stream from Python,


    But might require you to run Linux instead of Windows for the Python interface. See some of the forum threads, Windows hardware has lots of variability in the OS stack support for Bluetooth.
  • squadussquadus Los Angeles
    Thank you! I will try it out.
  • squadussquadus Los Angeles
    Can you point out where the LSL widget is inside of the OpenBCI_GUI with a screenshot? 

    I have installed the latest versions of Processing, OpenBCI_GUI, and OpenBCI_Hub.

    Thanks
  • squadussquadus Los Angeles
    edited July 2018
    [__init__() got an unexpected keyword argument 'print_enable']

    I got this error while entering `python openbci_lsl.py` to run the GUI for LSL. Here is the full error:
    image

    Does anyone know how to help?
  • wjcroftwjcroft Mount Shasta, CA
    edited July 2018
    Hi @squadus, I merged your new thread into this existing thread.

    Didn't you try running your Ganglion with the OpenBCI_LSL repository previously? See previous posts. This repository only works with Cyton, which uses a serial port. Ganglion does NOT use a serial port.

    You CAN use this repo below with Ganglion, but some comments indicate it may only work with Linux, not Windows,


    Alternately, as mentioned before, you can output LSL from the GUI using the Networking / LSL widget.

    Am I understanding you correctly?

    Regards,

  • squadussquadus Los Angeles
    edited July 2018
    Previously, I was unable to get the LSL GUI to work. Now the LSL GUI opens when I enter "python openbci_lsl.py", although it returns __init__() got an unexpected keyword argument 'print_enable'. 

    In regards to my original question on this thread, I found my port number and it is COM3.

    Now, when I output LSL from the OpenBCI_GUI using the Networking / LSL widget, both streams say they are on, however, this is no output.

    I am using the command line to verify if the OpenBCI_GUI LSL output is working.......is there another way? The above screenshot is the return I receive currently. How can I verify that the OpenBCI_GUI LSL stream is working with Ganglion? 

    EDIT: I also posted this on GitHub. Maybe this belongs in the Networking thread.
  • squadussquadus Los Angeles
    Do you have a tutorial for LSL that works with Ganglion?
  • wjcroftwjcroft Mount Shasta, CA
    edited July 2018
    Only Cyton uses the COM port. If you have Ganglion it DOES NOT use a COM port. So I'm not sure where you are getting the "COM3" you mention. The OpenBCI_LSL Github repository is CYTON ONLY. Whereas the OpenBCI_Python repository can talk both Cyton and Ganglion. But Ganglion I believe only works with Linux not Windows.

    re: 'tutorial'. Follow the instructions in the repo.


    ---

    re: verifying OpenBCI_GUI LSL stream output to Matlab. I previously gave you a bunch of links on the other thread, which included the Matlab + Win64 binaries:


    What is it that you are trying to accomplish after you get the LSL streaming from GUI to Matlab? Are there other tools that might help, such as OpenViBE, which can also consume LSL streams from the GUI?



  • squadussquadus Los Angeles
    Per the instructions, is there a specific package I need to run/setup?
  • wjcroftwjcroft Mount Shasta, CA
    Maybe the OpenViBE would be easiest for you, since it comes with a Windows installer. You will still have to understand how to use their tutorials.


  • squadussquadus Los Angeles
    edited July 2018
    Thank you for the MATLAB binaries. 

    re: 'tutorial'. Follow the instructions in the repo.


    I would like clarification. I am confused as to which settings I need to configure and/or install files inside the OpenBCI_Python repo. Are there specific functions or variables I need to edit/write in order to connect my Ganglion to LSL with the new OpenBCI_Python repo ? Or would I need to move some folders?
  • squadussquadus Los Angeles
    Btw, would a WiFi shield solve the serial connection / bluetooth error I am having?
  • wjcroftwjcroft Mount Shasta, CA
    No. OpenBCI_LSL ONLY WORKS WITH THE CYTON SERIAL PORT.
  • squadussquadus Los Angeles
    I see. Thank you.

    Building on your previous answer to my original post, I moved the OpenBCI_Python repo into my MATLAB folder instead of the OpenBCI_LSL folder. 

  • squadussquadus Los Angeles
    Hi William,

    After looking at the documentation further it turns out that the Ganglion uses the MAC address to connect via ports, not the Linux operating system.


    Thanks again for your help. Have a great day.
  • wjcroftwjcroft Mount Shasta, CA
    Yes, previous posts in the thread say the same thing: OpenBCI_Python can connect to Ganglion, but this has only been shown to work on Linux.

    "uses the MAC address to connect via ports", Yes, Ganglion access is via MAC address. Cyton access is via a COM port. "MAC address" and "ports" are two different animals.
  • squadussquadus Los Angeles
    Appreciate the help. I have entered the MAC address into the user.py for the port number. How can I get the board to run from this point forward?
  • wjcroftwjcroft Mount Shasta, CA
    Squadus, hi.

    You seem to have a continuing confusion with the repo you need to use. OpenBCI_LSL WILL NOT AND WILL NEVER WORK with Ganglion. Only use OpenBCI_Python repo, and it requires Linux (not Wine with Windows). Here's a tutorial that recently turned up on another thread.


    I realize this is Ganglion and OpenViBE, and you really want Ganglion and Matlab, but this would give you a start.

    William
  • squadussquadus Los Angeles
    Thank you William for all the help. I really appreciate you and all you do for the community. 

  • Hi 

    Sir, I tried the below code in python for streaming using LSL and I have a cyton board - the code is

    python openbci_lsl.py --stream 

    But it shows the same error as for @squadus mention in the start of this discussion like - 

    -------INSTANTIATING BOARD-------
    Traceback (most recent call last):
      File "openbci_lsl.py", line 56, in <module>
        main(sys.argv[1:])
      File "openbci_lsl.py", line 40, in main
        lsl = streamerlsl.StreamerLSL(GUI=False)
      File "/home/mtp-1/pro/EEG2IMG/openbci/OpenBCI_LSL-master/lib/streamerlsl.py", line 46, in __init__
        self.initialize_board(autodetect=True)
      File "/home/mtp-1/pro/EEG2IMG/openbci/OpenBCI_LSL-master/lib/streamerlsl.py", line 59, in initialize_board
        self.board = bci.OpenBCIBoard()
      File "/home/mtp-1/pro/EEG2IMG/openbci/OpenBCI_LSL-master/lib/open_bci_v3.py", line 77, in __init__
        port = self.find_port()
      File "/home/mtp-1/pro/EEG2IMG/openbci/OpenBCI_LSL-master/lib/open_bci_v3.py", line 574, in find_port
        raise OSError('Cannot find OpenBCI port')
    OSError: Cannot find OpenBCI port

    I am using Ubuntu 18.04 and python3. I downloaded the OpenBCI - Python LSL from the GitHub page and my dongle and board are switched on

    Kindly help me in this asap
  • wjcroftwjcroft Mount Shasta, CA
    Abhi, hi.

    Use the OpenBCI_Python repo, NOT OpenBCI_LSL. Python repo is much more up to date and maintained.

    William

Sign In or Register to comment.