WLED icon indicating copy to clipboard operation
WLED copied to clipboard

JSON API returns error for "/json/live"

Open Cerothen opened this issue 1 year ago • 6 comments

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

  • [X] I agree to follow this project's Code of Conduct

Cerothen avatar Oct 18 '24 02:10 Cerothen

JSON live has been disabled by default in b6.

blazoncek avatar Oct 18 '24 06:10 blazoncek

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

Cerothen avatar Oct 18 '24 15:10 Cerothen

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

blazoncek avatar Oct 18 '24 15:10 blazoncek

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

netmindz avatar Oct 19 '24 09:10 netmindz

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

blazoncek avatar Oct 20 '24 08:10 blazoncek

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

Cerothen avatar Oct 20 '24 17:10 Cerothen

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

blazoncek avatar Oct 20 '24 20:10 blazoncek

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

Perhaps there is a bug?

Cerothen avatar Oct 26 '24 20:10 Cerothen

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

blazoncek avatar Oct 26 '24 20:10 blazoncek

Live view is still broken in the release build of 0.15. Web UI Peek feature works fine. Opening a new tab/window and visiting /liveview does not work. Not sure how I get /liveview to use websocket instead of /json/live

Nevermind, I figured it out. Adding '?ws' to the end works, as long as websockets are working in your browser/network.

Example: http://1.2.3.4/liveview?ws

death2all110 avatar Dec 26 '24 05:12 death2all110

Please read statements above. It is not broken, it was removed. If you want to have it for your ESP, you need to compile custom binary.

blazoncek avatar Dec 26 '24 06:12 blazoncek

How can I adjust the display in the browser live view so that the 16x16 matrix LED panel is shown correctly? In the Peek preview, it is displayed correctly.

PEEK Image LIVEVIEW Image

amnesia106 avatar Feb 25 '25 10:02 amnesia106

If the build only has websocket support then we shouldn't really need the user to add the ?ws modifier

Forgot my ignorance but what does the liveview give that peek doesn't? I.e why use liveview not peek?

netmindz avatar Feb 26 '25 08:02 netmindz

liveview is a frame embedded in UI. it can be called/invoked independently, though. just a disclaimer: it was not developed to be invoked independent of UI.

blazoncek avatar Feb 26 '25 09:02 blazoncek

Wenn der Build nur Websocket-Unterstützung hat, dann sollten wir den Benutzer nicht wirklich brauchen, um die ? Ws-Modifikator

Ich habe meine Unwissenheit vergessen, aber was gibt die Live-Ansicht, die ein Blick nicht gibt? D.h. warum verwenden Sie Liveview und nicht Peek?

Unfortunately, I cannot integrate the Peek view into ioBroker / Home Assistant. This would only be possible with Liveview.

amnesia106 avatar Feb 26 '25 09:02 amnesia106

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for using WLED! ✨

github-actions[bot] avatar Jun 26 '25 12:06 github-actions[bot]