Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Analog data parsing in Python SDK #109

Open
daniellasry opened this issue Jan 4, 2019 · 4 comments · May be fixed by #116
Open

Implement Analog data parsing in Python SDK #109

daniellasry opened this issue Jan 4, 2019 · 4 comments · May be fixed by #116
Assignees

Comments

@daniellasry
Copy link
Contributor

daniellasry commented Jan 4, 2019

This was brought up in issue: OpenBCI/OpenBCI_WIFI#86
When switching to analog mode, no data is streaming from the Cyton. Example code:

from openbci import wifi as bci
shield = bci.OpenBCIWiFi(ip_address = '192.168.1.141', log=True, high_speed=True)
shield.wifi_write('/2')

def printData(sample):
    print(sample.sample_number)
    print(sample.channel_data)

shield.start_streaming(printData)
shield.loop()

This will print a whole bunch of zeroes.

This is because there is no analog data parsing in the Python SDK. See the empty function here: https://github.com/OpenBCI/OpenBCI_Python/blob/069bbcb9167261d687ec37206d1d2f59ace137d8/openbci/utils/parse.py#L140-L141

The implementation should be similar to the one in the NodeJS code. See here, and here

@wjcroft
Copy link

wjcroft commented Jan 15, 2019

Daniel, thanks for looking into this. Mentioning @omarclaflin .

@andrewjaykeller
Copy link

andrewjaykeller commented Feb 13, 2019

The API for this should look something like

from openbci import wifi as bci
# for analog
shield = bci.OpenBCIWiFi(ip_address = '192.168.1.141', log=True, high_speed=True, aux_mode='analog')

# for digital
shield = bci.OpenBCIWiFi(ip_address = '192.168.1.141', log=True, high_speed=True, aux_mode='digital')

def printData(sample):
    print(sample.sample_number)
    print(sample.channel_data)
    print(sample.analog_data)

shield.start_streaming(printData)
shield.loop()

@daniellasry
Copy link
Contributor Author

hey @omarclaflin, it's not implemented yet, but it will be by next week. I'll keep you posted.

@daniellasry daniellasry linked a pull request Feb 17, 2019 that will close this issue
@daniellasry
Copy link
Contributor Author

hey @omarclaflin , thanks for testing it out. hang tight, the code is still a work in progress!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants