OpenBCI GUI can't connect to Cyton board
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 :
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
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
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...
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.
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...
@erisian Those settings aren't relevant until you start a session.
When no config file is found, it will say so in the log.
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...?
I have perfect reproducibility with:
(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!!!
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:
Cheers.
Ok. The only way they would be the same is if this appears:
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.
@erisian Here is a little guidance to start troubleshooting your issue:
Yes, I just added a message to say "Please press autoscan again" when I found it needs to be pressed twice.
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
@QWERTY12345 So you are using pyOpenBCI and pyLSL?
A combination of these two, my bad
https://github.com/labstreaminglayer/liblsl-Python/tree/master/pylsl/examples
https://github.com/OpenBCI/OpenBCI_LSL
Can you share a simple example here? Maybe with just Time Series data format.
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) :
Nice share, Qwerty