Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Payload
- {"StatusSNS":{"Time":"2018-05-26T16:29:48","DS18B20":{"Temperature":24.8},"TempUnit":"C"}}
- //Code
- HTTPClient http; //Declare object of class HTTPClient
- //GET Data
- String Link = "http://192.168.1.59/cm?user=admin&password=pass&cmnd=status%2010";
- http.begin(Link); //Specify request destination
- int httpCode = http.GET(); //Send the request
- String payload = http.getString(); //Get the response payload
- //Serial.println(httpCode); //Print HTTP return code
- //Serial.println("Payload: " + payload); //Print request response payload
- //Start- und Endposition des Substring für die Temperatur
- int posStart = payload.indexOf("re:") + 3;
- int posEnd = payload.indexOf("},T");
- Serial.println("posStart: " + posStart);
- Serial.println("posEnd: " + posEnd);
- //Serial Output
- sStart:
- <empty line>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement