Forum Replies Created
-
AuthorPosts
-
AndrewParticipantWould the best solution until we have a deb package be to not host the tgz file in github but rather just the files?
AndrewParticipantThe instructions on the wiki page (http://rayshobby.net/mediawiki/index.php?title=OpenSprinkler_Pi) for setting up wifi are almost certainly too brief and assume too much knowledge. Let me know what can be done to improve them as you work through it or get in touch for anything that doesn’t make sense.
AndrewParticipantI was thinking that once the interval program has settled down a little, setting up a repository with it in it as a deb package would be good. And then to address this request hosting another deb or script that does all the basic setup specific to the OSPi would be relatively easy.
Then it should be simple enough to supply a single command to add the repository and install the packages.
AndrewParticipantI was thinking exactly the same thing. I’ll have a look at where splitting it would make the most sense over the weekend. I think it is also worth creating a page for the interval program as it gets more stable and putting the data logging section in there now would almost certainly make sense.
AndrewParticipantI’m a perl rather than a python programmer so I’m not certain this will work but if you import custom after the urls declaration couldn’t you then push the extra values into the urls array in custom.py? This would mean that the main script doesn’t have to have any of your code in it except the importing of the custom.py script (which I can see as definitely being worthwhile, or at least very easily re-added after any updates).
June 30, 2013 at 10:08 am in reply to: OpenSprinkler Interval Program now available for OSPi! #24436
AndrewParticipantI’ve been letting this roll around in the back of my mind all day and I think it probably makes most sense to use a global time value set to the equivalent of localtime() (or whatever the python version is). The timer never really needs to know it’s timezone since I very highly doubt that anyone is using one across timezones.
In the event someone is managing multiple timers that could be in different timezones I believe they probably are going to need to keep track of which timezone each timer is in anyway so as not to run into problems dealing with any local support staff that are likely in this scenario.
Since the underlying operating system is taking care of the system clock I doubt there is value in running on UTC time and adjusting for the timezone as there is on the OpenSprinkler that has to keep track of the RTC and NTP.
June 30, 2013 at 12:37 am in reply to: OpenSprinkler Interval Program now available for OSPi! #24434
AndrewParticipantI forgot to mention that the program preview is correct for the waterings but it is off for which day it thinks it is. I believe it is a time zone issue that Ray corrected on the regular OpenSprinkler javascript a few months ago and was due to being a long way from GMT (GMT+10 in my case). If I set the url as gp?d=date+1 then it thinks that is today but it can’t place the red line properly.
June 30, 2013 at 12:28 am in reply to: OpenSprinkler Interval Program now available for OSPi! #24433
AndrewParticipantI’ve been experiencing the hangs too. In my case it seems to be at the end of longer waterings like 30 minutes or 3 hours rather than shorter 3 minutes waterings. I’ll let you know if I still see a problem.
Also a very minor thing, but I have added a favicon to the code so I can distinguish the OSPi more easily amongst my tabs. I added the following to the urls
'/favicon.ico', 'favicon',
'/apple-touch-icon-precomposed.png', 'appleicon',
and then this later in the script:
class favicon:
"""redirect to /static/favicon.ico"""
def GET(self):
raise web.seeother('/static/favicon.ico')
return
class appleicon:
"""redirect to /static//apple-touch-icon-precomposed.png"""
def GET(self):
raise web.seeother('/static/apple-touch-icon-precomposed.png')
return
I’ve personally used the water drop icon from http://www.favicon.cc/?action=icon&file_id=609025 which has a Creative Commons, no attribution license, but I haven’t created the apple icon yet.
AndrewParticipantHi everyone,
I’ve been doing some extra cleaning of the OpenSprinkler Pi wiki page and would like comments on the clarity of my instructions. Other than Dan’s nice instructions on moving the interval program data logging location, most of it was adapted from my own notes and therefore may not be as clear as they could be for others.
I have taken care to maintain conventions like putting commands or file contents in to
blocks and to use generic commands like editor rather than nano or vi. But I don't know whether I have ended up being too verbose (hopefully it isn't the other way) or unclear.
I'd also like to know if there is anything more that others would like added. I haven't put anything in there yet about setting up the interval program but I would like to create proper init scripts, etc for that first and then create a deb package/repository.
Andrew
AndrewParticipantI’m a sysadmin so my skills lie far more there than in efficient coding but I believe swapping to second or minute pausing should be reasonably simple. It will probably more depend on having enough time available to devote to getting my head around your code. At this stage it’s probably going to be quicker to wait for you… 🙁
Are you happy to take code submissions?
AndrewParticipantdman, I’m sorry I didn’t explain clearly.
Basically, instead of accessing the OpenSprinkler directly you access the server’s web server. Each request you make is then sent to the OpenSprinkler by it instead and the returned page is modified as appropriate before handing it back to your web browser. Hopefully that makes more sense… ❓
you ==> server
server ==> OpenSprinkler
server <== OpenSprinkler
[server modifies response with links to local copies of javascript, etc]
you <== server
[you fetch javascript from local copy]
So you don’t talk directly to the OpenSprinkler. The server does it on your behalf. There are other things it does as well but they are more for a business environment (like logging who did what, etc) and these are what makes the effort extra worthwhile.
It is very lightweight stuff though so a Raspberry Pi with a PHP supporting web server would be more than enough, though we have it running on the server that does all the monitoring of the nursery’s watering, tank levels, etc.
I have a little bit more work to do before I can spend time making it ready for others but if you are interested email me directly: [email protected]
AndrewParticipantThe Pi edition looks fantastic Ray!
And the options it would open up are huge. Of course the benefit of the existing OpenSprinkler is simplicity and that you know exactly what code is running on the microcontroller without a full OS and all it’s bugs.
AndrewParticipantActually you can change the location that you get the javascript from without reprogramming the the OpenSprinkler.
What I do is have a php script that runs on a server that you access. It takes any references to the rayshobby.net address and rewrites them to it’s own address and adds the address of the OpenSprinkler in where it should before handing this back to the browser. There is a bit of work to be done after this in the javascript to make sure that the server is kept in the loop but after that it works a treat.
A few benefits:
The server logs all changes made along with the username of the person doing it (from the http authentication).
The scripts are all local and MUCH faster than accessing from the US (we are in Australia).
The timers each have the password set but the script inserts this into any request thus removing the need for staff to know it.
I have a very simple index.php that takes the list of OpenSprinklers from a vars.php used by the other script and this displays a selection of timers along with direct commands appropriate for them.I will be working on refining it over the next few weeks and will look at publishing it all then. In the meantime I can pass on what I’ve done if you would like to look at it once I can be sure I’m not exposing any of our network data, etc by mistake.
AndrewParticipantRay will correct me if I’m wrong but I believe the command to change the watering percentage is:
http:///co?pw= &o23= The cycle-and-soak could probably be a single program defined something like:
Time: 06:00 -> 08:00 (hh:mm)
Every: 0 hours 20 minutes
Duration: 10 minutes seconds
AndrewParticipantFortunately for the time being I can keep multiple timers on network segments behind wireless bridges. On these bridges I have added a script that is flushing the arp cache on the wired network once per second. This is obviously a total hack but it should suffice until a configurable MAC address is possible.
-
AuthorPosts