Code:
[{"id":"a9d28571.a909d8","type":"inject","z":"c56bddee.ca0a18","name":"WAP scan *","props":[{"p":"payload"}],"repeat":"40","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"1","payloadType":"num","x":180,"y":330,"wires":[["31e5b191.b8f056","f8a0810e.2d9378"]],"info":"Make sure `msg.delay` (set on second line) is a lot greater than the scan time."},{"id":"f8a0810e.2d9378","type":"pythonshell in","z":"c56bddee.ca0a18","name":"wifiscan","pyfile":"/home/pi/python_stuff/wifiscan.py","virtualenv":"","continuous":false,"stdInData":false,"x":550,"y":310,"wires":[["b1f4ee0993eb1635"]]},{"id":"b1f4ee0993eb1635","type":"change","z":"c56bddee.ca0a18","name":"delay (ms)","rules":[{"t":"set","p":"delay","pt":"msg","to":"120000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":310,"wires":[["7d11f7e2.8ab188","bed0b75b24a7d023","f63974b5bff323ba","89c86f65.2dd438"]],"l":false},{"id":"89c86f65.2dd438","type":"split","z":"c56bddee.ca0a18","name":"Spliter","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":170,"y":510,"wires":[["ec424f64.9e3fb","80326bb7.b1ebd"]]},{"id":"ec424f64.9e3fb","type":"switch","z":"c56bddee.ca0a18","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Marys_Farm_2.4","vt":"str"},{"t":"cont","v":"PiNet","vt":"str"},{"t":"cont","v":"MusicPi","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":510,"wires":[["a2ddf193.eb9b2","cbc7451e.882c48","6f85dabf.e8e8ec"],["b6d0e5a5.8c246","c4c40434.f4ab6"],["cf9bae6b.340e68","efb14f6c.1c6ba8"]]},{"id":"6f85dabf.e8e8ec","type":"change","z":"c56bddee.ca0a18","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":505,"y":420,"wires":[["e4d2eb6a.510b3","1bf0835ecc376fa6"]],"l":false},{"id":"1bf0835ecc376fa6","type":"trigger","z":"c56bddee.ca0a18","name":"Trigger (v)","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"60","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":710,"y":390,"wires":[["72f00882.b6efc8","375a3741.743c4","babc12dd.24df7"]]}]
I have a python
script running to get WAP names.
(You can bypass that)
There is a change
node after that which sets the msg.delay
. It is now set to 120000.
It fails if it is set to 12000.
The message is then sent down and split
so each WAP name is a different line.
That is then sent through a switch
node and another change
node to set the payload.
Then it gets to the trigger
node.
It keeps failing from what I can see.
The other trigger
node (on the right) is also timing out.
Sorry it is a mess. I bypassed a couple of foreign nodes.
You will also have to edit the switch
node (or actually probably remove it)
and the wifiscan
node won't work as it runs a python script.