Over 250 SPS to SD card using bluetooth dongle

Hello lads,

So I've been playing around with my Cyton thingie and eventually as well stumbled upon a problem of 250 SPS over bluetooth connection.
Specifically, it appears that no matter what sampling rate I set before starting a data stream it gets forcefully reset to 250hz.
To give some context:

Connecting to V3 at port /dev/ttyUSB0
Serial established...
OpenBCI V3 8-16 channel
On Board ADS1299 Device ID: 0x3E
LIS3DH Device ID: 0x33
Firmware: v3.1.2

With SD card inserted I then send the following list of commands:
A b <sleep 10s> s j and as a result get ~2500 records in a file on SD card.
Then I do :
~4 A b <sleep 10s> s j and as a result also get ~2500 records in a file on SD card.

As you can imagine this is far from what one would expect to get. Apparently it is a known problem. Moreover, this SPS-forcing is a deliberate hack to cover some "firmware bug" which evidently dates back to 2016 or so.
As far as I understand, for some bizarre reason the bug was not fixed yet and the only two ways to work around the problem:
1. either buy a WiFi shield (which is not supposed to be mandatory)
2. or use some third-party firmware of questionable quality and freshness.

Please tell me I'm wrong and I have abysmal googling skills.
Thank you in advance.

Comments

  • Right, I kinda suspected I'd have to help myself here...
    Here's the link to the changes necessary: https://github.com/OpenBCI/OpenBCI_Cyton_Library/pull/96

  • wjcroftwjcroft Mount Shasta, CA

    Julfy, thanks for submitting this.

    Does your mod work also with the Daisy? It appears to be testing explicitly for 250 Hz sample rate?

    William

  • bmartin427bmartin427 Ashland, MA

    I second the need for this, as I also came across this when I was getting started with logging data. However, I also encountered a problem where the SD card log was being saved in the wrong format (binary instead of text, possibly the result of some race overwriting a buffer?), so I didn't bother trying to fix and debugged streaming over wifi instead.

  • retiututretiutut Louisiana, USA
    edited January 2020

    @bmartin427 It's saved in a way that seemed best to the firmware developers, and there is a "Convert SD for Playback" feature under "Playback" mode in the GUI Control panel that should be completely functional in GUI 4.1.7.

    I have just updated the docs to reflect this! It has been possible for some time now. Thanks for bringing this to my attention so I can update the docs. Here is the link:

    https://docs.openbci.com/docs/02Cyton/CytonSDCard#converting-hex-files-in-openbci-gui

  • bmartin427bmartin427 Ashland, MA

    @retiutut This page indicates that the SD file format should be csv with hexadecimal entries: https://docs.openbci.com/docs/02Cyton/CytonSDCard#data-logging-format
    However, I ended up with binary data. Not just null characters, as in a file that hadn't been fully written yet, but actual binary content similar to the wire protocol for streaming data. This didn't happen every time I tried it, but most of the time. From studying the firmware routines where the csv data is prepared and emitted, I couldn't find any straightforward way that binary data could make its way through that process, so from that and the intermittent nature of the problem, I concluded that it was likely that a buffer was getting overwritten prior to making it to the card.
    Also, I found I wasn't the only one to experience this issue: http://openbci.com/forum/index.php?p=/discussion/1138/cyton-writing-bad-files-to-sd-card

Sign In or Register to comment.