REPEAT FUNCTION or re-execution of a piston is BROKEN


#1

1) Give a description of the problem
I’ve created several simple repeat test loops. They all stop after 5 to 8 cycles.

2) What is the expected behavior?
Should continue indefinitely

3) What is happening/not happening?
It’s not cycling.

Anyone can test. Just make a simple piston with the repeat function to turn a light on and off. it will freeze and stop.

I think it is related to something on the backend of webcore. I think it is stopping the cycles.

This is one of the test pistons


#2

Try waits of longer than 3 or 4 secs.


#3

Every ten seconds or so, there will always be a hiccup. This is a SmartThings limitation.

When I tested this, I had to add line 25 (UNTIL) to get it to repeat.
After that is done, line 18 starts it, and line 25 stops the loop.

temp


Only one trigger event fired this off continuously. (highlighted below)

(notice every ten seconds it schedules a wakeup, and a couple of seconds are lost: 13, 14 & 25, 26)


Piston not working, semaphore
#4

Is there a working to the limitation?

Wondering if setting the trigger to execute the Piston, then variable to count every 5 cycles, then Piston to pause and resume the other Piston based on the cycle count. But may cause other time based problems.

Ill experiment with your changes first, i can live with a delay, as long as it doesn’t stop


#5

If memory serves me correctly, that 10 second limit is a “safety” measure implemented by SmartThings for all connected “routines”. Thankfully, webCoRE is smart enough to work around this by executing as much as possible (about 10 sec) and then scheduling a wakeup for the rest of the code.


#6

So we have tweaked this in the other thread, but still keep coming back to the repeat loop freezing. We made it into 1 piston.

Can someone take a look and see if were missing anything? Wonder if the problem is with the piston or on the backend. Wonder if we may need to split it into 2 pistons again.

Logs still say waiting for semaphore.


#7

Like @WCmore explained, you’re going to run into the issue of tasks timing out because you have waits of 1 sec in a loop. It’s ST safeguard, I don’t know of what else you can try other than increasing your wait period.


#8

What would you recommend for a time out?


#9

Well, for what it’s worth, hammering commands out every second will definitely cause bottlenecks and missed commands over time. (both in that piston, as well as your other pistons) The ST hub stores the code for each piston online, so basically each second you will have data trying to pass both in to and out of your network.

Personally, I avoid looping whenever possible… and when I do create a loop, I make sure the loop is entirely internal code. (I avoid looping commands to devices)

Your mileage may vary.