connecting 'BITalino'-like device to OpenBCI_GUI

nosanosa Iraq
edited September 2020 in OpenBCI_GUI

Hi,
I am trying to connect BITalino to OpenBCI-GUI with BLE and Bluetooth. I read the code and I found a file in openbci-gui-helper library with name: GanglionScan.dll. I find the OpenBCI-GUI-helpers in this link [https://github.com/retiutut/OpenBCI_GUI_Helpers], is any one explain how this code work for searching ganglion?
I want to know how does BLE work in ganglion and found devices and get mac address?

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Nosa, hi.

    The OpenBCI_GUI is only designed to receive from OpenBCI boards. What you are asking about (adding BITalino to the GUI) is likely to be difficult if not extremely frustrating. What is your goal in receiving the data stream from BITalino? I assume you've used the BITalino app,

    https://bitalino.com/en/software

    Check out page 61 in the manual:
    https://www.downloads.plux.info/OpenSignals/OpenSignals-Manual.pdf

    It allows you to stream data to other applications via TCP or LSL (LabStreamingLayer). With LSL you can input your data stream into various other free apps, such as OpenViBE, or write your own signal processing in the languages that LSL supports,

    https://labstreaminglayer.readthedocs.io/
    https://labstreaminglayer.readthedocs.io/info/viewers.html

    Currently OpenBCI_GUI does not accept LSL as an input stream. But there is an (much) older version of the GUI (a fork) that did add LSL input. Unclear when or if those mods will ever get into v5+. Richard @retiutut might have some ideas.

    https://github.com/adamfeuer/OpenBCI_GUI

    Adding LSL input to the GUI is a very low priority since the GUI is for support of OpenBCI boards, and the other LSL apps and libraries listed above would be a much better approach if you are wanting custom visualization or signal processing.

    Regards, WIlliam

  • wjcroftwjcroft Mount Shasta, CA

    The new GUI v5 is based on Brainflow libraries. I just wanted to mention this, but in general this approach would be much harder for you than using the LSL mentioned previously.

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

  • retiututretiutut Louisiana, USA
    edited August 2020

    Might be best to stick to the Python example from the BITalino people:
    https://github.com/BITalinoWorld/revolution-python-api

  • Thank you for your response, I am developer and I want to make openBCI_GUI a software that visualize my hardware signals, for this issue I want to make it a software can connect to BITalino at first. Does the software use ganglionScan.dll for finding ganglion devices?

  • wjcroftwjcroft Mount Shasta, CA

    Nosa, hi.

    I want to make openBCI_GUI a software that visualize my hardware signals, for this issue I want to make it a software can connect to BITalino at first.

    Did you read some of the earlier comments? Modifying OpenBCI_GUI to receive from BITalino (the Bluetooth data stream), will be extremely complicated and not recommended. Please see earlier comments for alternatives. If you don't understand the particular alternative mentioned, ask for clarifying information.

    Regards, William

  • retiututretiutut Louisiana, USA

    You are free to use the OpenBCI GUI source code in any way you like, as it is MIT license. Still, it seems like a lot of extra work even though BITalino already has it's own app and a Python framework:
    https://bitalino.com/en/software
    https://github.com/BITalinoWorld/python-serverbit

  • wjcroftwjcroft Mount Shasta, CA

    I previously directed him to the GUI version fork that Adam Feuer made, that can read LSL. Combine that with the BITalino default standard app's ability to stream out LSL, and he would have a makeshift solution. But there are many other alternatives he could use to signal process or display the BITalino stream, besides our GUI.

  • retiututretiutut Louisiana, USA

    That sounds like a relatively simple solution!

  • Thank you for your responses @wjcroft , @retiutut
    I know BITalino's software and codes. Just I like to know how OpenBCI-GUI finds ganglion devices with BLE. and I want to make a new hardware (it is not BITalino, and BITalino just was for my first expriment for this issue) and I want to add it to OpenBCI-GUI with BLE. I add button of BITalino to control panel

    But adding BITalino is not my goal. I want to have a software for my own hardware.

  • wjcroftwjcroft Mount Shasta, CA

    The new GUI v5 is based on Brainflow libraries. So your first step would likely be to add BITalino (or whatever device) to those devices supported by Brainflow. Then you could look at the code for how the GUI opens a Cyton or Ganglion (using Brainflow calls), and clone that into your new device.

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

    The Ganglion is BLE. Cyton is a custom Bluetooth protocol that is NOT BLE. Ganglion uses the BLED112 dongle, which turns a serial port into a BLE streaming interface. Cyton dongle and mainboard use RFduino radio modules, and the dongle again appears as a serial port.

  • wjcroftwjcroft Mount Shasta, CA

    You may not realize this, but if you EMULATE the serial port data protocol used by OpenBCI Cyton, with your custom device, then it automatically would be usable with the GUI. Possibly with minor mods needed.

    https://docs.openbci.com/docs/02Cyton/CytonDataFormat

    Although the list of commands (laptop to Cyton serial characters), looks daunting -- you would only need to implement the start / stop data stream commands ('b' and 's'), to use most of the GUI visualization features.

    https://docs.openbci.com/docs/02Cyton/CytonSDK#stream-data-commands

  • wjcroftwjcroft Mount Shasta, CA

    Emulating the serial data stream format of Cyton, does not have to require a usb serial port implementation. It could also be done with a wifi TCP data stream, such as easily available with wireless microcontroller chips like ESP32.

  • Hi, Thank you for your response.
    we are trying make our own board and connect it to OpenBCI-GUI for showing the signals. Our device use BLE for connecting to GUI. So we follow the ganglion method in openBCI-GUI. In this way, we found ganglionScan.dll that it is using for achieving mac address and name of ganglion devices and the file send these information to GUI. we changed the ganglionScan.dll source code that it achieve mac address and name of our device and send this information to GUI. In next step, we thought it needs that we add our Board to brainflow as this page https://brainflow.readthedocs.io/en/stable/BrainFlowDev.html#instructions-to-add-new-boards-to-brainflow
    Now, We are trying to do this. and our question is: If we added our Board to brainflow successfully and we give the output of this to OpenBCI-GUI for showing our signals, Is it any problem at that step? maybe because The GUI is for OpenBCI Boards only? and Is it so difficult handling this issue?
    I hope to I explain my question clearly.
    Regards,Nosa

  • wjcroftwjcroft Mount Shasta, CA

    In this way, we found ganglionScan.dll that it is using for achieving mac address

    I don't believe this applies to the new v5 GUI, and the way it talks to Ganglion. All OpenBCI devices now interface to the GUI via Brainflow library calls. Recall that Ganglion is NOT accessed via operating system BLE functions. Instead the Ganglion dongle (BLED112) is a usb serial port device, with various command / response tokens that allow it to map BLE functions onto an ascii text serial port stream.

    https://www.silabs.com/wireless/bluetooth/bluegiga-low-energy-legacy-modules/device.bled112

    If we added our Board to brainflow successfully and we give the output of this to OpenBCI-GUI for showing our signals, Is it any problem at that step? maybe because The GUI is for OpenBCI Boards only? and Is it so difficult handling this issue?

    You'll have to figure out how to change the GUI source code yourself. It should be possible to add your device. You will need both user interface elements (device selection), and then appropriate calls to Brainflow to open and receive the data stream.

    https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/BoardGanglion.pde
    https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/OpenBCI_GUI.pde#L486 [Ganglion section of main]

    As we stressed in previous comments (many times), there are other ways in which you could receive your device data stream, do signal processing, display graphs, etc. That do not involve the complex mods needed in Brainflow and GUI source code. For example, there are many different Python libraries that can parse data streams, do DSP signal processing, display realtime graphs, etc.

    And we also mentioned that if your serial data stream, mimicked the simple command structure of the Cyton, it would automatically be usable by the GUI. With perhaps minor mods.

    William

  • nosanosa Iraq
    edited September 2020

    Thank you for your response.

    there are other ways in which you could receive your device data stream, do signal processing, display graphs, etc. That do not involve the complex mods needed in Brainflow and GUI source code. For example, there are many different Python libraries that can parse data streams, do DSP signal processing, display realtime graphs, etc.

    We tried to plot realtime data stream in Python, and we tried to design our own app. but The designing of GUI was very difficult and Time-consuming process. So we decide to use a open source app and we add our board to it. and we choose the openbci-GUI for this goal.

    And we also mentioned that if your serial data stream, mimicked the simple command structure of the Cyton, it would automatically be usable by the GUI. With perhaps minor mods.

    we will check your suggestion.

  • Hi,
    I add my own BLE device to openBCI-GUI but when it starts to stream data after a few seconds the following error is occured.

  • wjcroftwjcroft Mount Shasta, CA

    @nosa, hi. I merged your new thread into the existing one on your custom device.

    Did you add your device to Brainflow? Brainflow devices are implemented first in C++, then in the desired programming language, such as Java / Processing. You may have omitted a necessary step. Finally then, the GUI calls Brainflow to stream from the device.

    https://brainflow.ai/
    https://brainflow.readthedocs.io/en/stable/

    William

  • I added my codes in files of ganglion in Brainflow for adding my device, and I started streaming data and I received it in OpenBCI-GUI and it runs for some secondes but the following error is occured.

  • wjcroftwjcroft Mount Shasta, CA

    Is this data stream shown in the time series, your actual data being sent from a test generator? You already provided the C++ error message in the previous comment.

    I added my codes in files of ganglion in Brainflow for adding my device

    Do note that Ganglion uses a BLED112 usb serial port device, which sends/receives serial byte stream 'text' characters that implement a Bluetooth API described by the manufacturer.

    https://www.silabs.com/wireless/bluetooth/bluegiga-low-energy-legacy-modules/device.bled112

    There is a Slack channel for developers of Brainflow device interfaces. You could show your error message there.

    https://brainflow.ai/

  • Hi,
    The problem resolved. I put the codes for this issue in below link:
    https://github.com/nosa999/brainflow

  • Hi,
    @retiutut the data is streaming in openBCI_GUI, but the speed is very fast. GUI plots the data in 2 seconds instead of 20 seconds:
    how can I resolve this issue?

  • retiututretiutut Louisiana, USA
    edited October 2020

    You should check if there is new data since the previous frame, and if so, update the plot points.

    This is one of the primary methods we use to graph time series and aux data in the GUI using Processing and Graphica.

Sign In or Register to comment.