openbci-archive/OpenBCI_NodeJS_Ganglion

TypeError at openBCIGanglion.js:871

Opened this issue · 1 comments

csold commented

I'm running the TL;DR code on windows. Its connecting to the ganglion through the dongle but getting this error

`Bluetooth powered on
Scan started
Found ganglion!
Stopping scan
Device is advertising 'Ganglion-12f6' service.
Scan stopped
C:\Users\COld\node_modules\openbci-ganglion\openBCIGanglion.js:871
this._rfduinoService.once(k.OBCINobleEmitterServiceCharacteristicsDiscover, (characteristics) => {
^

TypeError: Cannot read property 'once' of null
at Peripheral._peripheral.on (C:\Users\COld\node_modules\openbci-ganglion\openBCIGanglion.js:871:27)
at emitOne (events.js:96:13)
at Peripheral.emit (events.js:188:7)
at Noble.onServicesDiscover (C:\Users\COld\node_modules\noble\lib\noble.js:247:16)
at emitTwo (events.js:106:13)
at NobleBindings.emit (events.js:191:7)
at NobleBindings.onServicesDiscovered (C:\Users\COld\node_modules\noble\lib\hci-socket\bindings.js:305:8)
at emitTwo (events.js:106:13)
at Gatt.emit (events.js:191:7)
at Gatt. (C:\Users\COld\node_modules\noble\lib\hci-socket\gatt.js:361:12)`

Hey maybe I'm a bit late but I just encountered the same problem today. Check the accelerometer.js script on the examples folder. My guess is that you have to include the
ganglion.once(k.OBCIEmitterGanglionFound, (peripheral) => {
event to get it working. Check the script for the full code.

Hope that helps!