iobroker-community-adapters / ioBroker.kodi

ioBroker adapter for KODI mediaplayer connection
MIT License
1 stars 2 forks source link

Still no connection to device or service #28

Open cap-blackbeard opened 1 year ago

cap-blackbeard commented 1 year ago

Please check my issue #22. I installed version 2.0.9 from github and now I get the following log:

kodi.0 | 2022-12-26 23:18:15.514 | debug | Error: SyntaxError: Failed to handle response: Unexpected token � in JSON at position 0 kodi.0 | 2022-12-26 23:18:15.505 | debug | KODI connecting to: 192.168.0.22:9090 kodi.0 | 2022-12-26 23:18:15.505 | debug | Error: Server responded with error: Invalid params.{GetPlayList} kodi.0 | 2022-12-26 23:18:15.504 | info | KODI connected

Everything worked before the update.

Apollon77 commented 1 year ago

Hmm... What can I say ... Which Kodi version is used?

1.) "Invalid params.{GetPlayList}" ... was there another kido change and now parametrs needs to be different? Can someone find that out please

2.) Unexpected token � in JSON at position 0 seems like the endpoint that should return JSON returns binary stuff or at least not proper encoded response directly at the very first character ...

Apollon77 commented 1 year ago

I enhanced logging ...please install from GitHub ... if the "Syntacterror" message do not contain more infos please do manually this change https://github.com/iobroker-community-adapters/kodi-ws/commit/ad5a1fdc5cd0a282e6818ff152594b5d32535103 and provide log

And I saw that you had the " Invalid params.{GetPlayList}" also before already

Apollon77 commented 1 year ago

