OpenBCI GUI can't connect to Cyton board

QWERTY12345QWERTY12345 Canada
edited January 2020 in Cyton

I'm having trouble connecting the Cyton board with a USB dongle. I have the 4.1.7 version of OpenBCI_GUI and the 2.12.28 version of the virtual COM port driver found here. The operating system is windows 10 version 10.0.18362.
Console Log:

Console Log Started at Local Time: 2020-01-07_18-29-54
Screen Resolution: 1366 X 768
Welcome to the Processing-based OpenBCI GUI!
For more information, please visit: https://openbci.github.io/Documentation/docs/06Software/01-OpenBCISoftware/GUIDocs
Launching application from local data dir
OpenBCI_GUI: hubStart: OS Detected: Windows
TopNav: Internet Connection Successful
Local Version: 417, Latest Version: 417
GUI is up to date!
OpenBCI_GUI::Setup: Is RX mulitcast: false
OpenBCI_GUI::Setup: Has RX joined multicast: false
OpenBCI_GUI::Setup: Sample Data exists in Documents folder.
ControlP5 2.2.6 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
The file "C:\Users\UserName\Documents\OpenBCI_GUI\Settings\UserPlaybackHistory.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
OpenBCI_GUI::Control Panel: Playback history file not found or other error.
OpenBCI_GUI::Setup: Setup is complete!
Instantiating hub object...
Hub: CheckHubInit: The GUI is connected to the Hub!
Client SocketException: Connection reset
sourceList: click! 
setInterface: curInterface: -1
channel count set to 8
Setting Latency to 10000
Setting WiFi Internet Protocol to udpBurst
Setting WiFi style to dynamic
[DEFAULT]: Protocol Serial Selected for Cyton
setInterface: curInterface: 0
Setting sample rate for Cyton to 250Hz
sample rate set to: 250
java.lang.NullPointerException
    at processing.net.Client.write(Unknown Source)
    at processing.net.Client.write(Unknown Source)
    at OpenBCI_GUI$Hub.write(OpenBCI_GUI.java:12100)
    at OpenBCI_GUI$Hub.writeJSON(OpenBCI_GUI.java:11256)
    at OpenBCI_GUI$Hub.setProtocol(OpenBCI_GUI.java:12011)
    at OpenBCI_GUI$Cyton.setInterface(OpenBCI_GUI.java:1664)
    at OpenBCI_GUI$ControlPanel.CPmouseReleased(OpenBCI_GUI.java:4303)
    at OpenBCI_GUI.mouseReleased(OpenBCI_GUI.java:10424)
    at processing.core.PApplet.mouseReleased(PApplet.java:2842)
    at processing.core.PApplet.handleMouseEvent(PApplet.java:2751)
    at processing.core.PApplet.dequeueEvents(PApplet.java:2645)
    at processing.core.PApplet.handleDraw(PApplet.java:2486)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
    at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
serialList: click! 
[DEFAULT]: OpenBCI Port Name = COM5
Settings: LogFileMaxDuration = 60 minutes
initButtonPressed: Calling initSystem()
=================================================
||             INITIALIZING SYSTEM             ||
=================================================
java.lang.NullPointerException
    at processing.net.Client.write(Unknown Source)
    at processing.net.Client.write(Unknown Source)
    at OpenBCI_GUI$Hub.write(OpenBCI_GUI.java:12100)
    at OpenBCI_GUI$Hub.writeJSON(OpenBCI_GUI.java:11256)
    at OpenBCI_GUI$Hub.connectSerial(OpenBCI_GUI.java:11990)
    at OpenBCI_GUI$Cyton.<init>(OpenBCI_GUI.java:1677)
    at OpenBCI_GUI.initSystem(OpenBCI_GUI.java:829)
    at OpenBCI_GUI.initButtonPressed(OpenBCI_GUI.java:4627)
    at OpenBCI_GUI$ControlPanel.CPmouseReleased(OpenBCI_GUI.java:4194)
    at OpenBCI_GUI.mouseReleased(OpenBCI_GUI.java:10424)
    at processing.core.PApplet.mouseReleased(PApplet.java:2842)
    at processing.core.PApplet.handleMouseEvent(PApplet.java:2751)
    at processing.core.PApplet.dequeueEvents(PApplet.java:2645)
    at processing.core.PApplet.handleDraw(PApplet.java:2486)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
    at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
