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

Start and stop node #18

Open
aprylwine opened this issue Dec 18, 2017 · 3 comments
Open

Start and stop node #18

aprylwine opened this issue Dec 18, 2017 · 3 comments

Comments

@aprylwine
Copy link

Can't start and stop the scanning using the following:

he node will begin scanning after it is deployed, and will not stop until it is deployed again. It can be useful to turn on and off scanning to conserve energy and force scan requests to be sent triggering devices to respond. To control scanning, you may send a message containing msg.payload.scan=false to turn off scanning, and msg.payload.scan=true to turn it on.

@mblackstock
Copy link
Contributor

This works for me on Mac OS. Please let me know what platform you are using. Here is a sample flow:

[{"id":"1e16b965.4a72b7","type":"scan ble","z":"4a370b8c.b8f334","uuids":"","duplicates":false,"name":"","x":606.5,"y":385,"wires":[["2aff3b2e.ec22f4"]]},{"id":"8b56c9d7.079d18","type":"inject","z":"4a370b8c.b8f334","name":"","topic":"","payload":"{\"scan\":true}","payloadType":"json","repeat":"","crontab":"","once":false,"x":307,"y":354,"wires":[["1e16b965.4a72b7"]]},{"id":"2aff3b2e.ec22f4","type":"debug","z":"4a370b8c.b8f334","name":"","active":true,"console":"false","complete":"false","x":821,"y":340,"wires":[]},{"id":"36937f8e.fc358","type":"inject","z":"4a370b8c.b8f334","name":"","topic":"","payload":"{\"scan\":false}","payloadType":"json","repeat":"","crontab":"","once":false,"x":313,"y":412,"wires":[["1e16b965.4a72b7"]]}]

@rnowacki
Copy link

Thank you for that example!

@jameshowe
Copy link

@aprylwine can you show an example of the flow you are using or how you set the scan property? Similar to @mblackstock's example, setting {"scan": false} in the payload should work.

There is a strict equality check in the code, so it must be set as a boolean, {"scan": "false"} or {"scan": 0} etc. won't cut it.

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

No branches or pull requests

4 participants