OpenSprinkler Forums OpenSprinkler Mobile and Web App Mobile Web App with Screenshots (Updated) Re: Re: Mobile Web App for OpenSprinkler (w/Screenshots)

#23877

Samer
Keymaster

My UI sends the commands to my PHP code which subsequently sends the commands to the OpenSprinkler. So, in the website code you will notice a command like:

$.get("index.php","action=spon&zone=1")

Then, inside main.php you will find a function called spon that looks like:


function spon() {
send_to_os("http://".$os_ip."/sn".$.REQUEST."=1");
}

This is from memory, I am not at my computer at the moment. But hopefully you get the idea. The send_to_os function just calls file_get_contents and checks if any errors occurred.

Hope this helps!