June 12, 2013 at 4:28 am #22474
I have been using my Raspberry Pi with my Opensprinkler V1.2U for over a month now and it has been working out very nicely.
Since I had no network connection in my garage I bridged the LAN to the USB wifi adapter on the Pi and it acts as a wireless adapter. Both my Opensprinkler and Pi are configured with static IP addresses.
I also installed the logging python scripts zonecheck.py. I had to make a few changes and do some error catching to get it not to crash, because it would only run for a short period of time and then hang up. I found out that once it would lose connection with the Opensprinkler that is when it would lock up the script.
I love this product, the price and the flexibility. It sure beats my old Orbit POS controller.June 12, 2013 at 1:40 pm #24482
Dan in CAParticipant
That’s really cool!
I was wondering if you could share the changes you made to the zonecheck.py scripts. I wrote that a while back when I was just getting started with Python programming and did not include any error checking. I’m sure your updates would be useful for other users as well.
DanJune 13, 2013 at 2:33 am #24484
I do not have much programming experience, but just enough to get the job done. So please don’t laugh. 😀
I added a timeout when it opens the URL for the opensprinkler and an exception in case it cannot connect with it at all. If it errors out it goes directly to the top of Main() after 1 second. I spent days trying to figure out why it would lock up, until I started debugging it. I also removed most everything under (if __name__ == “__main__”:), because I was getting errors. Otherwise it gets the job done.
When I go to the Raspi URL it automatically redirects to the Sprinklers.php and shows me the logs. I love the fact that it shows me the entire schedule for the week.
from urllib2 import Request, urlopen, URLError
req = Request (“http://10.0.0.11/sn0”)
state = urlopen(req, timeout = 2).read()
main()June 14, 2013 at 3:26 pm #24485
Dan in CAParticipant
Thanks for sharing Kenbob.
No need to apologize for your programming experience. You are figuring things out, tweaking the code to make it do what you want and hopefully having some fun along the way. That’s what counts.
I have downloaded the zonecheck.zip file and will check it out. The Sprinklers.php was written by David B. Gustovson and I am not that familiar with PHP.
I’m sure your efforts on this will be helpful to others.
You must be logged in to reply to this topic.