Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ioBroker App no longer opens Lovelace #486

Open
andiweli opened this issue Jan 2, 2024 · 20 comments
Open

ioBroker App no longer opens Lovelace #486

andiweli opened this issue Jan 2, 2024 · 20 comments

Comments

@andiweli
Copy link

andiweli commented Jan 2, 2024

Describe the bug

Installed Lovelace 4.1.1 today from 3.0.1 and now remote access via Smartphone app no longer is working.

iOS with latest ioBroker app from last week.

@Garfonso
Copy link
Collaborator

@GermanBluefox do we need to update something somewhere, when something in lovelace changes?
I still am not sure about how that works.

I got the pro-cloud working on my desktop once or so.. but it seems to be very unreliable for me for some time already... often the frontend get's stuck at "Loading Data" and retries over and over again without success. If it works, it usually works the first time... I tried to debug that, but did find a way to get information... so not sure where the issue could be.

@andiweli
Copy link
Author

andiweli commented Feb 23, 2024

With the latest App updates, still no access from outside the WiFi is possible with Pro Account.

Tried an instance of iQontrol to cross-check if some config is wrong at my side - but iQontrol works.

Before the latest updates I also had the "loading" animation most of the time... and some times it worked. But really not very reliable as you say 🤔

@GermanBluefox
Copy link
Contributor

Is it only app access to lovelace or the web access via iobroker.pro too?
I can access my lovelace via https://iobroker.pro/lovelace/ und über app.
image
image

I cannot reproduce the problem

@andiweli
Copy link
Author

Web Access via iobroker.pro never really worked for me.
App Access seems broken since a few updates.
Before I had to reload several times to get my Lovelace view loaded in the App.

iQontrol works. Via iobroker.pro and App.
The Lovelace config wasn't changed for months.

@andiweli
Copy link
Author

Oh and of course Admin also works via iobroker.pro 😳

@GermanBluefox
Copy link
Contributor

GermanBluefox commented Feb 28, 2024

Web Access via iobroker.pro never really worked for me.

so I suggest, that we solve first this problem as we can debug in Browser.

App Access seems broken since a few updates.

It was nothing in the app concerning lovelace. But I restarted cloud.pro a couple days before and updated some vis packages

@andiweli
Copy link
Author

andiweli commented Feb 28, 2024

All I get in Web (and App) is this... loads for ages. From what I read the loading animation is a sign that a connection is established but the Lovelace adapter doesn't respond ... ?!

image

@GermanBluefox
Copy link
Contributor

GermanBluefox commented Feb 28, 2024

All I get in Web (and App) is this... loads for ages. From what I read the loading animation is a sign that a connection is established but the Lovelace adapter doesn't respond ... ?!

What will be shown in browser console? And what in messages of socket communication?
image

image

@andiweli
Copy link
Author

andiweli commented Feb 28, 2024

@GermanBluefox

In network websockets > messages I get this when trying to connect to Lovelace via iobroker.pro...

{type: "auth", access_token: "no_token"} access_token : "no_token" type : "auth"

In Console I get this...

Bildschirmfoto 2024-02-28 um 18 58 42

@GermanBluefox
Copy link
Contributor

{type: "auth", access_token: "no_token"} access_token : "no_token" type : "auth"

It is too few....
That what I have:
image

@andiweli
Copy link
Author

andiweli commented Feb 29, 2024

@GermanBluefox I'll take a look later when I am at home.