InitSettings: Saving Default Settings to file!
SoftwareSettings: 3 active widgets saved!
The file "C:\Users\UserName\Documents\OpenBCI_GUI\Settings\CytonUserSettings.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
InitSettings: C:\Users\UserName\Documents\OpenBCI_GUI\Settings\CytonUserSettings.json not found or other error.
[DEFAULT]: The new data source is LIVE (from Cyton  ) and NCHAN = [8]. User Settings Error: Default Settings Loaded.
[DEFAULT]: Attempting to establish a connection with your OpenBCI Board...
openBCI_GUI: haltSystem: Halting system for reconfiguration of settings...
Closing any open SD file. Writing 'j' to OpenBCI.
Disconnecting serial...
java.lang.NullPointerException
    at processing.net.Client.write(Unknown Source)
    at processing.net.Client.write(Unknown Source)
    at OpenBCI_GUI$Hub.write(OpenBCI_GUI.java:12100)
    at OpenBCI_GUI$Hub.writeJSON(OpenBCI_GUI.java:11256)
    at OpenBCI_GUI$Hub.disconnectSerial(OpenBCI_GUI.java:12001)
    at OpenBCI_GUI$Cyton.closePort(OpenBCI_GUI.java:1716)
    at OpenBCI_GUI$Cyton.closeSDandPort(OpenBCI_GUI.java:1711)
    at OpenBCI_GUI.haltSystem(OpenBCI_GUI.java:1163)
    at OpenBCI_GUI.systemDraw(OpenBCI_GUI.java:1394)
    at OpenBCI_GUI.draw(OpenBCI_GUI.java:584)
    at processing.core.PApplet.handleDraw(PApplet.java:2475)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
    at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
[DEFAULT]: Init timeout. Verify your Serial/COM Port. Power DOWN/UP your OpenBCI Board & Dongle, then retry Initialization.
The file "C:\Users\UserName\Documents\OpenBCI_GUI\Settings\UserPlaybackHistory.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
OpenBCI_GUI::Control Panel: Playback history file not found or other error.
ConsoleLog: Copying console log to clipboard!

Anyone else had this problem before?

Comments

  • I tried updating the firmware by following the instructions here but I got this error :

    Arduino: 1.8.10 (Windows 10), Board: "OpenBCI 32"
    Sketch uses 84904 bytes (69%) of program storage space. Maximum is 122880 bytes.
    Global variables use 10564 bytes (32%) of dynamic memory, leaving 22204 bytes for local variables. Maximum is 32768 bytes.
    An error occurred while uploading the sketch
    \\.\COM5: Cannot open
        Copyright: (C) 2011-2015 Serge Vakulenko
    
                       2016-2017 Majenko Technologies
    No target found.
    Programmer for Microchip PIC32 microcontrollers, Version 2.1.46
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    
  • wjcroftwjcroft Mount Shasta, CA
    edited January 2020

    Hello Q,

    Suggest updating the OpenGL graphics driver software on your laptop. This is especially important for older hardware, what is the manufacturer, model, date of your laptop?

    https://www.google.com/search?as_q=opengl&as_sitesearch=openbci.com

    OpenGL libraries are used by the Processing Language, in which the GUI is written.

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    Actually I take back that comment about the OpenGL possibly being the root of the error. None of the lines referencing OpenGL in the backtrace are showing an error status, only that that an opengl routine was called.

    Instead it looks like the GUI is hitting some snag as it is trying to do a network write (of commands) to the Hub. Then the connection is broken and the null pointer results. But earlier it does say that the Hub was started ok.

    Are you sure that you followed the instruction to set the Hub program exe as "Run as Administrator"?

    It looks like you are running from Processing. Have you tried the standalone?

    William

  • QWERTY12345QWERTY12345 Canada
    edited January 2020

    Thanks for the reply!
    I was pretty sure that I have the standalone version, I'll try installing it again

  • I am having the same issue as the OP, I think.
    Also have same versions of GUI and FTDI Drivers... Windows 10 a slight newer at 10.183623
    I can connect to the Cyton by manually selecting the com port (happens to be 8, or 19, I have two dongles).
    Autoscan will find the Cyton on channel 2.
    Associated Log looks like this...

    Radios_Config: system_status
    Radios_Config: Success: System is Up
    [SUCCESS]: Successfully connected to Cyton using COM8
    Radios_Config: system_status
    Radios_Config: Success: System is Up
    [SUCCESS]: Successfully connected to Cyton using COM8
    Radios_Config: get_channel
    Radios_Config: Success: Host and Device on Channel number: 2
    

    But... as soon as I try to start a session... it fails... on "init Timeout".

    I note the same complaint in the log as the OP... that the config file cannot be found.

    The file "C:\Users\tim\Documents\OpenBCI_GUI\Settings\CytonUserSettings.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
    InitSettings: C:\Users\tim\Documents\OpenBCI_GUI\Settings\CytonUserSettings.json not found or other error.
    [DEFAULT]: The new data source is LIVE (from Cyton  ) and NCHAN = [8]. User Settings Error: Default Settings Loaded.
    

    However, the file exists...
    It says use com port 3.
    I edited it by hand to say COM 8... but it gets overwritten again every time I try to start a session... back to COM 3.
    I think something is going wrong with the session config update, it's failing to default settings and not seeing the Cyton on that COM Port.

    I also tried this on a windows 7 VM... and got the same results exactly... except the com port numbers were different.

    Any suggestions, appreciated.

  • Another observation...
    If I click on settings, I have only one option... "Clear All"
    (I would expect more, given the hover-help: "Save and Load GUI Settings... etc...")
    For what it's worth, I opened ports on private and public newtorks when prompted...

  • retiututretiutut Louisiana, USA
    edited January 2020

    @erisian Those settings aren't relevant until you start a session.

    .. that the config file cannot be found.

    When no config file is found, it will say so in the log.

  • retiututretiutut Louisiana, USA
    edited January 2020

    If you run from Processing, please make sure to use the version of the OpenBCI Hub associated with that version.

    GUI 4.1.7 uses Hub 2.1.0.
    https://www.GitHub.com/openbci/openbci_hub/releases/latest

    The next release of the GUI will not use the Hub.

  • Thanks for the feedback, retuitut.
    I get that the menu items might not be relevant until a session is established.
    The failure here is at the point of establishing the session, so, I guess they wont be visible until that happens.
    I am not using Processing. Everything I have been doing is with the standalone application (so hub version is aligned).

    So... what else can I offer troubleshooting...?

    • Clearly, given that the \documents settings file is being overwritten at the time of attempting to establish the session, the folder is writable (confirmed timing by having it open in Notepad++ which is non-locking but reports file modification by dialogue pop-up).
    • Perhaps worth noting... Same results when run as Admin or not.

    I have perfect reproducibility with:

    • each of two different dongles (resolving to distinct COM Ports, but otherwise behaving the same).
    • each of two different computers (my laptop running Win 10 as stated earlier and a Win 7 VM with USB passed through)
    • multiple versions... version 3.4.0 and version 5.0.0 behaved same, for me, as the current release.
      (one advantage of standalone application is the ease of testing this... public and private ports opened on each first execution)

    If I power down the ultra-cortex and try to autoscan the leds flash for 15 seconds or so and the link fails, as would be expected.
    If I power up the ultra-cortex and try to autoscan it always fails on first attempt with a fresh start but always works on second attempt, resolving a link on Channel 2.

    Its when I try to initiate a session that the wheels come off...

    Cheers.

    Dear OP (Qwerty) - I hope we have the same problem!!! Sorry for hijacking your thread if not!!!

  • @retiutut said:
    @erisian Those settings aren't relevant until you start a session.

    .. that the config file cannot be found.

    When no config file is found, it will say so in the log.

    It does say something to this effect... it also says it in the OPs log... which was one of the reasons I thought our issues were same/related:

    The file "C:\Users\tim\Documents\OpenBCI_GUI\Settings\CytonUserSettings.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
    

    Cheers.

  • retiututretiutut Louisiana, USA
    edited January 2020

    Ok. The only way they would be the same is if this appears:

    OpenBCI_GUI::Setup: Setup is complete!
    Instantiating hub object...
    Hub: CheckHubInit: The GUI is connected to the Hub!
    Client SocketException: Connection reset
    

    This SocketException is happening outside of the GUI code in a dependency.
    To fix this, we have been working since last year to make a GUI without the Hub. This is actively in progress to resolve issues like the above.

    In conclusion, I have a hunch that the next GUI release that uses a new Java library, instead of the Hub, will fix any type of Socket issues, as it would no longer be used. :)

  • retiututretiutut Louisiana, USA

    @erisian Here is a little guidance to start troubleshooting your issue:

    If I power down the ultra-cortex and try to autoscan the leds flash for 15 seconds or so and the link fails, as would be expected.
    If I power up the ultra-cortex and try to autoscan it always fails on first attempt with a fresh start but always works on second attempt, resolving a link on Channel 2.

    Yes, I just added a message to say "Please press autoscan again" when I found it needs to be pressed twice.

    Its when I try to initiate a session that the wheels come off..

    Go ahead and make a new post in the Forums or OpenBCI GUI Issue on GitHub and include a full console log file and maybe some screenshots.

  • Hi,
    Sorry for the inactivity, I almost forgot about this post. We weren't able to make it work but we did manage to figure out a workaround with pylsl: https://github.com/chkothe/pylsl

  • retiututretiutut Louisiana, USA

    @QWERTY12345 So you are using pyOpenBCI and pyLSL?

  • retiututretiutut Louisiana, USA

    Can you share a simple example here? Maybe with just Time Series data format.

  • QWERTY12345QWERTY12345 Canada
    edited January 2020

    Sure:
    1. Download the repository https://github.com/OpenBCI/OpenBCI_LSL and the .py files from https://github.com/labstreaminglayer/liblsl-Python/tree/master/pylsl/examples in the same folder
    2. Run the command " python openbci_lsl.py --stream " or " python openbci_lsl.py [PORT] --stream " if you get an error
    3. Run ReceiveData.py
    Here's an example of code that I wrote, using existing code from ReceiveData (it's not very optimized or anything, I was just experimenting with the library since it was my first time using it) :

    from pylsl import StreamInlet, resolve_stream
    import numpy as np
    import time
    def saveData():
        print("looking for an EEG stream...")
        streams = resolve_stream('type', 'EEG')
        # create a new inlet to read from the stream
        listTimestamp = []
        c1 = []
        c2 = []
        c3 = []
        c4 = []
        c5 = []
        c6 = []
        c7 = []
        c8 = []
        lenght_data = 5000
        nb_data = 0
        inlet = StreamInlet(streams[0])
        n_sample = 0
    
        while True:
            begin = int(time.clock() * 1000)
            # get a new sample (you can also omit the timestamp part if you're not
            # interested in it)
            sample, timestamp = inlet.pull_sample()
            # append the sample of timestamp and each channel to the list
            listTimestamp.append(timestamp)
            c1.append(sample[0])
            c2.append(sample[1])
            c3.append(sample[2])
            c4.append(sample[3])
            c5.append(sample[4])
            c6.append(sample[5])
            c7.append(sample[6])
            c8.append(sample[7])
    
            nb_data += 1
    
            # save when there is 5000 timestamps
            if nb_data > lenght_data:
                # reset the number of data
                nb_data = 0
                # save in CSV
                all_data = [listTimestamp, c1, c2, c3, c4, c5, c6, c7, c8]
                np.savetxt("sample" + str(n_sample) + ".csv", np.asarray(all_data), delimiter=",")
                # reset
                listTimestamp = []
                c1 = []
                c2 = []
                c3 = []
                c4 = []
                c5 = []
                c6 = []
                c7 = []
                c8 = []
                n_sample += 1
            end = int(time.clock()*1000)
            print(end - begin)
    
    saveData()
    
  • Nice share, Qwerty ;)

Sign In or Register to comment.