"BrainFlowError: unable to prepare streaming session"

nejemianejemia argentina
edited August 2020 in OpenBCI_GUI

Hello !
I just started to test Brainflow Python API.
Trying to run the get data from board with my Cyton and its WiFi shield.
See the results.
Am I missing something?
Thanks a lot !
nelson

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Best support for Brainflow is on the Slack, join here,

    https://brainflow.ai/

    William

  • WssWss china chongqing

    Today,i meet the same question,Is there a solution? thank you very much.

  • retiututretiutut Louisiana, USA

    There are required arguments for certain types of boards. This error states that this requirement is not met.

  • WssWss china chongqing
    edited September 2020

    @retiutut said:
    There are required arguments for certain types of boards. This error states that this requirement is not met.

    Thank you very much! Because of my Poor programming ability ,i still can't do that well.my hardware is cyton daisy ,How should I configure it ? there are some code sample from BrainFlow

    import argparse
    import time
    import numpy as np
    import pandas as pd
    
    import brainflow
    from brainflow.board_shim import BoardShim, BrainFlowInputParams, LogLevels, BoardIds
    from brainflow.data_filter import DataFilter, FilterTypes, AggOperations
    
    def main():
        BoardShim.enable_dev_board_logger()
    
        # use my board for demo
        params = BrainFlowInputParams()
        board = BoardShim(BoardIds.CYTON_DAISY_BOARD.value, params)
        **board.prepare_session()**     # some question
        board.start_stream()
        BoardShim.log_message(LogLevels.LEVEL_INFO.value, 'start sleeping in the main thread')
        time.sleep(10)
        data = board.get_current_board_data(20)  # get 20 latest data points dont remove them from internal buffer
        board.stop_stream()
        board.release_session()
    
        # demo how to convert it to pandas DF and plot data
        eeg_channels = BoardShim.get_eeg_channels(BoardIds.CYTON_DAISY_BOARD.value)
        df = pd.DataFrame(np.transpose(data))
        print('Data From the Board')
        print(df.head(10))
    
        # demo for data serialization using brainflow API, we recommend to use it instead pandas.to_csv()
        DataFilter.write_file(data, 'test.csv', 'w')  # use 'a' for append mode
        restored_data = DataFilter.read_file('test.csv')
        restored_df = pd.DataFrame(np.transpose(restored_data))
        print('Data From the File')
        print(restored_df.head(10))
    
    if __name__ == "__main__":
        main()
    

    lastly,do I need to do some setup in the GUI firstly?

Sign In or Register to comment.