tedstriker / node-red-contrib-sequencer

Record and replay node-red msg-object sequences
2 stars 3 forks source link

Player node not working #3

Open dgP86 opened 6 years ago

dgP86 commented 6 years ago

Hi, I'm experiencing some problems with the player node: I'm trying to "replay" a quite large file for a demonstration (>26.000 lines of sequence).

Somehow I got the sequence playing meanwhile, but the player node does not respond to any pause or stop command, are they not working at the moment? Even when redeploying the flow it continues playing.

Thank's in advance and best regards.

Flow:

[{"id":"11afee13.0dc902","type":"debug","z":"5588e14c.833a38","name":"4","active":true,"console":"false","complete":"payload","x":930,"y":400,"wires":[]},{"id":"57f5532a.25a78c","type":"inject","z":"5588e14c.833a38","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"x":350,"y":200,"wires":[["e4407e2e.cc941"]]},{"id":"b671d970.c53a3","type":"inject","z":"5588e14c.833a38","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":360,"y":280,"wires":[["f71e5c6a.5dfe6"]]},{"id":"e4407e2e.cc941","type":"change","z":"5588e14c.833a38","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"play","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":200,"wires":[["ee21b255.0f9328"]]},{"id":"f71e5c6a.5dfe6","type":"change","z":"5588e14c.833a38","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"stop","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":280,"wires":[["ee21b255.0f9328"]]},{"id":"b7a4f0ab.ec7df8","type":"inject","z":"5588e14c.833a38","name":"Startup Sequence","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":400,"wires":[["3ce8087e.e67ab8","f813375.333a048"]]},{"id":"89eee331.82ec2","type":"file in","z":"5588e14c.833a38","name":"Read demo file","filename":"/home/pi/TestStream7.toc","format":"utf8","sendError":true,"x":340,"y":540,"wires":[["879d528d.eb785"]]},{"id":"879d528d.eb785","type":"change","z":"5588e14c.833a38","name":"Set sequence","rules":[{"t":"set","p":"sequence","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":400,"wires":[["ee21b255.0f9328","65143539.798ed4"]]},{"id":"ad6fc9ec.1e95","type":"inject","z":"5588e14c.833a38","name":"","topic":"","payload":"pause","payloadType":"str","repeat":"","crontab":"","once":false,"x":350,"y":240,"wires":[["cbcefb7b.14f96"]]},{"id":"cbcefb7b.14f96","type":"change","z":"5588e14c.833a38","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"pause","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":240,"wires":[["ee21b255.0f9328"]]},{"id":"3ce8087e.e67ab8","type":"file in","z":"5588e14c.833a38","name":"Read demo file","filename":"/home/pi/scripts/Demodaten2_1.toc","format":"utf8","sendError":true,"x":360,"y":400,"wires":[["879d528d.eb785","d811127.25ebbf"]]},{"id":"ee21b255.0f9328","type":"player","z":"5588e14c.833a38","name":"","runOnLoad":false,"x":790,"y":400,"wires":[["11afee13.0dc902"]]},{"id":"75f0cb2c.2d5c9c","type":"inject","z":"5588e14c.833a38","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"x":350,"y":320,"wires":[["1b7915e3.d3be2a"]]},{"id":"1b7915e3.d3be2a","type":"change","z":"5588e14c.833a38","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"remove","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":320,"wires":[["ee21b255.0f9328"]]},{"id":"8f56ffe0.0f6f6","type":"inject","z":"5588e14c.833a38","name":"Startup Sequence","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":540,"wires":[["89eee331.82ec2"]]},{"id":"f813375.333a048","type":"debug","z":"5588e14c.833a38","name":"1","active":true,"console":"false","complete":"payload","x":310,"y":480,"wires":[]},{"id":"d811127.25ebbf","type":"debug","z":"5588e14c.833a38","name":"2","active":true,"console":"false","complete":"payload","x":550,"y":480,"wires":[]},{"id":"65143539.798ed4","type":"debug","z":"5588e14c.833a38","name":"3","active":true,"console":"false","complete":"payload","x":790,"y":480,"wires":[]}]

tedstriker commented 6 years ago

my first, uneducated guess is, that the timers are not aborted in case of redeployment. So they just keep on playing. Sounds like something needs to be added to deal with this behaviour.

Why it's not responding to pause or stop is a good question. It's quite a while ago I worked with this. How long are the intervals between messages? How "heavy" is the payload? What did you change, to make it play? (You weren't able to, when you wrote the first version of this issue)

dgP86 commented 6 years ago

The delay between the messages varies from 1 ms to 1014 ms, average is 36 ms, median is 5 ms.

One typical message e.g. would look like this: {"data":{"topic":"Sensor Station A234 Sensor_Value","payload":"NOT_CONNECTED"},"delay":8},

To be honest - I don't know. Firstly even when copying the example from here to a file and feeding it to the player node it was not accepted ("Not a Sequence" or smth like this). In the ende I recorded a small sequence and replaced the data-part with my handmade data, which did the trick.

tedstriker commented 6 years ago

I wonder, if the short delays cause that odd behaviour. But that's a guess at best. Unfortunately I don't have a clue, what causes these issues, but if you happen to find out let me know. And if you work out a fix for that, PRs are always welcome :)