Emotiv / cortex-example

Example with Cortex V2/V3 API
https://emotiv.com
MIT License
202 stars 115 forks source link

Cannot export records: data corrupted or not supported #46

Closed danaris closed 5 years ago

danaris commented 5 years ago

Greetings. I have been attempting to develop an in-house research app using the Cortex API, and am working on getting it to create and export records. Unfortunately, I consistently get failure reports like these:

{'code': -32138, 'message': 'The stream data is not supported.', 'recordId': '1cb8542a-9364-4c81-ab8f-9982bd5cf702'}
 {'code': -32147, 'message': 'Data is corrupted by internal error.', 'recordId': '277ce3e0-f095-4444-9131-ea73ce52f96b'}

I have attached 3 files: the Python code I have been using to test this, the raw JSON replies from the Cortex service, and the stdout from the Python program.

pycortex.py.txt cortexRawFile.txt Cortex Test Output 2019-10-03.txt

Any assistance with this would be most appreciated.

bchaperon commented 5 years ago

Hi @danaris

The first error 'The stream data is not supported.' means that you try to export a data stream that doesn't exist or you try to export a stream that is not accessible by your license. Most likely, you are trying to export the raw EEG data, but the license of this record doesn't authorize you to do so. Please check the field licenseScope of your record. It must contain the scope "eeg" if you want to export the raw EEG data. https://emotiv.gitbook.io/cortex-api/records/record-object

The second error is more tricky, it can have many causes. Here is a few hints: Make sure the export folder already exists before you try to export. Cortex will not try to create this folder if it doesn't exist. Disconnect the headset after you finish the record. You can't export the record if the headset is still connected. Make sure you use the same application (same client id and client secret) to create and export the record. https://emotiv.gitbook.io/cortex-api/records/exportrecord