Hi Ray,
I have a web server on my LAN at 192.168.0.4
The web server has a php script (eg.
192.168.0.4/script.php?station=sn1&state=0) that logs data to a mysql table and issues a UDP broadcast of the data so that my HA system can update it’s status.
The plan is to alter your code so that everytime the sprinkler state change, it sends a GET ie.
192.168.0.4/script.php?station=sn1&state=0 To do this I would use the following code snippet to send “someString” to the php script.
//…other Ethernet setup code would go here…
// remote website ip address and port
static byte hisip[] = { 192,168,0,4 }; ether.copyIp(ether.hisip, hisip);
// called when the client request is complete
static void my_result_callback (byte status, word off, word len) {
Serial.print("<<< reply ");
Serial.println((const char*) Ethernet::buffer + off);
}
// someString in this example would be “script.php?station=sn1&state=0”
// Somewhere in the code where I want to do the actual call
ether.packetLoop(ether.packetReceive());
ether.browseUrl(PSTR("/script.php?"), someString, NULL, my_result_callback);
However I note that hisip is aleady assigned in your code.
Are you able to help me with the code I would use to send a simple http Get from Opensprinkler to a fixed IP on my LAn (192.168.0.4).
Once I get it working I will post the code on your
Thank