Skip to content

CYTON_WIFI_BOARD: sampling rate can be changed via config_board("~5"), but get_sampling_rate() stays at 1000 and command responses are empty #804

@BY1127954825

Description

@BY1127954825

Problem

For CYTON_WIFI_BOARD, BrainFlow seems to allow sending Cyton sample-rate commands such as ~5 (500 Hz), but the current sample rate is not synchronized back to the high-level API.

As a result:

  • config_board("~5") appears to successfully switch the board to 500 Hz
  • but BoardShim.get_sampling_rate(BoardIds.CYTON_WIFI_BOARD) still returns 1000
  • and commands that should return text responses, such as ~~ (query current sample rate) and V (firmware version), return an empty string on the WiFi path

This makes it difficult to reliably use the actual runtime sample rate from BrainFlow.

Environment

  • Board: OpenBCI Cyton + WiFi Shield
  • BrainFlow in OpenBCI GUI: 5.10.0
  • OpenBCI GUI: v6.0.0-beta.1
  • OS: Windows 10
  • Python environment: Anaconda / Python 3.10
  • Connection type: WiFi (CYTON_WIFI_BOARD)

What I observed

1. get_sampling_rate() always returns 1000 for CYTON_WIFI_BOARD

In Python:

Image Image

he same behavior is visible in OpenBCI GUI Expert Mode:

Sending config string to board: V
[SUCCESS]: [ExpertMode] Success sending command to board: V
ADSSettingsController: Response ==
So the command appears to be sent successfully, but the response is not exposed to the caller.

Why I think this is a BrainFlow API issue From the BrainFlow source:

brainflow_boards.cpp defines a static board description for CYTON_WIFI_BOARD with sampling_rate = 1000
openbci_wifi_shield_board.cpp appears to hardcode ~4 during WiFi initialization
config_board(...) on the WiFi board just forwards the raw command string

So currently BrainFlow seems to support:

sending raw commands like ~5
but does not provide:

a synchronized runtime sampling rate for CYTON_WIFI_BOARD
a reliable way to read back the current sample rate over WiFi
a dedicated API like set_sampling_rate() / get_current_sampling_rate()
Expected behavior
At least one of the following would make the behavior consistent:

get_sampling_rate() reflects the current runtime sampling rate after config_board("~5")
command responses for ~~ and V are correctly returned on the WiFi path
BrainFlow exposes an explicit runtime API for Cyton WiFi sample rate configuration/query
documentation clearly states that:
get_sampling_rate(board_id) is static metadata only

Image

WiFi command responses may be empty
users must track runtime sampling rate manually after config_board("~X")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions