OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Using a Raspberry Pi with OpenSprinkler Re: Re: Using a Raspberry Pi with OpenSprinkler

#23207

Andrew
Participant

Actually 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.