Emotiv / cortex-example

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

Invalid Key licence in Python with registered Cortex app #184

Closed craigvear closed 2 years ago

craigvear commented 2 years ago

Running sub.data.py. Have supplied your_app_client_id & your_app_client_secret in the main() as given in EMOTIV account. Headset Insight2 connected, and Cortex App showing in EMOTIV launcher.

Error returns :

{
    "jsonrpc": "2.0",
    "method": "authorize",
    "params": {
        "clientId": "removed for security",
        "clientSecret": "removed for security",
        "license": "",
        "debit": 10
    },
    "id": 4
}
handle_error: request Id 4
{'code': -32002, 'message': 'Invalid License Key.'}

Why invalid licence?

nguoithichkhampha commented 2 years ago

@craigvear , because you send empty license in the request "license": "" if you don't know exactly your license id. you can remove the params "license", our system will choose the best match { "jsonrpc": "2.0", "method": "authorize", "params": { "clientId": "removed for security", "clientSecret": "removed for security", "debit": 10 }, "id": 4 }

craigvear commented 2 years ago

Thanks. Which line of code do I change for that ? Is it in cortex.py? FYI I am using your sub_data.py out of the box.

craigvear commented 2 years ago

removed licence param in LOC449 in cortex.py. same response

 {
    "jsonrpc": "2.0",
    "method": "authorize",
    "params": {
        "clientId": "removed for security",
        "clientSecret": "removed for security",
        "debit": 10
    },
    "id": 4
}
handle_error: request Id 4
{'code': -32002, 'message': 'Invalid License Key.'}
nguoithichkhampha commented 2 years ago

@tungntEmotiv pls help to check this issue

craigvear commented 2 years ago

I now seem to be getting the following:

handle_error: request Id 4 {'code': -32130, 'message': 'The cloud token is refreshing.'}

tungntEmotiv commented 2 years ago

@craigvear , Do you have PRO license or free license? If you only have free license, please don't tick "My App required EEG access" as below: image

If you have PRO license, but still get the issue. Please send us your clientID and emotivID via email tungnguyen@emotiv.com We will check more. Thanks

craigvear commented 2 years ago

Have basic license. Already ticked eeg for my app.

UPDATE:

yep - now works. Thank you for your help. perhaps you should make this process clearer for developers.

pm data: {'met': [True, 0.642478, True, 0.74391, 0.0, True, 0.363572, True, 0.456362, True, 0.658906, True, 0.140554], 'time': 1659718532.1614} pm data: {'met': [True, 0.404533, True, 0.528303, 0.0, True, 0.32198, True, 0.385608, True, 0.35132, True, 0.065574], 'time': 1659718542.1586}

craigvear commented 2 years ago

working - thank you