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

Cannot disable a channel #39

Open
petewall opened this issue Jan 17, 2018 · 3 comments
Open

Cannot disable a channel #39

petewall opened this issue Jan 17, 2018 · 3 comments
Labels

Comments

@petewall
Copy link

I'm trying to disable a channel, but adding a call to channelOff causes no samples to show up.

Here's the code that I'm testing with:

const Ganglion = require('openbci-ganglion');
const ganglion = new Ganglion({ debug: true });
ganglion.once('ganglionFound', (peripheral) => {
    ganglion.searchStop();
    ganglion.on('sample', (sample) => {
        console.log(sample.sampleNumber);
        for (let i = 0; i < ganglion.numberOfChannels(); i++) {
            console.log('Channel ' + (i + 1) + ': ' + sample.channelData[i].toFixed(8) + ' Volts.');
        }
    });
    ganglion.once('ready', () => {
        ganglion.channelOff(4);
        ganglion.streamStart();
    });
    ganglion.connect(peripheral);
});
ganglion.searchStart();

Here's the output on stdout:

Debug bytes:
>>>  62                                                |b|
Debug bytes:
>>>  34                                                |4|
Debug bytes:
<<  ce 44 65 61 63 74 69 76  61 74 69 6e 67 20 63 68  |.Deactivating ch|
<<  61 6e 6e 65                                       |anne|
Debug bytes:
<<  cf 6c 20 34 0a                                    |.l 4.|

There are no calls to the sample event handler. If I comment out the ganglion.channelOff(4); line, it behaves normally.

I'm using a MacBook Pro (mid-2015) running Mac OS X 10.13.2.

@andrewjaykeller
Copy link

Working on testing this bug

andrewjaykeller pushed a commit to andrewjaykeller/OpenBCI_NodeJS_Ganglion that referenced this issue Jan 22, 2018
@andrewjaykeller
Copy link

andrewjaykeller commented Jan 22, 2018

What firmware are you using on the Ganglion? I'm having trouble duplicating.

andrewjaykeller pushed a commit to andrewjaykeller/OpenBCI_NodeJS_Ganglion that referenced this issue Jan 22, 2018
@petewall
Copy link
Author

petewall commented Feb 5, 2018

Sorry for the delay. How is the best way to find that information? I don't see it in the peripheral object returned from ganglion.once('ganglionFound', (peripheral) => { ... });

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

No branches or pull requests

2 participants