a-i-ks / ioBroker.volumio

ioBroker adapter to remote control Volumio
MIT License
2 stars 3 forks source link

Missing connection to host #2

Closed wberger42 closed 3 years ago

wberger42 commented 3 years ago

Issue: Instance does not fully connect, buttons not working.

I installed Version 0.1.0 of Volumio Remote Control. (IoBroker on RPI4, js-controller 3.1.4). Instance gets connection to volumio but for whatever reason not to host (whatever this means).

image

Playback info works perfectly. Quick update of the parameters, everything there. But none of the comand buttons is working. In the log there are several uncaught exceptions running through.

`

volumio.0 2021-02-06 14:20:45.375 info (13004) Terminated (NO_ERROR): Without reason
volumio.0 2021-02-06 14:20:45.374 info (13004) terminating
volumio.0 2021-02-06 14:20:45.357 error at processTicksAndRejections (internal/process/task_queues.js:97:5)
volumio.0 2021-02-06 14:20:45.357 error at Volumio.onReady (/opt/iobroker/node_modules/iobroker.volumio/build/main.js:96:33)
volumio.0 2021-02-06 14:20:45.357 error at Function.listen (/opt/iobroker/node_modules/express/lib/application.js:618:24)
volumio.0 2021-02-06 14:20:45.357 error at Server.listen (net.js:1447:7)
volumio.0 2021-02-06 14:20:45.357 error at listenInCluster (net.js:1361:12)
volumio.0 2021-02-06 14:20:45.357 error at Server.setupListenHandle [as _listen2] (net.js:1313:16)
volumio.0 2021-02-06 14:20:45.357 error (13004) Error: listen EADDRINUSE: address already in use :::3000
volumio.0 2021-02-06 14:20:45.355 error (13004) uncaught exception: listen EADDRINUSE: address already in use :::3000
volumio.0 2021-02-06 14:20:45.232 info (13004) starting. Version 0.1.0 in /opt/iobroker/node_modules/iobroker.volumio, node: v12.17.0, js-controller: 3.1.4

`

a-i-ks commented 3 years ago
(13004) uncaught exception: listen EADDRINUSE: address already in use :::3000

Ahh, one error is due to the fact that the port (3000) on which this adapter listens for status changes from Volumino is already in use. You can change the port to any other port in the settings of the adapter. I will probably have to make the default setting a little more random so that there are no overlaps. Normally, the subscription mode should therefore not function correctly. The adapter manually queries the playback status once at start-up. All further changes to the playback status only arrive if Volumio is able to send the status to the adapter via POST. Since port 3000 is already occupied, the adapter cannot open an http server on this port and thus cannot react to notifications from Volumino. This probably leaves only the pull mode, in which the playback status can only be requested manually. I'll have to check again why the buttons don't work. Maybe there is some random correlation with the subscription mode.

Kurze Erklärung in Deutsch: Ich habe eben nochmal das Log angesehen und glaube, das folgende ist bei dir passiert: Du versuchst den Adapter zu starten, in der Startmethode wird versucht den Server auf Port 3000 zu starten, das schlägt fehl, dann wird der Adapter wieder beendet und läuft gar nicht. Deswegen funktionieren auch die Buttons nicht. Es kommt dir (vielleicht) so vor, als hätte alles geklappt, weil der Status einmalig abgefragt werden konnte und die Playback Info einmal in die States übertragen wurde. Prüf mal, ob eine Portänderung die Lösung bringt. Aber zumindest weiß ich, dass ich den Start etwas stabiler machen muss und den Fehler eines bereits belegten Ports abfangen muss und dann einfach im Pull-Mode starten muss.

wberger42 commented 3 years ago

Soweit hätte ich denken sollen. Port 3000 ist Default Port von Grafana ;-) Hab jetzt auf etwas anderes geändert und der Fehler ist weg. Danke.

a-i-ks commented 3 years ago

Schön zu hören. Ich werde noch ein paar finale Fehlerkorrekturen vornehmen, wie z.B. den Adapter trotz fehlenden Subscription-Mode zu starten und den connection Indikator korrekt ausgeben und dann veröffentliche ich den Adapter über das ioBroker repository. Danke für das Testen und vor allem für die Kaffee-Einladung! (Sowas habe ich tatsächlich noch nie bekommen und ich habe mich sehr gefreut. 👍 )