Thanks both....
Not that I was to seem like I am avoiding what you are saying, but just now an interesting thing is happening.
This is the routine on all machines.
There are some foreign nodes. A subflow (timestamp) and a gate
node used to control what is going on.
You can basically ignore them for now.
(Oh sorry and a queue node....)
[{"id":"9aaa840a.131cf8","type":"subflow","name":"Time Stamp","info":"**3 outputs. 1 - msg.payload holds the time. 2 - msg.time holds the time in a way to be used for reading time in a log file. 3 - outputs nsg.time in a format usable for file names**","category":"","in":[{"x":80,"y":100,"wires":[{"id":"6e2f05f9.3d8634"}]}],"out":[{"x":660,"y":180,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"df2d30dc.4a8ea","port":0}]},{"x":660,"y":230,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"4c048d86.0f87a4","port":0}]},{"x":660,"y":280,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"ebdb6996.ecdbd8","port":0}]}],"env":[],"color":"#FF8888","outputLabels":["For logging use","msg.time","For filename use"],"icon":"node-red/timer.svg"},{"id":"df2d30dc.4a8ea","type":"moment","z":"9aaa840a.131cf8","name":"","topic":"","input":"","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"en_AU","output":"","outputType":"msg","outTz":"Australia/Sydney","x":400,"y":180,"wires":[["ebdb6996.ecdbd8","c91e62d1.fa5ce"]]},{"id":"ebdb6996.ecdbd8","type":"string","z":"9aaa840a.131cf8","name":"","methods":[{"name":"replaceAll","params":[{"type":"str","value":":"},{"type":"str","value":""}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":450,"y":280,"wires":[[]]},{"id":"c91e62d1.fa5ce","type":"change","z":"9aaa840a.131cf8","name":"TOPIC","rules":[{"t":"move","p":"payload","pt":"msg","to":"time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":230,"wires":[["4c048d86.0f87a4"]]},{"id":"820c4f44.982f38","type":"change","z":"9aaa840a.131cf8","name":"Save","rules":[{"t":"set","p":"payload","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":140,"wires":[["8ebff2c7.232ed"]]},{"id":"4c048d86.0f87a4","type":"change","z":"9aaa840a.131cf8","name":"Get","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":230,"wires":[[]]},{"id":"6e2f05f9.3d8634","type":"switch","z":"9aaa840a.131cf8","name":"check topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"TIMESTAMP","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":100,"wires":[[],["820c4f44.982f38"]]},{"id":"8ebff2c7.232ed","type":"change","z":"9aaa840a.131cf8","name":"TimeStamp","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":210,"y":180,"wires":[["df2d30dc.4a8ea"]]},{"id":"eeec424a.f9c66","type":"subflow:9aaa840a.131cf8","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","x":4370,"y":1503,"wires":[[],["a6f3614b.c96338"],[]]},{"id":"52487feb.6471b","type":"switch","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"X","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":4350,"y":1450,"wires":[["eeec424a.f9c66"]]},{"id":"a6f3614b.c96338","type":"function","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","func":"var IP = global.get(\"MY_IP\");\nvar name = global.get(\"myDeviceName\");\n\nvar a = '\"WIFI_DEVICE\":\"' + name;\nvar b = '\"IP_Address\":\"' + IP;\nvar c = '\"Sent\":\"' + msg.time;\n\nmsg = {\"topic\":\"STATUS/WIFIDEVICEID\",\"payload\":\"{\" + a + '\",' + b + '\",' + c + '\"}'};\n\n//msg.topic = \"STATUS/WIFIDEVICEID\"; // not needed. See line above.\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":4520,"y":1450,"wires":[["d5e03328.bb55d","7750417a75475da5"]]},{"id":"25c53629.625d42","type":"inject","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"ID","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"X","payloadType":"str","x":4220,"y":1500,"wires":[["52487feb.6471b"]]},{"id":"fbdd582e.8e13b","type":"gate","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","controlTopic":"CONTROL","defaultState":"open","openCmd":"GO","closeCmd":"STOP","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":4220,"y":1450,"wires":[["52487feb.6471b"]]},{"id":"d5e03328.bb55d","type":"mqtt out","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"Device ID","topic":"STATUS/WIFIDEVICEID","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"bbf26a6c.b7922","x":4830,"y":1450,"wires":[]},{"id":"7750417a75475da5","type":"json","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","property":"payload","action":"","pretty":false,"x":4530,"y":1500,"wires":[["cf7b95ba.9dc48","cc90213c.09dd6"]]},{"id":"a2f5ce51.4a3ac","type":"mqtt in","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"IFF","topic":"IFF","qos":"2","broker":"bbf26a6c.b7922","inputs":0,"x":4080,"y":1450,"wires":[["19092b5a.4d260d","fbdd582e.8e13b"]]},{"id":"38e6f85c.2eb788","type":"inject","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"Stop","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"STOP","payloadType":"str","x":4080,"y":1370,"wires":[["fbdd582e.8e13b"]]},{"id":"9e5458e4.650f88","type":"inject","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"Go","repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"CONTROL","payload":"GO","payloadType":"str","x":4080,"y":1410,"wires":[["fbdd582e.8e13b"]]},{"id":"cf7b95ba.9dc48","type":"debug","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"IFF message reply","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":4790,"y":1400,"wires":[]},{"id":"cc90213c.09dd6","type":"q-gate","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"qgate","controlTopic":"CONTROL","defaultState":"queueing","openCmd":"Go","closeCmd":"Stop","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"","dropCmd":"","statusCmd":"","maxQueueLength":"100","keepNewest":true,"qToggle":false,"persist":false,"x":4670,"y":1500,"wires":[["b222f58f.2c302"]]},{"id":"19092b5a.4d260d","type":"debug","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":4360,"y":1410,"wires":[]},{"id":"6700dc4a.f6812c","type":"inject","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"RESET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"reset","payloadType":"str","x":4520,"y":1590,"wires":[["cc90213c.09dd6"]],"icon":"font-awesome/fa-eject"},{"id":"17358a28.5cbbd6","type":"inject","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"Next","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"trigger","payloadType":"str","x":4520,"y":1550,"wires":[["cc90213c.09dd6"]],"icon":"node-red/trigger.svg"},{"id":"b222f58f.2c302","type":"debug","z":"675e227d.d158b4","g":"eff2cce4.08f878","name":"IFF requests","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4820,"y":1500,"wires":[]},{"id":"bbf26a6c.b7922","type":"mqtt-broker","name":"TIMEPI MQTT","broker":"192.168.0.99","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"SOM","birthQos":"0","birthRetain":"false","birthPayload":"BedPi Comms UP","birthMsg":{},"closeTopic":"EOM","closeQos":"0","closeRetain":"false","closePayload":"BedPi Shutting DOWN","closeMsg":{},"willTopic":"EOM","willQos":"0","willRetain":"false","willPayload":"BedPi COMMS FAILURE","willMsg":{},"sessionExpiry":""}]
It listens to the IFF
topic.
If it receives an X
it broadcasts its message - which includes a timestamp of WHEN it was sent.
I send an X
out on the IFF
channel.
I get back three replies from one machine.
All timestamped at the same time and when I look at the queue node, there is only ONE occurrence shown.
Pictures say 1000 words.
Comments are BELOW the pictures.
Nothing queued.
IFF
list is empty.
I inject an IFF
message. (The X
is seen on the right of the picture and you see the debug
node just below the MQTT
node.)
2 messages/replies from BedPi
Only 1 event queued.
Where's the second one coming from?