Connecting openBCI GUI to Thonny(Python)

eliane_chantreeliane_chantre Rhode Island, US

I have an older version of the cyton board, so I don't have the headpiece. I just have the cyton board and the dongle and I am using 2 electrodes and a ground. since I am using a MacOS, I have the beta V6. I am struggling to get my openBCI to connect to my Thonny(Python). I also tried using the networking function and change the protocol to 'serial'. I also made the data 'TimeSeriesRaw' and changed the port to the '/dev/cu.usbserial-DQ00847E' this also did not work either, am I looking at the right place?. Are there any tips you can give on how I can try to connect the data from openBCI to Thonny?

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Eliane,

    With the GUI Networking Widget, you have four choices of output format:

    • Serial
    • UDP
    • LSL
    • OSC

    Networking Widget page:

    https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#networking

    The Serial output is more intended to stream serial mode data to an attached Arduino board. It is not the best choice to be used in your case of a Python app on the same computer. That leaves UDP, LSL, and OSC. These ALSO are not a good choice for beginners since you must be familiar with Python library calls to accept data streams in UDP, LSL or OSC.

    A better option for you would be to skip the GUI entirely and use the example programs already written for you, in the Brainflow documentation. See:

    https://brainflow.org/
    https://brainflow.readthedocs.io/en/stable/Examples.html#python-get-data-from-a-board

    You can still use the GUI to test your setup before running your Python program. But you would then quit the GUI and start your Python. You can use output print statements to track the progress of what your Python is doing. Sample program shows some examples.

    William

  • eliane_chantreeliane_chantre Rhode Island, US

    Hey William, Thank you very much for your help!
    To clarify, is the code on BrainFLow a way for me to take live data and save it somewhere else?
    Also when I was on Thonny I copied the "Python Get Data from Board "code from BrainFlow and I got an error message saying that I needed the 'board ID'. But when I looked it up it told us that the board ID should be zero. I replaced "--board-id" with "0", "--board-id 0", and "board-i0" and it was still giving us the error message, so is there a specific ID for the cyton board?
    This is the message I am getting on Thonny
    " usage: -c [-h] [--timeout TIMEOUT] [--ip-port IP_PORT] [--ip-protocol IP_PROTOCOL] [--ip-address IP_ADDRESS]
    [--serial-port SERIAL_PORT] [--mac-address MAC_ADDRESS]
    [--other-info OTHER_INFO] [--serial-number SERIAL_NUMBER] --board-id
    BOARD_ID [--file FILE] [--master-board MASTER_BOARD]
    -c: error: the following arguments are required: --board-id

    Process ended with exit code 2."

    Thank you so much for your help!

  • wjcroftwjcroft Mount Shasta, CA

    @eliane_chantre said:
    ...
    To clarify, is the code on BrainFLow a way for me to take live data and save it somewhere else?

    The front of the documentation is here, suggest you read through some of it.

    https://brainflow.readthedocs.io/en/stable/index.html

    Brainflow is a library, like any other Python library, that has function calls. These calls fetch the data stream from the Cyton board. And allow you to process it in varous ways, such as bandpass filtering, FFT, band powers, etc.

    Also when I was on Thonny I copied the "Python Get Data from Board "code from BrainFlow and I got an error message saying that I needed the 'board ID'. But when I looked it up it told us that the board ID should be zero. I replaced "--board-id" with "0", "--board-id 0", and "board-i0" and it was still giving us the error message, so is there a specific ID for the cyton board?

    Your Cyton has a specific board id, read about it here:

    https://brainflow.readthedocs.io/en/stable/SupportedBoards.html#cyton

    You must edit the sample code examples and put in your own board id and COM port.

Sign In or Register to comment.