trouble connecting Cyton from Brainflow...

IgnasIgnas London, UK
edited June 2023 in Software

Dear Community,
I have been interested in OpenBCI for a while - I think since kickstarter. I got my Cyton back in 2019, thought of using in my personal sleep research, but now decided to try working on brain-computer interface for people with disabilities as I have RSI and sometimes in interferes with my ability on using computer. I have coded some simple applications, but they seem to get stuck on board.prepare_session() whereby on OpenBCI GUI it seems to work ok.

    def __init__(self, endpoint):
        print("Initializing OpenBCIInterface")
        self.params = BrainFlowInputParams()
        self.params.serial_port = endpoint
        self.board_id = BoardIds.CYTON_BOARD.value # BoardIds.SYNTHETIC_BOARD.value #
        self.board = BoardShim(self.board_id, self.params)

    def start(self):
        print("Preparing OpenBCI session")
        self.board.prepare_session()  # No arguments needed

I have tried waiting for this hangup, but does not seem to help. Last things I see are:

Preparing OpenBCI session
[2023-06-22 00:29:33.897] [board_logger] [info] incoming json: {
    "file": "",
    "file_anc": "",
    "file_aux": "",
    "ip_address": "",
    "ip_address_anc": "",
    "ip_address_aux": "",
    "ip_port": 0,
    "ip_port_anc": 0,
    "ip_port_aux": 0,
    "ip_protocol": 0,
    "mac_address": "",
    "master_board": -100,
    "other_info": "",
    "serial_number": "",
    "serial_port": "/dev/tty.usbserial-DM01MT17",
    "timeout": 0
}
[2023-06-22 00:29:33.897] [board_logger] [info] opening port /dev/tty.usbserial-DM01MT17

I have reasoned that this is due to old firmware. And as such have decided to try to upgrade it using my mac. However when installing chipKit I am getting this error:

Downloading packages
chipKIT:[email protected]
chipKIT:[email protected]
chipKIT:drivers-windows@v2
chipKIT:[email protected]
Installing chipKIT:[email protected]
Failed to install platform: chipKIT:pic32.
Error: 13 INTERNAL: Cannot install tool chipKIT:[email protected]: searching package root dir: no unique root dir in archive, found '/Users/XXX/Library/Arduino15/tmp/package-2965254598/bin' and '/Users/XXX/Library/Arduino15/tmp/package-2965254598/lib'

It sounds like an issue with the package. Any thoughts on this?
I appreciate any help.

Comments

  • IgnasIgnas London, UK

    I have tried this on a few versions of Mac OS including 12.6.6, versions of Arduino and chipKit

  • wjcroftwjcroft Mount Shasta, CA

    Ignas, hi.

    NOT recommended to reload firmware. The 2019 boards already have the latest firmware. The fact that GUI is working fine is further confirmation that firmware is ok.

    To better confirm that your Python applications (using Brainflow library) are correctly working, have you tried running some of the examples on the Brainflow docs site?

    https://brainflow.readthedocs.io/en/stable/Examples.html#python

    In your example above, it appears you have not set the Cyton dongle serial port. Without this the library cannot find the Cyton. On Windows, serial ports have names like COM3, COM4, etc. On Mac, they are device names in the /dev/ folder.

    William

  • wjcroftwjcroft Mount Shasta, CA
    edited June 2023

    Related thread, with serial port name examples. Ganglion not Cyton, but serial ports have similar names.

    https://openbci.com/forum/index.php?p=/discussion/3209/brainflow-failed-to-open-ganglion-device-error-resolved

    You can view the /dev/___ name that GUI selects from the menus.

  • IgnasIgnas London, UK
    edited June 2023

    Thank you, I will try the examples out, but I think the name is set as per above log:

        "serial_port": "/dev/tty.usbserial-DM01MT17",
    
  • IgnasIgnas London, UK

    I have reproduced the issue with the example code, but then I have looked into the device the OpenBCI GUI was connecting and saw it was different from the one I was connecting. I was connecting to /dev/tty.usbserial-DM01MT17 and the GUI was connecting to /dev/cu.usbserial-DM01MT17. Changing the device seems to have resolved the issue of getting stuck on opening port

Sign In or Register to comment.