Enable remote users to control this application through the built-in web server. Never expose the web server port to the Internet.
--> ist Eingeschaltet
Enable remote users to control this application through the built-in web server. Never expose the web server port to the Internet.
--> ist Eingeschaltet
muß ich ein Video addon installieren?
der Bereich ist leer ....
bei deiner Eingabe fehlt oben vor den Videos noch ein slash. es müsste aber /home/pi/Videos/5.mp4 auch gehen.
nein, kein Unterschied, die Fehlermeldung bleibt gleich ...
auch die Anweisung
raspberrypi:8080/jsonrpc?request={"jsonrpc": "2.0", "id": 1, "method": "Player.Stop"}
bringt die Selbe Fehlermeldung, könnte es sein, daß Kodi einen eigenen user hat, dem die Rechte fehlen?
So, hab mal recherchiert das Problem ist folgendes: Du musst Post anstatt Get benutzen. Es gab mal ne Änderung im Kodi RPC Protokoll mit Kodi 18 und es wird nur noch POST akzeptiert. Also pur eine URL aufrufen reicht nicht mehr.
alles in den POST gepackt, aber mit dieser Funktion funktioniert es nicht.....
Die Verbindung ist da, dann wird mit dem Error code HTTPC_ERROR_CONNECTION_LOST abgebrochen ....
void send_video_start_stop() {
String jsondata =("/jsonrpc?request={\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\"/home/pi/Videos/1.mp4\"}}}");
const char *serverName = "http://192.168.178.91:8080";
WiFiClient client;
HTTPClient http;
BT.print("Verbunden: ");
BT.println(http.begin(client, serverName));
http.addHeader("Content-Type", "Content-Type: application/json");
int httpResponseCode = http.POST(jsondata); //Send the actual POST request
if (httpResponseCode > 0) {
String response = http.getString(); //Get the response to the request
BT.println(httpResponseCode); //Print return code
BT.println(response); //Print request answer
} else {
BT.print("Error on sending POST: ");
BT.println(httpResponseCode);
}
http.end();
}
Ich hab keine ahnung bezüglich dieser Funktion, wenn file im json aufruf aber ein protokoll sein soll, müsste es file:///home/bla/blub sein.
Don’t have an account yet? Register yourself now and be a part of our community!