hadrienk / node-red-contrib-nordic-thingy

A node red node for the nordic thingy
Apache License 2.0
4 stars 1 forks source link

error in NodeThingy.ts - crash #4

Open michapr opened 5 years ago

michapr commented 5 years ago

The hint with "flokk" is fine - it is working ;) Would be nice to fix it.

Additional: If connecting a second BLE device (with other module) there will come up an error and node-red will crash:

6 Mar 08:17:31 - TypeError: Cannot read property 'toLowerCase' of undefined
    at ThingyScanner_1.default.device [as filter] (/home/pi/.node-red/node_modules/red-contrib-nordic-thingy/src/NodeThingy.ts:20:25)
    at EventEmitter.onDiscoverWithFilter (/home/pi/.node-red/node_modules/red-contrib-nordic-thingy/src/ThingyScanner.ts:59:30)
    at EventEmitter.emit (events.js:180:13)
    at Noble.constructor.onDiscover (/home/pi/.node-red/node_modules/noble-device/lib/util.js:30:29)
    at Noble.emit (events.js:185:15)
    at Noble.onDiscover (/home/pi/.node-red/node_modules/noble/lib/noble.js:178:10)
    at NobleBindings.emit (events.js:180:13)
    at NobleBindings.onDiscover (/home/pi/.node-red/node_modules/noble/lib/hci-socket/bindings.js:174:10)
    at Gap.emit (events.js:180:13)
    at Gap.onHciLeAdvertisingReport (/home/pi/.node-red/node_modules/noble/lib/hci-socket/gap.js:256:10)

I have inserted for now a try / catch in ...src/NodeThingy.ts line 20 then it is working, but of course this is not the real fix ;)

Thank you for the module! Michael

hadrienk commented 5 years ago

Indeed. I do not have the time to actively work on this module anymore but I will be happy to merge in a PR