Funny thing... I just started the ioBroker Visu app out of couriosity on my iPhone and Lovelace loaded instantly!
I closed it and tried again and it didn't even showed the loading animation now...
Tried several times now but without success anymore :(

@andiweli
Copy link
Author

@GermanBluefox as requested a new try... but that's all console shows me as in the screenshots.
iobroker.pro also doesn't load as mentioned... perhaps that's the reason there are no more messages shown.

Bildschirmfoto 2024-02-29 um 18 05 20 Bildschirmfoto 2024-02-29 um 18 05 07

@andiweli
Copy link
Author

andiweli commented Feb 29, 2024

@GermanBluefox ok after around 20-25 reload tries I got this and my Lovelace instance was shown via iobroker.pro
Reloading it again takes another 20+ reloads or more to show it again.

Bildschirmfoto 2024-02-29 um 18 17 25 Bildschirmfoto 2024-02-29 um 18 21 02

@andiweli
Copy link
Author

andiweli commented Mar 8, 2024

Konntet ihr damit was anfangen?
Mehr Output kommt über die Konsole in dem Fall leider nicht daher 🤷🏻‍♂️

@andiweli
Copy link
Author

Gibt's evtl Infos ob eine Portweiterleitung notwendig ist?

Hab den Raspberry in einem Mesh das wiederum an einem Glasfasermodem hängt.

Zugriff intern klappt.
Zugriff von extern seit Monaten nicht.

Danke.

@Garfonso
Copy link
Collaborator

Also eine Portweiterleitung ist nicht notwendig. Dafür ist der cloud adapter ja genau da.

@GermanBluefox
Ich habe nochmal gesucht mit allem, was ich mir angucken kann.
Dabei ist mir zum einen aufgefallen, dass lovelace ganz schön viele Dateien anfordert (und irgendwie auch js.map Dateien, die alle zu 404 führen) -> kann das zu einem "soft ban" oder so führen? Also dass der cloud Server davon ausgeht, dass es zu viele Requests sind?

Irgendwas scheint jedenfalls dazu zu führen, dass die websocket Verbindung nicht funktioniert. Im Browser kann ich sehen, dass er versucht sich zu authentifiziere:
{"type":"auth","access_token":"no_token"}
darauf kommt dann keine Antwort und nach einer Minute schließt der Browser den socket und versucht es nochmal.

Im Adapter scheint eine leere (??) message anzukommen, weshalb der aussteigt, jedenfalls sehe ich im system log diese Ausgaben:

Nov 12 12:25:10 Server node[11837]: Cannot parse message:
Nov 12 12:25:12 Server node[11837]: Cannot parse message:
Nov 12 12:43:35 Server node[11837]: Cannot parse message:
Nov 12 12:44:27 Server node[11837]: Cannot parse message:
Nov 12 12:44:36 Server node[11837]: Cannot parse message:

Die kommt ziemlich sicher von hier.

Das erklärt zumindest, warum der Adapter nicht antwortet, er steigt da mit einem return aus der "onMessage" Funktion aus.

Aaalso hab ich mal mehr debug hinzugefügt.. und.. naja...

Could not parse message: with type object, got error SyntaxError: Unexpected end of JSON input 
with stack SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at WebSocket.<anonymous> (/opt/iobroker/node_modules/iobroker.lovelace/lib/server.js:2306:32) at WebSocket.emit (node:events:519:28) at Receiver.receiverOnMessage (/opt/iobroker/node_modules/ws/lib/websocket.js:1220:20) at Receiver.emit (node:events:519:28) at Receiver.dataMessage (/opt/iobroker/node_modules/ws/lib/receiver.js:569:14) at Receiver.getData (/opt/iobroker/node_modules/ws/lib/receiver.js:496:10) at Receiver.startLoop (/opt/iobroker/node_modules/ws/lib/receiver.js:167:16) at Receiver._write (/opt/iobroker/node_modules/ws/lib/receiver.js:94:10) at writeOrBuffer (node:internal/streams/writable:570:12). 

Hm.. object??
Also hab ich mir die Message mal stringifien lassen:
Stringified message: { "type": "Buffer", "data": [] }

Bis dahin bin ich gerade mit meinen Recherchen gekommen und weiß nicht so recht weiter... das Objekt scheint zumindest nicht eine Instanz von Buffer zu sein, auch wenn die type-Propertie das nahelegt. Kann es sein, dass da irgendwo unterwegs (subtil, ggf. durch neueres Node?) ein String zu einem Buffer wird und der dann unvollständig weiter gereicht wird?

@Garfonso
Copy link
Collaborator

Hm.. hab den Browser einfach die ganze Nacht offen gelassen und morgens war Lovelace dann verbunden... seufz Also es ist irgendwo was random dabei, dass es funktioniert / nicht funktioniert... aber nach F5 drücken geht es gerade zumindest wieder zuverlässig nicht. Immerhin. ;-)

@Garfonso
Copy link
Collaborator

Ok, hab jetzt auch mal im cloud-Adapter debug logging eingebaut und die Nachricht {"type":"auth","access_token":"no_token"} die Lovelace laut Man-In-The-Middle Proxy im Browser über die websocket Verbindung schon rausgeschickt hat, kommt in den Fällen, wo eine Verbindung nicht zustande kommt, einfach nicht bei lovelace an, sondern es kommt nur

13 Nov 2024 09:34:39.718 cloud.0: [Lovelace|17bdffef-0ca9-4aec-a1b1-b1f318219798] connected
13 Nov 2024 09:34:39.718 cloud.0: [Lovelace|17bdffef-0ca9-4aec-a1b1-b1f318219798] store message: undefined
13 Nov 2024 09:34:39.718 cloud.0: [Lovelace|17bdffef-0ca9-4aec-a1b1-b1f318219798] establish connection
13 Nov 2024 09:34:39.718 cloud.0: Incomming data: ["{\"type\":\"connection\"}"]

(die Ausgaben sind "neueste oben", die unterste Zeile ist eine debug Ausgabe, die ich reingehackt hab, die einfach das komplette args-Array ausgibt, wo das klar ist, dass die Nachricht an lovelace gehen soll. (also hier).
Danach passiert eine Minute lang nichts, bis lovelace im Browser aufgibt und einen neuen Versuch startet.

Kann es da irgendwo eine race-condition geben, bei der die erste Websocket Nachricht von lovelace verloren geht?

@2K-Darkness
Copy link

Hi!

Ich habe das gleiche Problem.
Ärgerlich wenn man alles schön in Lovelace verbaut hat, die Subscription für Pro abschließt und es aus der Ferne dann doch nicht geht...

Wie ist denn der Stauts? Kann man vielleicht unterstützen?

Grüße

@SKB-CGN
Copy link

SKB-CGN commented Jan 15, 2025

Hallo Zusammen,
ich habe das Problem nicht mit lovelace sondern mit meinem Energiefluss-erweitert Adapter.

Über Firefox kommt er die meiste Zeit problemlos rein - mit Chrome bleibt es bei der Ladeanimation hängen.

Die Socket Verbindung wird aufgebaut und der cloud Adapter meldet brav, das ein user sich verbunden hat. Mehr kommt leider nicht.

Cloud-adapter:
cloud.0 | 2025-01-15 12:29:46.994 | info | User accessed from cloud: MSGDMEkPq3brw1XZBYja

Browser-Konsole:

[Config] Using Instance: energiefluss-erweitert.0 functions.min.js?v=0.6.2:1
[Language] Detected System-Language: de-DE functions.min.js?v=0.6.2:1
[Socket] connected at 15.1.2025, 12:29:47 functions.min.js?v=0.6.2:1
[Language] Trying to get language from system!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants