- This topic is empty.
September 24, 2013 at 5:50 pm #22651
The September 23 2013 update to the Python Interval Program is now available on GitHub.
This is mostly a bug fix release, especially in the area of concurrent operation.
Added a new “revision” page to the native web interface.
Pointing your browser to [URL of the program]/rev will bring up a page with revision and date information.
for example on my test system it would be: 192.168.1.22:8080/rev
Up till now any running station would be stopped and scheduled stations would be cleared when the number of expansion boards was changed on the Options page.
This has been fixed and expansion boards can be added “on the fly” without interrupting a running program.
See the Wiki for update instructions:
From the README:
Additions, bug fixes:
1. Added a new revisions page to the native web interface.
2. Modified the home.js file to show time zone info in the last run log near the bottom of the page.
3. Fixed a bug in concurrent mode that kept a station running after it’s duration had expired.
4. Fixed a bug that would cause an exception (freeze the program) after the number of expansion boards was changed.
5. Fixed a bug that would stop a running station and clear scheduled stations when the number of expansion boards was changed in Options.
Files that were changed in this update:
DanSeptember 26, 2013 at 3:14 pm #25582
Thanks so much for adding the per station rain sensor option. That’s great! Plus all the other fixes and updates.
It took me a while to feel confident to do the “git pull” to bring in your commits and merge them with my local changes for the garage door and rain sensor. I’m new to git. I’ve been reading a really good on-line free book, http://git-scm.com/book, which has helped me quite a bit. http://genomewiki.ucsc.edu/index.php/Resolving_merge_conflicts_in_Git also helped with understanding what I needed to do to fix the conflicts I had in ospi.py and home.js.
Since the rain sensor is functional now, I wonder if you would consider adding code to ospi.py to define the pin, set up the gpio, read the pin, and poll it.
Here’s the way I’ve done it, adding to the appropriate sections:
res2 = 0
res2 = 1
pin_rain_sense = 25
GPIO.setup(pin_rain_sense, GPIO.IN, pull_up_down=GPIO.PUD_UP)
And inserting a call to get the rain sensor state in the main loop:
def main_loop(): # Runs in a seperate thread
""" ***** Main algorithm.***** """
print 'Starting main loop n'
last_min = 0
while True: # infinite loop
gv.now = time.time()+((gv.sd/4)-12)*3600 # Current time based on UTC time from the Pi adjusted by the Time Zone setting from options. updated once per second.
Other folks might choose a different input pin for the rain sensor, but the rest of the code would be there.
DennySeptember 26, 2013 at 6:00 pm #25583
How about making the pin selection a menu option?
IngoSeptember 27, 2013 at 2:03 am #25584
Just when I was thinking the program was getting stable and I could concentrate on some evapotranspiration calculations (weather based irrigation stuff…).
These suggestions are definitely interesting. I will give it some thought.
Thanks for the link to the Git book.
I’m new to Git also and that looks like a great resource. As a Windows user I have found TortoiseGit:
to be extremely helpful, especially since I’ve been using TortoiseSVN as my internal version control system throughout this project.
What sort of menu option would you suggest for the rain sensor pin define? An addition to the Options page comes to mind but your suggestion for the CPU temp. toggle was excellent and didn’t add to the already long Options page.
DanSeptember 27, 2013 at 3:13 am #25585
Dan, I’ve been looking into ET myself. I started a thread called Weather algorithms to discuss how to use weather data to water smarter.September 27, 2013 at 5:32 am #25586
There are two schools of thought here. The one is to add the setting to the Options page just like the HTTP port to be an integer number between X and Y. This way is simple and without any fuss. The second is to make the part of the config file that you need to edit manually. With this option you save on the Options Page space but then it’s a manual thing to edit. Fortunately it’s a static variable and once set then it will probably not change for the life of the Pi.
So, both have advantages and disadvantages. I would say stick it in the Options page and see what the reaction is from the community. My suggestion is to put it next to the ‘Use RS’ checkbox. If checked, then enable/make it visible, if unchecked then either disable it or hide it.
And… You could use either a textbox or a dropdownlist for GPIO pins.
IngoSeptember 27, 2013 at 10:58 am #25587
I had my first error this AM. I was trying to run a program one-time manually. I tried it first from the web app and then from the interval program. From the Web App, there was an error message saying it could not communicate with the sprinkler. On the interval program, it threw the error noted at the bottom of my post here.
To try to help with troubleshooting, I tried to see if I could get it to run manually and it did fine (running right now, in fact).
This is only in the run-once program setting.
I hope this helps.
schedule_stations() takes exactly 1 argument (0 given)
/home/pi/OSPi/ospi.py in GET, line 810
Traceback (innermost first)
/home/pi/OSPi/ospi.py in GET
▶ Local vars
/home/pi/OSPi/web/application.py in handle_class
return tocall(*args) …
▶ Local vars
/home/pi/OSPi/web/application.py in _delegate
return handle_class(cls) …
▶ Local vars
/home/pi/OSPi/web/application.py in handle
return self._delegate(fn, self.fvars, args) …
▶ Local vars
/home/pi/OSPi/web/application.py in process
return self.handle() …
▶ Local vars
‘[0,0,0,0,0,0,0,1080,1080,0,0,0,0,0,0,0,0]’September 27, 2013 at 5:42 pm #25588
There was an update just before the 9/23 one which had that problem.
If you try to check the rev page by adding /rev to the URL of the program you should get a page with a few lines of text that should include
ospi.py revision: 135
If it says revision 134 or you get a not found error, you just need to update to the latest version.
If you are running revision 135 and are still getting the error, please let me know.
DanSeptember 30, 2013 at 2:31 am #25589
That did the trick. I think I must have updated just prior to you uploading the new version.
- You must be logged in to reply to this topic.