recording Cyton data to SDcard @ 1000 Hz

edited September 2020 in Cyton

Hi developer,
I have bought my Cyton board at Apr 06,2020. I am looking for a way to change the sample rate up to 1000 Hz. I follow the threads online but I failed. Is there any way to change my sample rate? It becomes 250 Hz after when I use dongle or even Wifi-sheid following the guide of SDK. I am going to do the project which can record the EEG data by SD card at 1000 Hz sample rate.
The second problem is that I had tried to refresh my Cyton to default board firmware version (v 3.1.2); however, my SD card files( . txt) cannot convert to SD_converted file. It does work will before I refresh the firmware, do you have any idea about this question? I've attached the .txt file

all the best
Howard

OBCI_28.TXT (https://drive.google.com/file/d/1uv1D9_HdxjfGu8X5vJZ6gVHL0pJUW1ID/view?usp=drive_web)

Comments

  • I was suggested to mention @wjcroft ,@retiutut and @evaesteban

  • wjcroftwjcroft Mount Shasta, CA

    Howard, hi.

    There is a firmware fix you can try, that enables faster SDcard recording, using just Bluetooth, see.

    https://github.com/OpenBCI/OpenBCI_Cyton_Library/pull/96
    https://openbci.com/forum/index.php?p=/discussion/2435/over-250-sps-to-sd-card-using-bluetooth-dongle

    I'm not clear why you are having issues with Cyton + Wifi Shield and faster sample rates. Cyton is known to be glitchy with the Shield. Some workarounds suggested include powering Cyton mainboard and Shield (both) with separate 6v alkaline power supplies. And using UDPx3 packets.

    ...however, my SD card files( . txt) cannot convert to SD_converted file. It does work will before I refresh the firmware, do you have any idea about this question? I've attached the .txt file

    Hmm, the conversion happens in the GUI, correct? You are saying the GUI is not converting correctly? Mentioning Richard @retiutut.

    William

  • retiututretiutut Louisiana, USA

    GUI v4 can convert SD card files to work with GUI v4.

    GUI v5 can read SD card files without conversion.

  • @retiutut Did you see the .txt file that I had attached? Both serial monitor and GUI asked me to"try the valid file". Here is the error message" Tried to load anun supported file for platback! Please try a valid file" I am wondering why the .txt file cannot be generated correctly?

  • edited October 2020

    1

  • @wjcroft said:
    Howard, hi.

    There is a firmware fix you can try, that enables faster SDcard recording, using just Bluetooth, see.

    https://github.com/OpenBCI/OpenBCI_Cyton_Library/pull/96
    https://openbci.com/forum/index.php?p=/discussion/2435/over-250-sps-to-sd-card-using-bluetooth-dongle

    I'm not clear why you are having issues with Cyton + Wifi Shield and faster sample rates. Cyton is known to be glitchy with the Shield. Some workarounds suggested include powering Cyton mainboard and Shield (both) with separate 6v alkaline power supplies. And using UDPx3 packets.

    ...however, my SD card files( . txt) cannot convert to SD_converted file. It does work will before I refresh the firmware, do you have any idea about this question? I've attached the .txt file

    Hmm, the conversion happens in the GUI, correct? You are saying the GUI is not converting correctly? Mentioning Richard @retiutut.

    William

    I'm using cyton+Wifi because I always failed to record data with SD card at sample rate 1000. The problem is that I can't even have a correct data by recording with SD card using only cyton at the rate of 250 after I uploaded the default board code.

  • retiututretiutut Louisiana, USA

    @HowardK I am unable to download the file you shared to test. Can you make it public please?

  • edited October 2020

    @retiutut said:
    @HowardK I am unable to download the file you shared to test. Can you make it public please?

    Is it available now?

  • retiututretiutut Louisiana, USA
    edited October 2020

    @HowardK The file looks corrupt, and I see characters in your file that should not be there. Also, it looks like only a few samples are written to file.

    @HowardK's Cyton SD Card Recording

    @@@@@@@@@ @@@@ !b** b221 !b** )b*) 20,16E0 08,EF29FE,EEBCD2,E3DB90,E7C6DD,A67FF9,EE12AE,B26429,CF047A 09,EF297F,EEBC52,E3DB0B,E7C660,A67F91,EE123B,B263D9,CF03F7 0A,EF2FDD,EEC24B,E3E1DC,E7CCAB,A68709,EE191D,B26C06,CF0B07 0B,EF30FA,EEC359,E3E2FB,E7CDB7,A68832,EE1A38,B26D4E,CF0BFB 0C,EF2A9A,EEBD61,E3DC1E,E7C767,A680BF,EE1355,B2654C,CF04A4 0D,EF2911,EEBBEC,E3DA7A,E7C5E8,A67F09,EE11B8,B2638F,CF02E5 0E,EF2F04,EEC17E,E3E0DA,E7CBCB,A68607,EE1828,B26B3E,CF0987 0F,EF31B6,EEC40B,E3E3AB,E7CE6A,A68910,EE1AFE,B26E88,CF0C44 10,EF2B93,EEBE45,E3DD0E,E7C853,A @@@@@@@@@@@               HAF&% &&FE (&he 
    

    Normal Output

    %STOP AT
    0001156D
    00,E6A18B,12034D,BD39E2,BD6A8C,E8CD48,ED8ABC,E4E76A,D5C14A,0130,0DF0,06C0
    01,E2A74A,0F25EF,BD4468,BD6084,E98E5C,ED32EE,E2763D,D64153
    02,E001D6,0D6D65,C057B9,C0784E,EFA0F1,E9676F,DF1B2B,DC1E64
    03,E0940D,0E06A2,C224E3,C225AD,F1155A,E9976D,DF4760,DDB3E2
    04,E5DC84,11985C,BE46C7,BE7444,EA7537,EC99E6,E3E71F,D765E5
    05,E3F5A4,0FFC63,BC95B1,BCB52B,E81A52,EE19E4,E3B248,D4E9C6
    06,DFDAA0,0D5899,C01C55,C03B5D,EF2B93,E984A6,DF0771,DBAD80,01A0,14F0,0A30
    07,E06D8B,0DD44B,C1D11C,C1DB07,F0E6CF,E9A0C4,DF48B3,DD83F6
    08,E4C0A7,10EFD5,BF7773,BF9C0A,EC502B,EB9946,E2A9BB,D93734
    09,E5420F,10D6BA,BC1A2D,BC3BCD,E700C4,EEBC24,E4CA6F,D3E901
    0A,DFDB85,0D5C2E,BFC73C,BFE221,EE77C0,E9E4AD,DF29ED,DAFFFD
    0B,E06596,0DBA5B,C165C6,C178AC,F092F9,E9AB29,DF5BB5,DD2E49
    0C,E383B5,102835,C09067,C0AAAA,EE09D0,EABE72,E1728E,DAE45A
    0D,E64566,118A16,BBE2D6,BC098C,E685FB,EEEF89,E57EAE,D38217
    0E,E045BA,0D9CAE,BF0149,BF2872,ED391F,EAA5F0,DFC131,D9CDA8
    0F,E067EB,0DAC42,C0D680,C0FCD6,F01498,E9A963,DF6A08,DCAFAB
    10,E25373,0F5DF8,C16450,C179EE,EF6333,EA1B72,E067C5,DC31E2,01B0,1850,0BF0
    etc...
    etc...
    

    The second problem is that I had tried to refresh my Cyton to default board firmware version (v 3.1.2); however, my SD card files( . txt) cannot convert to SD_converted file. It does work will before I refresh the firmware, do you have any idea about this question?

    This is likely caused by an error/glitch in the firmware. You may need to re-flash the firmware to the Cyton. @wjcroft Do you agree that HowardK should re-flash? Let's get confirmation before you try this.

  • wjcroftwjcroft Mount Shasta, CA

    Richard, hi. I agree that a reflash is worth a try.

    I've long argued for adding this feature to the Cyton firmware: when it starts up, it should checksum its code segment, and compare to a known value. That way, if flash errors creep in over time, the startup routine would warn of this.

    Over the history of Cyton flash firmware, we've seen multiple cases where a firmware reload normalized the operation of unusual behaviors.

    William

  • This is likely caused by an error/glitch in the firmware. You may need to re-flash the firmware to the Cyton. @wjcroft Do you agree that HowardK should re-flash? Let's get confirmation before you try this.

    @retiutut @wjcroft
    Thanks for your replying! The reason why the glitch happening might be the speed of SD card writing is not fast enough. I have re-flash my board for tons of times. It seems like not the uploaded problem. I had solved the problem after changing my SD card.

  • @wjcroft
    How can I make sure the SD card data I got is at SPS==1000Hz? I use SD-converted file which output by GUI v4 to check it. The file told me that the SPS is 250Hz,however; The arduino serial monitor told me I am in SPS==1000Hz after I sent the comment ~~.

  • wjcroftwjcroft Mount Shasta, CA

    The header in the GUI CSV text file is unchanging, would be my guess. You should be able to tell by the length of your file, the number of samples / lines will be roughly seconds * 1000.

  • retiututretiutut Louisiana, USA
    edited October 2020

    The SD card conversion in GUI v4 might be hardcoded to 250Hz for 8ch and 125Hz for 16ch. Try @wjcroft's suggestion.

    GUI v5 SD card playback is also hardcoded at the moment to 250Hz and 125Hz. The reason is that the SD card file does not indicate the sampling rate in the header.

  • @wjcroft said:
    The header in the GUI CSV text file is unchanging, would be my guess. You should be able to tell by the length of your file, the number of samples / lines will be roughly seconds * 1000.

    Does it mean that I have to modify the column of SPS to 1000 by hand ?

  • wjcroftwjcroft Mount Shasta, CA

    The converted output file is a CSV text file. The comments at the top are ignored by any CSV reading program.

  • @retiutut said:
    The SD card conversion in GUI v4 might be hardcoded to 250Hz for 8ch and 125Hz for 16ch. Try @wjcroft's suggestion.

    GUI v5 SD card playback is also hardcoded at the moment to 250Hz and 125Hz. The reason is that the SD card file does not indicate the sampling rate in the header.

    Does that mean we cannot read the data at the rate of 1000Hz with GUI v5? I am wondering how can I read it without GUI v4?

  • retiututretiutut Louisiana, USA
    edited October 2020

    There are a handful of options:

    Hardest and not a good idea: Modify Cyton Firmware SD Card File Code and GUI for all users.. Requires firmware update... Could brick hardware!!!

    Moderate: Add an option in the Control Panel to Specify SD Card Sampling Rate Manually

    Easiest: @HowardK can run the GUI from Processing and modify 1-2 lines of code for now to make it work. Details below.

    https://github.com/OpenBCI/OpenBCI_GUI/blob/58fb49495841ac2fbabc68d4b69d9b0c7a8bffe0/OpenBCI_GUI/DataSourceSDCard.pde#L46
    https://github.com/OpenBCI/OpenBCI_GUI/blob/58fb49495841ac2fbabc68d4b69d9b0c7a8bffe0/OpenBCI_GUI/DataSourceSDCard.pde#L53

    It's ok to build off of 5.0.1(current public release). Remember to copy the libraries to the Processing library folder. And you can also use the Processing IDE to export the application as a standalone executable.

  • retiututretiutut Louisiana, USA
    edited October 2020

    Yes. Existing SD card playback code in GUI 5.0.1 looks for the number of columns to determine if 8ch or 16ch are present in file.

  • mikeypeachesmikeypeaches newport, ri

    I have implemented the changes in processing GUI. Do I also need the custom firmware cited above for this to work?
    Still getting 250hz after following @retiutut suggestion

Sign In or Register to comment.