Networking Widget to Brainflow example?
DashBarkHuss
Chicago
The OpenBCI docs say to use the networking widget to send data to brainflow but doesn't go into details on how to do it. I also don't see anything in the brainflows docs.
Are there any examples of what params to pass to the BoardShim in order to properly network the openbci gui to brainflow?
I've tried a few different ways, but I'm really just guessing based on the limited docs.
from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds
import time
import json
def main():
BoardShim.enable_dev_board_logger()
params = BrainFlowInputParams()
params.ip_port = 12345 # Make sure this matches the UDP port set in OpenBCI GUI
params.ip_address = '127.0.0.1' # Use localhost if GUI is on the same machine
# params.ip_port = 6677
# params.ip_address = '225.1.1.1'
# params.mac_address = 'c3:60:56:3a:6c:d7'
params.ip_protocol = 1
params.timeout = 15 # Set a timeout for connection attempts
# params.other_info = json.dumps({"use_udp_board_streaming": True})
params.serial_port = '/dev/tty.usbmodem11'
params.master_board = BoardIds.SYNTHETIC_BOARD
# board = BoardShim(BoardIds.GANGLION_BOARD, params)
board = BoardShim(BoardIds.STREAMING_BOARD, params)
Comments
You can post Brainflow library questions on the Brainflow Slack. Sign up using the link below.
https://brainflow.org/
The Networking Widget OUTPUT formats are described in the docs below.
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#networking
https://docs.google.com/document/d/e/2PACX-1vR_4DXPTh1nuiOwWKwIZN3NkGP3kRwpP4Hu6fQmy3jRAOaydOuEI1jket6V4V6PG4yIG15H1N7oFfdV/pub
You may have misunderstood what the Networking Widget does. You can use it to stream OUT from the GUI in only these formats: LSL, OSC, UDP, Serial.
If you want to write a Python program that receives the Ganglion data stream, use the examples shown in the Brainflow docs. One of these examples shows a realtime graphical stream plot. Which could take the place of the GUI Time Series monitoring.
https://brainflow.readthedocs.io/en/stable/Examples.html#python-real-time-plot
I'm still unclear on when the Networking Widget is used.
But I got the GUI to stream to python!
I followed the instructions here on sending the GUI to an external process.
And the Streaming Board brainflow docs
The docs a re confusing because to me they imply you are supposed to use the networking widget to accomplish what I was trying to accomplish- to view the gui while also streaming data in you brainflow scripts.
src
It looks like the context is about using Brainflow. Maybe I'm misunderstanding this.
GUI + Streaming example
Video demo
Great, glad you found that section. As you note, the 'GUI to External Process' feature is separate from and not connected to the services provided by the Networking Widget. Hope your application works. If the complexity is daunting, you can always drop back to just using the Brainflow sample programs and do whatever realtime signal plotting yourself. As in that 'Python real time plot' example.