Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
15.04k stars 3.25k forks source link

JSON API returns error for "/json/live" #4205

Open Cerothen opened 1 month ago

Cerothen commented 1 month ago

What happened?

When attempting to use the http://host/liveview page nothing was loading, upon closer inspection the api located at http://host/json/live was returning the following:

{"error": 4}

The "Peek" feature in the regular UI works as expected however it is communicating using websocket messages and not with the same JSON api resource

To Reproduce Bug

Navigate to http://host/liveview when using version 0.15.0-b6 "Kosen"

image

Expected Behavior

The assumption is that the http://host/json/live api resource would return a non-error

Install Method

Binary from WLED.me

What version of WLED?

WLED 0.15.0-b6 (build 2410140)

Which microcontroller/board are you seeing the problem on?

ESP8266

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

blazoncek commented 1 month ago

JSON live has been disabled by default in b6.

Cerothen commented 1 month ago

Is the intent to have the live view page be removed or switch to use the websocket?

blazoncek commented 1 month ago

If you want to use it, custom compile. Otherwise switch to websockects as it is more efficient.

netmindz commented 1 month ago

Could we have a check during the build that catches these incompatible set of build options?

blazoncek commented 1 month ago

If the JSON live is needed (please get users to upvote this issue) then it can be enabled in release builds. It was omitted in an attempt to reduce binary size to fit other more important features in the future. Actual commit: 0bbd6b7c4b677249b584f90abbacde6f44f0ea85

Cerothen commented 1 month ago

I'm not directly aware of what's needed to address the websocket however the liveview page depends on the JSON/live API. I'm just wondering if the liveview page will be rewritten to use websockets or if it is going to be removed

blazoncek commented 1 month ago

Web UI (including /liveview) uses websockets. Nothing special needed.

Cerothen commented 3 weeks ago

the live view page currently does try to access the json/live api. image

Perhaps there is a bug?

blazoncek commented 3 weeks ago

No. You have to use websockets in the parent window. UI does that.