We send

    connection.run('Playlist.GetItems', {

"playlistid": playlist_id, "properties": ["title", "thumbnail", "fanart", "rating", "genre", "artist", "track", "season", "episode", "year", "duration", "albumid", "album", "showtitle", "playcount", "file"]/,"limits":{"start":0,"end":750}/

From what I found this seems valid ... unless some of the properties are no longer defined ... Is a Kodi logfile or such provide more insights?

Apollon77 commented 1 year ago

According to https://kodi.wiki/view/JSON-RPC_API/v13#Playlist.GetItems all should be fine ........

cap-blackbeard commented 1 year ago

Which Kodi version is used?

I run 2 KODI instances: 1: LiberELEC with KODI version 19.4 (Matrix) 2: KODI docker image with KODI 19.4 (Matrix) https://github.com/matthuisman/docker-kodi-headless

The KODI-docker-image generates different logs, but also does not connect.

2023-01-16 21:26:47.810 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" enabled 2023-01-16 21:26:47.899 - ^[[32minfo^[[39m: host.1adec49c25d3 instance system.adapter.kodi.0 started with pid 524314 2023-01-16 21:26:48.597 - ^[[34mdebug^[[39m: kodi.0 (524314) Redis Objects: Use Redis connection: 0.0.0.0:9001 2023-01-16 21:26:48.631 - ^[[34mdebug^[[39m: kodi.0 (524314) Objects client ready ... initialize now 2023-01-16 21:26:48.633 - ^[[34mdebug^[[39m: kodi.0 (524314) Objects create System PubSub Client 2023-01-16 21:26:48.633 - ^[[34mdebug^[[39m: kodi.0 (524314) Objects create User PubSub Client 2023-01-16 21:26:48.664 - ^[[34mdebug^[[39m: kodi.0 (524314) Objects client initialize lua scripts 2023-01-16 21:26:48.669 - ^[[34mdebug^[[39m: kodi.0 (524314) Objects connected to redis: 0.0.0.0:9001 2023-01-16 21:26:48.694 - ^[[34mdebug^[[39m: kodi.0 (524314) Redis States: Use Redis connection: 0.0.0.0:9002 2023-01-16 21:26:48.705 - ^[[34mdebug^[[39m: kodi.0 (524314) States create System PubSub Client 2023-01-16 21:26:48.706 - ^[[34mdebug^[[39m: kodi.0 (524314) States create User PubSub Client 2023-01-16 21:26:48.763 - ^[[34mdebug^[[39m: kodi.0 (524314) States connected to redis: 0.0.0.0:9002 2023-01-16 21:26:48.932 - ^[[32minfo^[[39m: kodi.0 (524314) starting. Version 2.0.9 (non-npm: iobroker-community-adapters/ioBroker.kodi) in /opt/iobroker/n> 2023-01-16 21:26:53.964 - ^[[34mdebug^[[39m: kodi.0 (524314) KODI connecting to: 192.168.0.22:9090 2023-01-16 21:26:54.051 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" disabled 2023-01-16 21:26:54.051 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 (force=false, process=true) 2023-01-16 21:26:54.056 - ^[[32minfo^[[39m: kodi.0 (524314) Got terminate signal TERMINATE_YOURSELF 2023-01-16 21:26:54.058 - ^[[32minfo^[[39m: kodi.0 (524314) terminating 2023-01-16 21:26:54.059 - ^[[32minfo^[[39m: kodi.0 (524314) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason 2023-01-16 21:26:54.101 - ^[[32minfo^[[39m: kodi.0 (524314) KODI connected 2023-01-16 21:26:54.104 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 send kill signal 2023-01-16 21:26:54.105 - ^[[34mdebug^[[39m: kodi.0 (524314) Error: Server responded with error: Invalid params.{GetPlayList} 2023-01-16 21:26:54.106 - ^[[34mdebug^[[39m: kodi.0 (524314) KODI connecting to: 192.168.0.22:9090 2023-01-16 21:26:54.113 - ^[[34mdebug^[[39m: kodi.0 (524314) Error: SyntaxError: Failed to handle response: Unexpected token � in JSON at position 0

iobroker-community-adapters/kodi-ws@ad5a1fd

Where can I find the file Connection.js?

I'll do my best to give you all the important information.

Apollon77 commented 1 year ago

The file should be at/opt/iobroker/node_modules/iobroker.kodi/node_modules/kodi-ws/lib/Connection.js OR /opt/iobroker/node_modules/kodi-ws/lib/Connection.js

cap-blackbeard commented 1 year ago

2023-01-16 23:18:24.966 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" enabled 2023-01-16 23:18:25.055 - ^[[32minfo^[[39m: host.1adec49c25d3 instance system.adapter.kodi.0 started with pid 1675 2023-01-16 23:18:25.703 - ^[[34mdebug^[[39m: kodi.0 (1675) Redis Objects: Use Redis connection: 0.0.0.0:9001 2023-01-16 23:18:25.735 - ^[[34mdebug^[[39m: kodi.0 (1675) Objects client ready ... initialize now 2023-01-16 23:18:25.737 - ^[[34mdebug^[[39m: kodi.0 (1675) Objects create System PubSub Client 2023-01-16 23:18:25.738 - ^[[34mdebug^[[39m: kodi.0 (1675) Objects create User PubSub Client 2023-01-16 23:18:25.767 - ^[[34mdebug^[[39m: kodi.0 (1675) Objects client initialize lua scripts 2023-01-16 23:18:25.772 - ^[[34mdebug^[[39m: kodi.0 (1675) Objects connected to redis: 0.0.0.0:9001 2023-01-16 23:18:25.795 - ^[[34mdebug^[[39m: kodi.0 (1675) Redis States: Use Redis connection: 0.0.0.0:9002 2023-01-16 23:18:25.804 - ^[[34mdebug^[[39m: kodi.0 (1675) States create System PubSub Client 2023-01-16 23:18:25.805 - ^[[34mdebug^[[39m: kodi.0 (1675) States create User PubSub Client 2023-01-16 23:18:25.863 - ^[[34mdebug^[[39m: kodi.0 (1675) States connected to redis: 0.0.0.0:9002 2023-01-16 23:18:26.031 - ^[[32minfo^[[39m: kodi.0 (1675) starting. Version 2.0.9 (non-npm: iobroker-community-adapters/ioBroker.kodi) in /opt/iobroker/nod> 2023-01-16 23:18:30.788 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" disabled 2023-01-16 23:18:30.789 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 (force=false, process=true) 2023-01-16 23:18:30.795 - ^[[32minfo^[[39m: kodi.0 (1675) Got terminate signal TERMINATE_YOURSELF 2023-01-16 23:18:30.797 - ^[[32minfo^[[39m: kodi.0 (1675) terminating 2023-01-16 23:18:30.798 - ^[[32minfo^[[39m: kodi.0 (1675) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason 2023-01-16 23:18:30.838 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 send kill signal 2023-01-16 23:18:31.062 - ^[[34mdebug^[[39m: kodi.0 (1675) KODI connecting to: 192.168.0.22:9090 2023-01-16 23:18:31.204 - ^[[32minfo^[[39m: kodi.0 (1675) KODI connected 2023-01-16 23:18:31.208 - ^[[34mdebug^[[39m: kodi.0 (1675) Error: Server responded with error: Invalid params.{GetPlayList} 2023-01-16 23:18:31.209 - ^[[34mdebug^[[39m: kodi.0 (1675) KODI connecting to: 192.168.0.22:9090 2023-01-16 23:18:31.217 - ^[[34mdebug^[[39m: kodi.0 (1675) Error: SyntaxError: Failed to handle response: Failed to handle response: Unexpected token � in >

Apollon77 commented 1 year ago

Da ist aber nicht das Logging drin was eingebaut werden sollte

cap-blackbeard commented 1 year ago

Da ist aber nicht das Logging drin was eingebaut werden sollte

ja. Mein Fehler ich habe die Zeile 35 nicht ersetzt, sondern die Datei um Zeile 36 erweitert. Jetzt habe ich err.message = 'Failed to handle response: ' + err.message; komplett durch err.message = 'Failed to handle response: ' + err.message + ', Data: ' + (Buffer.isBuffer(message) ? message.toString('hex') : message); ersetzt und den Container neu gestartet.

Der Log sieht für mich aber immer noch genauso aus: 2023-01-18 20:26:25.874 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" enabled 2023-01-18 20:26:25.965 - ^[[32minfo^[[39m: host.1adec49c25d3 instance system.adapter.kodi.0 started with pid 1738 2023-01-18 20:26:26.648 - ^[[34mdebug^[[39m: kodi.0 (1738) Redis Objects: Use Redis connection: 0.0.0.0:9001 2023-01-18 20:26:26.683 - ^[[34mdebug^[[39m: kodi.0 (1738) Objects client ready ... initialize now 2023-01-18 20:26:26.686 - ^[[34mdebug^[[39m: kodi.0 (1738) Objects create System PubSub Client 2023-01-18 20:26:26.687 - ^[[34mdebug^[[39m: kodi.0 (1738) Objects create User PubSub Client 2023-01-18 20:26:26.724 - ^[[34mdebug^[[39m: kodi.0 (1738) Objects client initialize lua scripts 2023-01-18 20:26:26.729 - ^[[34mdebug^[[39m: kodi.0 (1738) Objects connected to redis: 0.0.0.0:9001 2023-01-18 20:26:26.753 - ^[[34mdebug^[[39m: kodi.0 (1738) Redis States: Use Redis connection: 0.0.0.0:9002 2023-01-18 20:26:26.763 - ^[[34mdebug^[[39m: kodi.0 (1738) States create System PubSub Client 2023-01-18 20:26:26.764 - ^[[34mdebug^[[39m: kodi.0 (1738) States create User PubSub Client 2023-01-18 20:26:26.823 - ^[[34mdebug^[[39m: kodi.0 (1738) States connected to redis: 0.0.0.0:9002 2023-01-18 20:26:26.983 - ^[[32minfo^[[39m: kodi.0 (1738) starting. Version 2.0.9 (non-npm: iobroker-community-adapters/ioBroker.kodi) in /opt/iobroker/nod> 2023-01-18 20:26:32.006 - ^[[34mdebug^[[39m: kodi.0 (1738) KODI connecting to: 192.168.0.22:9090 2023-01-18 20:26:32.042 - ^[[32minfo^[[39m: host.1adec49c25d3 "system.adapter.kodi.0" disabled 2023-01-18 20:26:32.043 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 (force=false, process=true) 2023-01-18 20:26:32.051 - ^[[32minfo^[[39m: kodi.0 (1738) Got terminate signal TERMINATE_YOURSELF 2023-01-18 20:26:32.053 - ^[[32minfo^[[39m: kodi.0 (1738) terminating 2023-01-18 20:26:32.054 - ^[[32minfo^[[39m: kodi.0 (1738) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason 2023-01-18 20:26:32.090 - ^[[32minfo^[[39m: host.1adec49c25d3 stopInstance system.adapter.kodi.0 send kill signal 2023-01-18 20:26:32.143 - ^[[32minfo^[[39m: kodi.0 (1738) KODI connected 2023-01-18 20:26:32.146 - ^[[34mdebug^[[39m: kodi.0 (1738) Error: Server responded with error: Invalid params.{GetPlayList} 2023-01-18 20:26:32.148 - ^[[34mdebug^[[39m: kodi.0 (1738) KODI connecting to: 192.168.0.22:9090 2023-01-18 20:26:32.156 - ^[[34mdebug^[[39m: kodi.0 (1738) Error: SyntaxError: Failed to handle response: Unexpected token � in JSON at position 0, Data: �^B^C�

cap-blackbeard commented 1 year ago

Ah.... oh... ich habe neulich auf advancedsettings.xml umgestellt. Könnt hier der Fehler liegen? Kennst Du Dich da aus?

Apollon77 commented 1 year ago

Auskennen tue ich mich da nicht, aber am Ende kommt da Binary-Content anstelle JSON zurück als Message. Warum ... keine Ahnung. Ich habe kein Kodi

cap-blackbeard commented 1 year ago

Ich bin fest der Überzeugung, dass es mit der Konfiguration per advancedsetting.xml zu tun hat. Ich habe noch eine 3. KODI-Instanz auch auf Basis von LibreELEC. Nur eben klassisch konfiguriert. Diese verbindet sich mit dem ioBroker-Adapter problemlos.

Was braucht denn der Adapter für eine Konfiguration von KODI? Hier ein Auszug meiner advancedsettings.xml: `

*** true true 25 750 20 9777 10 false false false true 8080 true *** *** true

`

Apollon77 commented 1 year ago

Können andere User das beantworten? Ich leider nicht ...

arteck commented 1 year ago

Nur eben klassisch konfiguriert.

und warum konfigurierst du nicht die 2 anderen genauso ?? die Vorlage aus der neuen hast du ja

wobei

das was du da gepostet hast gehört nicht in die advancedsetting.xml das hier ist meine aus Matrix libreelec

<advancedsettings>   
<!--<loglevel>1</loglevel>-->
    <cache>
        <buffermode>1</buffermode>
        <memorysize>314572800</memorysize>
        <readfactor>15</readfactor>
    </cache>

   <videodatabase>

  </videodatabase> 

   <musicdatabase>

    </musicdatabase> 

   <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
  </videolibrary>

  <network>
    <alwaysforcebuffer>true</alwaysforcebuffer>
    <buffermode>1</buffermode>
    <freememorycachepercent>5</freememorycachepercent>
    <cachemembuffersize>262144000</cachemembuffersize>
    <readbufferfactor>25</readbufferfactor>
  </network>

  <samba>
    <clienttimeout>20</clienttimeout>
  </samba>

  <video>
    <excludefromlisting>
      <regexp>[!-._ \\/](?-i)(flash)[-._ \\/]</regexp>
    </excludefromlisting>
  </video>

  <audio>
    <excludefromlisting>
      <regexp>[!-._ \\/](?-i)(flash|storage)[-._ \\/]</regexp>
    </excludefromlisting>
  </audio>

  <tvshowmatching>
    <regexp>[Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+)([^\\/]*)$</regexp>  <!-- foo.s01.e01, foo.s01_e01, S01E02 foo, S01 - E02 -->
    <regexp>[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$</regexp>  <!-- foo.ep01, foo.EP_01 -->
    <regexp>([0-9]{4})[\.-]([0-9]{2})[\.-]([0-9]{2})</regexp>  <!-- foo.yyyy.mm.dd.* (byDate=true) -->
    <regexp>([0-9]{2})[\.-]([0-9]{2})[\.-]([0-9]{4})</regexp>  <!-- foo.mm.dd.yyyy.* (byDate=true) -->
    <regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)$</regexp>  <!-- foo.1x09* or just /1x09* -->
    <regexp>[\\/\._ -]([0-9]+)([0-9][0-9])([\._ -][^\\/]*)$</regexp>  <!-- foo.103*, 103 foo -->
    <regexp>[\/._ -]p(?:ar)?t[_. -]()([ivx]+)([._ -][^\/]*)$</regexp>  <!-- Part I, Pt.VI -->
  </tvshowmatching>   

</advancedsettings>
cap-blackbeard commented 1 year ago

und warum konfigurierst du nicht die 2 anderen genauso ??

hmm... ja also eigentlich ist mein Ziel alle Installationen per advancedsetting.xml zu konfigurieren. Ich habe eine zentrale MariaDB konfiguriert und möchte gerne alle "Clients" an die Datenbank anbinden. Außerdem habe ich einen docker-KODI-Headless-container installiert, um von extern auf meine Medien zugriff zu haben. Da der container headless ist, brauchte ich eine Möglichkeit diesen zu konfigurieren. Daher die Verwendung der advancedsettings.xml. Hier gibt es Beispiele, um Einstellungen zu konfigurieren: https://kodi.wiki/view/Web_interface

Wäre ne tolle Sache, wenn wir das Problem lösen können!

Apollon77 commented 1 year ago

Das klingt mir eher nach Google und Kodi Forum ... Die Frageist ja: Warum liefert websocket verbindung plötzlich Binary kram anstelle JSON ... das musst Du rausfinden

cap-blackbeard commented 1 year ago

@Apollon77 Ein kurzes Update. So wie es aussieht, muss mittlerweile die Aktivierung des Webservers per UI extra bestätigt werden. Diese Meldung lässt sich aus Sicherheitsgründen ggf. nicht per advancedsettings.xml bestätigen.

Ich werde mich wieder melden, sobald ich Neuigkeiten habe.

Apollon77 commented 1 year ago

@cap-blackbeard Wenn Du Infos hast gern auch in einer variante hier als (englischen) text oder PR für die Readme