#include <Bridge.h>
#include <HttpClient.h>
// reset-mcu;reboot
String result = String("");
void setup() {
delay(5000);
pinMode(2, OUTPUT);
Bridge.begin();
digitalWrite(2, HIGH);
}
void loop() {
HttpClient client;
// PIN 2
client.get("https://myserver.example.com/ajax/sppower?kiosk=001");
result = "";
while (client.available()) {
char c = client.read();
result = result + c;
}
if(result.indexOf("reboot") >= 0) {
digitalWrite(2, LOW);
delay(3000);
digitalWrite(2, HIGH);
}
delay(7000);
}