Hello!
I try to get this to work with the 28J60 Ethernet Shield.
But i get error in the android APP "An error has accoured, check your internet connection. Is Arduino Alive?"
It all works, i get "my item" and i can controll the arduino output from the app.
The only problem seems to be with the JSON from the arduino to the android app. When i test in my web browser its look like this:
//arduinoIP/?out=5&status=0
-> {"status" : "0" , "out" : "5"}
//arduinoIP/?out=5&status=1
-> {"status" : "1" , "out" : "5"}
What can be wrong?
if (strcmp(params, "?out=all") == 0)
{
e.print("{\"ip\" : \"192.168.0.15\", \"devices\" : [{ \"type\" : \"plug\", \"name\" : \"LAMPA\", \"out\" : \"");
e.print("5\"}");
e.print("]}");
e.respond();
Serial.println("OUTALL!!");
}
if (strcmp(params, "?out=5&status=0") == 0)
{
digitalWrite(pinOutRelay, LOW);
Serial.println("OUT LOW!!");
e.print("{\"status\" : \"0\" , \"out\" : \"");
e.print("5\"}");
e.respond();
Serial.println("LOW!!");
}
if (strcmp(params, "?out=5&status=1") == 0)
{
digitalWrite(pinOutRelay, HIGH);
Serial.println("OUT HIGH!!");
e.print("{\"status\" : \"1\" , \"out\" : \"");
e.print("5\"}");
e.respond();
Serial.println("HIGH!!");
}
Edit: I found the error
I had a old DomoticHome APP installed . It work perfect with the app from market.