Kore icon indicating copy to clipboard operation
Kore copied to clipboard

Cannot create new connection to kodi on Libreelec

Open ilgiaco opened this issue 7 years ago • 10 comments

Hi

When I try to create new connection to Libreelec box (8.2.5, with kodi 17.6) from kore (v 2.4.4), and click "Test" button, I get "Can't connect to Kodi/XBMC. Please check configuration" message and the host is not added. I tested same configuration (ip, port, username and password) with yatse on same device and it works, so I think it's not a network or kodi configuration problem. Indeed, I can ping kodi host from android device, telnet to port 80 and 9090 works (can establish connection).

I did a tcpdump on my router while trying to add the host and this is what I found:

Kore->Kodi

POST /jsonrpc HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 49
Host: 192.168.2.82
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/2.3.0

{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":25}

Kodi->Kore

HTTP/1.1 401 Unauthorized
Content-Length: 0
Connection: close
WWW-Authenticate: Basic realm=XBMC
Date: Tue, 25 Sep 2018 23:07:19 GMT

It seems kore forgot to send basic authentication to kodi (I'm sure i filled the fields on the kore gui). I tried to do a similar request in python but with basic auth and I got:

>>> import requests as r
>>> rr=r.post('http://192.168.2.82/jsonrpc', auth=('username,'password'), json={"jsonrpc":"2.0","method":"JSONRPC.Ping","id":25})
>>> rr.content
b'{"id":25,"jsonrpc":"2.0","result":"pong"}'
>>> rr.status_code
200

ilgiaco avatar Oct 30 '18 22:10 ilgiaco

Did you try port 8080?

MilhouseVH avatar Oct 30 '18 23:10 MilhouseVH

Yep, doing a telnet on port 8080 I get a connection refused error, that's correct because I set remote port to 80. Trying port 8080 with kore gives me same error message as with port 80. Remember that I tested same configuration (ip, port, username and password) with yatse on same device and it worked :wink:

ilgiaco avatar Oct 30 '18 23:10 ilgiaco

Not to doubt you, but i'm pretty sure that Kore is sending the basic auth info. I suspect that something else is going on. I would ask you to try the following:

  • Check if by disabling the user/pwd on Kodi it connects;
  • Check if using another port in Kodi (and Kore) works. There's no need to use 8080, but use something else then 80 (or 9090).
  • Check if using another user/pwd works. Try something simple at first.

SyncedSynapse avatar Oct 31 '18 17:10 SyncedSynapse

Ok, here are the results of my tries

  • Disabling user/pwd kore works like a charm
  • Restored user/pwd and changed port from 80 to 8088: doesn't connect
  • Changed user/pwd: doesn't connect

ilgiaco avatar Nov 08 '18 20:11 ilgiaco

Also tested connecting to my laptop (Ubuntu 16.04 + kodi 17.6) and reinstalling kore on my device (Android 5.1). Still doesn't work

ilgiaco avatar Nov 08 '18 21:11 ilgiaco

Can confirm. Just bought new phone (Android 8.0), same problem, same solution (disable auth). Worked flawlessly with old Android 7 phone, still works fine with browser.

tsamm avatar Nov 20 '18 17:11 tsamm

I'm suspecting it has something to do with the specific Android implementation on your devices.

What are the makes of the devices, and the specific Android version? Can you get hold of another device (preferably from another maker) and test it with your setup?

SyncedSynapse avatar Dec 05 '18 08:12 SyncedSynapse

@SyncedSynapse I think you are right. I tried with two phones, Neffos C5 and Asus Zenfone 2, both with Android 5.1, and observed this problem with both devices.

ilgiaco avatar Dec 09 '18 23:12 ilgiaco

If both devices have the issue it doesn't confirm my suspiction, on the contrary. Were you able to get it to work correctly with any other device?

SyncedSynapse avatar Dec 10 '18 12:12 SyncedSynapse

I have same trouble on phone Xiaomi Redmi note 5 with android 8. Firstly was ok with this phone, but from updating of LE from 8.2.3 to 8.2.5 i have yet also problem. My tv box is Mecool KI Pro.

atirage21 avatar Jan 01 '19 18:01 atirage21