So, I'm doing a project with the Arduino Ethernet where I must send continuous data to a site named Cosm, who will generate a graphic for me.
But I also want my Arduino to detect errors on the system I'm building, and if so, send a data through a URL to another site, which is not Cosm. This is working as expected, the problem is that I can connected and send the "Error" warning just 1 time to my site.
As it is right now:
if(condition){
if (client.connect("www.mysite.com", 80)){
client.print("GET /?status=Failure&strbuildingnumber=");
client.print(FEEDID);
client.println(" HTTP/1.0");
client.println();
}
}
I'm wondering what is the correct way to do what I'm trying do to, would be this:
if(condition){
if(client.connected() == true){ //remember I have to 2 servers on the same code, probably wouldn't work.
client.print("GET /?status=Failure&strbuildingnumber=");
client.print(FEEDID);
client.println(" HTTP/1.0");
client.println();
}
else if (client.connect("www.mysite.com", 80)){
client.print("GET /?status=Failure&strbuildingnumber=");
client.print(FEEDID);
client.println(" HTTP/1.0");
client.println();
}
}
Another thing I was wondering is if it's possible to make a HTTP request, as GET just using the client.print, for example:
if(condition){
client.print("www.mysite.com/?status=Failure&strbuildingnumber=");
client.print(FEEDID);
client.println(" HTTP/1.0");
client.println();
{