hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.03k stars 377 forks source link

Web interface not supporting color calibration via Kodi #771

Closed Nears closed 3 years ago

Nears commented 4 years ago

Bug report

It is not possible to run the color calibration via web-interface. Even if Kodi is running and the right IP address is set the calibration does not find Kodi.

Steps to reproduce

Install Kodi (Version 18.6.) and Hyperion.NG (Version 2.0.0.Alpha 4) (From https://github.com/hyperion-project/hyperion.ng/releases/download/2.0.0-alpha.4/Hyperion-2.0.0-alpha.4-Linux-armv7hf-rpi.deb)

What is expected?

Calibration mode is started and colors can ge calibrated

What is actually happening?

Calibration does not start and times out after some time. User is requested to start manual calibration, but even during this the Color-Picker GUI shows up but the LEDs are not changing theire color. Therefor no calibration is possible.

System

Hyperion Server:

Hyperion Server OS:

pattyland commented 4 years ago

Did you also activate the web remote in Kodi? I use Alpha 5 and MrMC and the calibration via web interface worked fine

FransTwisk commented 4 years ago

I'm experiencing the same. Pre-filled IP is correct but I can't click "Continue" because it's disabled. Hyperion Alpha 5 & Kodi 18.6 running on the same Raspberry Pi 4 running Raspbian Buster. It also didn't work on my LibreELEC install. This first call actually works, with the prefilled local IP, but returns:

jsonCallback({"error":{"code":-32099,"message":"Bad client permission."},"id":"1","jsonrpc":"2.0"});

This is what shows up in the Kodi debug log:

2020-05-02 11:18:20.089 T:2052059344   DEBUG: CWebServer[8080]: request received for /jsonrpc?callback=jsonCallback&request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title": "Colour calibration wizard", "message": "Test success - time to proceed!", "image":"info", "displaytime":5000 },"id":"1"}&_=1588411096647

Allow remote control from applications on this system & Allow remote control from applications on other systems are turned on. Username and password are blank. Web remote works fine.

Nears commented 4 years ago

Did you also activate the web remote in Kodi? I use Alpha 5 and MrMC and the calibration via web interface worked fine

Yes its active in Kodi and working, I also use it for remote controll access.

LichtiMC commented 4 years ago

In current release (2.0.0-alpha.7) I have the same problem. How would I calibrate the colors now?

Thanks...

m-seker commented 4 years ago

I'm experiencing the same. Pre-filled IP is correct but I can't click "Continue" because it's disabled. Hyperion Alpha 5 & Kodi 18.6 running on the same Raspberry Pi 4 running Raspbian Buster. It also didn't work on my LibreELEC install. This first call actually works, with the prefilled local IP, but returns:

jsonCallback({"error":{"code":-32099,"message":"Bad client permission."},"id":"1","jsonrpc":"2.0"});

This is what shows up in the Kodi debug log:

2020-05-02 11:18:20.089 T:2052059344   DEBUG: CWebServer[8080]: request received for /jsonrpc?callback=jsonCallback&request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title": "Colour calibration wizard", "message": "Test success - time to proceed!", "image":"info", "displaytime":5000 },"id":"1"}&_=1588411096647

Allow remote control from applications on this system & Allow remote control from applications on other systems are turned on. Username and password are blank. Web remote works fine.

1- Did you figure out a way to overcome this issue ? Or did it just disappear with later releases(alpha6 or alpha7) ?

2- Are Raspbian and Kodi working fine on Pi4 ? I tried once and it was painfully slow, then I didn't check any further.

FransTwisk commented 4 years ago

1- Did you figure out a way to overcome this issue ? Or did it just disappear with later releases(alpha6 or alpha7) ?

2- Are Raspbian and Kodi working fine on Pi4 ? I tried once and it was painfully slow, then I didn't check any further.

I did not. I did however switch to an Nvidia Shield, since I really missed not being able to play 4k & HDR content. Kodi works fine on a Pi 4, but no HDR support and no Hyperion support for 4k. I do however have the same issue on Nvidia Shield where Hyperion also can't connect to calibrate through Kodi. But I can now at least play 4k HDR content with ambilight!

sPOiDar commented 3 years ago

Since Kodi Leia non-read-only JSONRPC commands must be sent via POST rather than GET.

EDIT: Oh I see the issue, the existing code attempts to use JSONP, which cannot be POSTed cross-origin, so it's converted to a GET. And since Kodi does not set any access-control headers, regular JSON POST won't work in recent browsers either. So, the approach in #1044 of using the websocket seems like a viable fix, tested and appears functional here.

Lord-Grey commented 3 years ago

@sPOiDar Correct. Using Kodi's REST API via POST is causing all the CORS problems and does not work by using JS in the browser, In addition, now "Content-type" = "application/json" is mandatory, which makes the call a non-simple one and the CORS rules apply.

An alternative solution would have been, implementing KODI's REST API in the backend, which I avoided for the time being...

... and appears functional here.

Good to hear that it is working at your end.

gismo2004 commented 3 years ago

Websokets will work and i made already something similar some time ago... https://github.com/gismo2004/hyperion.ng/commit/da2e0f387ac9c7e8c4e4a1bb65ad0ee4f393a76e

Lord-Grey commented 3 years ago

@gismo2004 Maybe next time you share improvements via an PR that everybody could benefit. :) Would have saved me some time, too....

gismo2004 commented 3 years ago

Well, I have done that already, but obviously the deal in following PR was not fulfilled šŸ˜‰ https://github.com/hyperion-project/hyperion.ng/pull/492

Lord-Grey commented 3 years ago

@gismo2004 šŸ˜€

rradar commented 3 years ago

Pre-filled IP is correct but I can't click "Continue" because it's disabled

Exactly the problem I have now in the year 2021.

Tried with different browsers but no luck...

Paulchen-Panther commented 3 years ago

Pre-filled IP is correct but I can't click "Continue" because it's disabled

Exactly the problem I have now in the year 2021.

  • 2.0.0-alpha.8
  • CoreElec
  • Kodi 18.9
  • Platform: | Amlogic
  • Controller type: | wled

Tried with different browsers but no luck...

2.0.0-alpha.8 is not up to date and CoreElec is not supported. Sorry

rradar commented 3 years ago

2.0.0-alpha.8 is not up to date

You are right! And most importantly: The fix for this bug (https://github.com/hyperion-project/hyperion.ng/pull/1044) was merged in the latest release 2.0.0-alpha.9

CoreElec is not supported.

But works perfectly fine :yum: