hkayann / node-red-contrib-ble-sense

Node-RED module for Bluetooth Low Energy (BLE) devices.
MIT License
6 stars 4 forks source link

"TypeError: Cannot read property 'toLowerCase' of undefined" #4

Closed GAZ082 closed 2 years ago

GAZ082 commented 2 years ago

Hi there, when using the scan in NodeRed I'm constantly getting that error.

Thanks!

hkayann commented 2 years ago

Hi @GAZ082,

Can you post the ss of your Node-RED setup please?

GAZ082 commented 2 years ago

@hkayann

[{"id":"4be8144eaa08b4f0","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"a577c8c0672bba17","type":"debug","z":"4be8144eaa08b4f0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":200,"wires":[]},{"id":"2b58e2f749583838","type":"inject","z":"4be8144eaa08b4f0","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":390,"y":200,"wires":[["7f01457f58575b0d"]]},{"id":"7f01457f58575b0d","type":"BLE Scanner","z":"4be8144eaa08b4f0","name":"BLE Scanner","searchFor":"","searchForType":"All","output":"Data","outputType":"Output","x":610,"y":200,"wires":[["a577c8c0672bba17"]]}]
hkayann commented 2 years ago

Hi @GAZ082 ,

You are feeding wrong input to scanner. Please read guidelines carefully. I will also add example flow there as well.

Here the most basic flow that works with no issues:

[{"id":"4be8144eaa08b4f0","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"a577c8c0672bba17","type":"debug","z":"4be8144eaa08b4f0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":220,"wires":[]},{"id":"2b58e2f749583838","type":"inject","z":"4be8144eaa08b4f0","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start","x":390,"y":180,"wires":[["7f01457f58575b0d"]]},{"id":"7f01457f58575b0d","type":"BLE Scanner","z":"4be8144eaa08b4f0","name":"BLE Scanner","searchFor":"","searchForType":"All","output":"Peripheral","outputType":"Output","x":610,"y":220,"wires":[["a577c8c0672bba17"]]},{"id":"67bd794c2a3b35a5","type":"inject","z":"4be8144eaa08b4f0","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"stop","x":390,"y":260,"wires":[["7f01457f58575b0d"]]}]
GAZ082 commented 2 years ago

@hkayann Thanks! But could not find an example besides the screenshot in the README...

Now Im just getting in the debug console a stream of "UNDEFINED":

image

hkayann commented 2 years ago

Hi @GAZ082,

The output was a complete message object not the payload, but I changed it, outputting payload makes more sense.

Can you update and try one more time please?

GAZ082 commented 2 years ago

@hkayann thank you! Its working perfectly now!