OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OpenSprinkler Interval Program now available for OSPi! Re: Re: OpenSprinkler Interval Program now available for OSPi!

#24431

JBinkley
Member

Samer,

Thanks much for this!

I did encounter one small issue. The main web page broke because the Javascript loc value was not inside quotes.

This correction to line 361 seems to correct it.

        homepg += 'n'

Also, I notice both in the code that Dan provided and in some of what you have done, that we have some cases where time.time() is called both in an outer main loop and deeper. For instance, at the top of the main loop we have:

now = time.time()

and again in prog_match:

lt = time.localtime(time.time())

The differences are likely to be very small and I have not completely deciphered the logic, but that might on very rare occasions cause something unexpected. It might be better to either make the variable now a global and use that as the current time referent (or pass it as a variable). That seems to be what was done in the Arduino version. If I see any more hang issues after a couple of days, that’s an area I’ll look at more closely.