openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
589 stars 317 forks source link

Main UI shows blank page in remote mode #3601

Open Flowdalic opened 4 months ago

Flowdalic commented 4 months ago

I can't get OpenHAB Android 3.9.0 nor 3.10.0 to show the Main UI in remote mode (using OpenHAB 4.1.1).

While it shows the Main UI in local mode (note the Wifi symbol in the upper right corner):

screenshot-with The same thing looks empty once I turn of Wifi and go into the remote mode:

screenshot-without

As far as I can tell, OpenHAB Android is able to retrieve and use the sitemap. It's "just" the Main UI that does not show.

The Android log of the habdroid app also does not look suspicious (at least, to me):

2024-02-17 18:18:04.688  6743-6743  PageConnec...erFragment org.openhab.habdroid                 D  updateActiveConnections: URL list [https://myopenhab.org/rest/sitemaps/uicomponents_Sitemap/uicomponents_Sitemap], connection org.openhab.habdroid.core.connection.DefaultConnection@628eb6
2024-02-17 18:18:04.694  6743-6743  ServerConfiguration     org.openhab.habdroid                 D  load: ServerConfiguration(id=1, name=openHAB, localPath=ServerPath(url=https://192.168.188.43:8443/, userName=<redacted>, password=<redacted>), remotePath=ServerPath(url=https://myopenhab.org/, userName=<redacted>, password=<redacted>), sslClientCert=null, defaultSitemap=DefaultSitemap(name=uicomponents_Sitemap, label=Sitemap), wifiSsids=[MyWifi], restrictToWifiSsids=true, frontailUrl=null)
2024-02-17 18:18:04.710  6743-6743  WidgetListFragment      org.openhab.habdroid                 D  onPause() https://myopenhab.org/rest/sitemaps/uicomponents_Sitemap/uicomponents_Sitemap
2024-02-17 18:18:04.767  1996-5678  ConnectivityService     system_server                        D  requestNetwork for uid/pid:10485/6743 activeRequest: null callbackRequest: 11579 [NetworkRequest [ REQUEST id=11580, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10485 RequestorUid: 10485 RequestorPkg: org.openhab.habdroid UnderlyingNetworks: Null] ]] callback flags: 0 order: 2147483647
2024-02-17 18:18:04.773  1996-2794  WifiNetworkFactory      system_server                        D  got request NetworkRequest [ REQUEST id=11580, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10485 RequestorUid: 10485 RequestorPkg: org.openhab.habdroid UnderlyingNetworks: Null] ]
2024-02-17 18:18:04.774  1996-2794  UntrustedW...orkFactory system_server                        D  got request NetworkRequest [ REQUEST id=11580, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10485 RequestorUid: 10485 RequestorPkg: org.openhab.habdroid UnderlyingNetworks: Null] ]
2024-02-17 18:18:04.774  1996-2794  OemPaidWif...orkFactory system_server                        D  got request NetworkRequest [ REQUEST id=11580, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10485 RequestorUid: 10485 RequestorPkg: org.openhab.habdroid UnderlyingNetworks: Null] ]
2024-02-17 18:18:04.774  1996-2794  MultiInter...orkFactory system_server                        D  got request NetworkRequest [ REQUEST id=11580, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10485 RequestorUid: 10485 RequestorPkg: org.openhab.habdroid UnderlyingNetworks: Null] ]
2024-02-17 18:18:04.802  6743-6743  AbstractWebViewFragment org.openhab.habdroid                 D  Load default website
2024-02-17 18:18:04.862  1996-2278  ActivityManager         system_server                        I  Start proc 18445:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:5/u0i414 for  {org.openhab.habdroid/org.chromium.content.app.SandboxedProcessService0:5}
2024-02-17 18:18:04.873  6743-6743  MainActivity            org.openhab.habdroid                 D  onCreateOptionsMenu()
2024-02-17 18:18:04.874  6743-6743  MainActivity            org.openhab.habdroid                 D  onPrepareOptionsMenu()
2024-02-17 18:18:04.913  6743-6743  AbstractWebViewFragment org.openhab.habdroid                 D  progressCallback: progress = 10
2024-02-17 18:18:05.107  1996-2052  CoreBackPreview         system_server                        D  Window{f002b3b u0 org.openhab.habdroid/org.openhab.habdroid.ui.MainActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@24c606d, mPriority=0}
2024-02-17 18:18:05.242  6743-6743  AbstractWebViewFragment org.openhab.habdroid                 D  progressCallback: progress = 70
2024-02-17 18:18:05.262  6743-6743  AbstractWebViewFragment org.openhab.habdroid                 D  progressCallback: progress = 100
2024-02-17 18:18:05.262  6743-6743  AbstractWebViewFragment org.openhab.habdroid                 D  progressCallback: progress = 100

I am able to remotely access the Main UI via myopenhab.org, fwiw.

Is this a known issue? How can I fix it?

Link to related OpenHAB community forum discussion: https://community.openhab.org/t/openhab-android-app-main-ui-shows-blank-page-in-remote-mode/153982

mueller-ma commented 4 months ago

You you open home.myopenhab.org in a browser on your phone over mobile data?

Flowdalic commented 4 months ago

Yes, home.myopenhab.org works on the same device.

Flowdalic commented 4 months ago

Correction, I just had the issue on the Smartphone. Directly entering home.myopenhab.org showed a blank page. After I signed in on myopenhab.org and clicked "Click here to access your openHAB's dashboard", I was able to visit home.myopenhab.org. Closing the tab, and entering home.myopenhab.org also showed the expected page afterwards.

mueller-ma commented 4 months ago

Can you try https://github.com/openhab/openhab-android/releases/tag/3.10.2-beta and capture the log via adb while opening MainUI via mobile data?

Flowdalic commented 4 months ago

I've installed 3.10.2-beta and are unable to reproduce this behavior. However, the OpenHAB App from Play Store still exhibits the faulty behavior.

I noticed that when I enter home.myopenhab.org in a browser, I usually a login page presented, but sometimes I remember seeing a HTTP basic auth dialog. I think I remember dismissing the basic auth dialog leads to an empty page presented.

That made me wonder that it may be possible that the webview of the OpenHAB Android App may also somehow entered this stale state.

So I reset the Android App by deleting all of its data (not just the cache) and configured the App again. Since then, I can not longer trigger the faulty behavior.

Not sure if this should be closed though, as the underlying issue is probably not fixed.

mueller-ma commented 4 months ago

Maybe clearing the Webview cache would have fixed the issue for you: https://github.com/openhab/openhab-android/pull/3605

I noticed that when I enter home.myopenhab.org in a browser, I usually a login page presented, but sometimes I remember seeing a HTTP basic auth dialog.

The app always sends the credentials, so this shouldn't be an issue.

Flowdalic commented 3 months ago

FWIW, I just ran into this again after updating openhab from 4.1.1 to 4.1.2. clearing the cache in the app resolved this. However it would be more user friendly if this manual step wasn't required. Actually, I am not even sure what the root cause is.

mueller-ma commented 2 months ago

Did you have a similar issue in a desktop browser when updating openHAB server?

benediktkuntz commented 2 months ago

I observed quite the same issue, the app did not display the Main UI (app version 3.12.0; Main UI set as start page). Clearing cache inside the app did not help, but deleting data and cache of the app from Android settings and setting up the server connection again made it work.