ich versuche eine Systemvariable auf der CCU2 (Raspberrymatic) per HTTP zu setzen.
Mit
Code: Alles auswählen
http://192.168.0.76:8181/x.exe?antwort=dom.GetObject("test").State("11")
Mein Problem ist die Formatierung des "Befehls"
So klappt es zumindest nicht:
Code: Alles auswählen
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200); //Serial connection
WiFi.begin("XXXXX", "XXXXX"); //WiFi connection
while (WiFi.status() != WL_CONNECTED) { //Wait for the WiFI connection completion
delay(500);
Serial.println("Waiting for connection");
}
}
void loop() {
if(WiFi.status()== WL_CONNECTED){ //Check WiFi connection status
HTTPClient http; //Declare object of class HTTPClient
http.begin("http://192.168.0.76:8181/x.exe?antwort=dom.GetObject("test").State("11")" ); //Specify request destination
http.addHeader("Content-Type", "text/plain"); //Specify content-type header
int httpCode = http.POST("Message from ESP8266"); //Send the request
String payload = http.getString(); //Get the response payload
Serial.println(httpCode); //Print HTTP return code
Serial.println(payload); //Print request response payload
http.end(); //Close connection
}else{
Serial.println("Error in WiFi connection");
}
delay(30000); //Send a request every 30 seconds
}
VG
Leif