Summary

  • Add support for Ganglion device without BLED112 dongle - #574
  • Add support set_index_percentage command to PlayBackFileBoard - #570
  • Add extra presets for PlayBackFile and Streaming boards - #564
  • Add delete_streamer method - #560
  • Add support for multiple streamers per preset - #550

Ganglion without dongle

In this release we’ve added support for Ganglion board without BLED112 dongle.

Example:


import time

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds


def main():
    BoardShim.enable_dev_board_logger()

    params = BrainFlowInputParams()
    board = BoardShim(BoardIds.GANGLION_NATIVE_BOARD.value, params)
    board.prepare_session()
    board.start_stream()
    time.sleep(5)
    data = board.get_board_data()
    board.stop_stream()
    board.release_session()

    print(data)


if __name__ == "__main__":
    main()

Improvements for PlayBackFile and Streaming boards

Until this release PlayBackFile and Streaming boards had onle one preset, so if your master board has multiple BrainFlowPresets you had to create multiple instances of PlayBackFile or Streaming boards.

Now you can use single instance and specify multiple files, it allows you to use exactly the same presets as in your master board.

Example for PlayBackFile board:

import time

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds, BrainFlowPresets
from brainflow.data_filter import DataFilter


def main():
    BoardShim.enable_dev_board_logger()

    params = BrainFlowInputParams()
    params.file = 'streamer_default.csv'
    params.file_aux = 'streamer_aux.csv'
    params.master_board = BoardIds.SYNTHETIC_BOARD
    board_id = BoardIds.PLAYBACK_FILE_BOARD

    board = BoardShim(board_id, params)
    board.prepare_session()
    board.start_stream()
    time.sleep(5)
    board.config_board('set_index_percentage:10')
    time.sleep(5)
    data_default = board.get_board_data(preset=BrainFlowPresets.DEFAULT_PRESET)
    data_aux = board.get_board_data(preset=BrainFlowPresets.AUXILIARY_PRESET)
    board.stop_stream()
    board.release_session()
    DataFilter.write_file(data_default, 'default.csv', 'w')
    DataFilter.write_file(data_aux, 'aux.csv', 'w')
    print(data_default)
    print(data_aux)



if __name__ == "__main__":
    main()

Example for Streaming board:

import time

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds, BrainFlowPresets
from brainflow.data_filter import DataFilter


def main():
    BoardShim.enable_dev_board_logger()

    params = BrainFlowInputParams()
    params.ip_port = 6677
    params.ip_port_aux = 6678
    params.ip_address = '225.1.1.1'
    params.ip_address_aux = '225.1.1.1'
    params.master_board = BoardIds.SYNTHETIC_BOARD
    board_id = BoardIds.STREAMING_BOARD

    board = BoardShim(board_id, params)
    board.prepare_session()
    board.start_stream()
    time.sleep(10)
    data_default = board.get_board_data(preset=BrainFlowPresets.DEFAULT_PRESET)
    data_aux = board.get_board_data(preset=BrainFlowPresets.AUXILIARY_PRESET)
    board.stop_stream()
    board.release_session()
    DataFilter.write_file(data_default, 'default.csv', 'w')
    DataFilter.write_file(data_aux, 'aux.csv', 'w')
    print(data_default)
    print(data_aux)



if __name__ == "__main__":
    main()