thecowan / wallpanel-android

WallPanel is an Android application for Web Based Dashboards and Home Automation Platforms
https://wallpanel.app
Apache License 2.0
745 stars 104 forks source link

WallPanel does not stay open reliably #317

Open mag1024 opened 2 years ago

mag1024 commented 2 years ago

First and foremost: thanks, Mister, for writing such a useful app :)

I've been struggling to get WallPanel to stay open on a Fire Table HD 10 (OS version 9, SDK 28). This happens both at stock, and after some debloating with the Fire Toolbox), currently running 0.9.5.9 -- but I tried a bunch of other versions as well.

The symptoms that I've observed is that after some number of hours of running well, I find the tablet with on the home screen. Initially I thought it was an issue with staying in the foreground, not a crash, because the "Wall Panel running...." notification was present in that shade. I tied using the app pinning option, but it did not help.

Recently I got around to dumping the logs and found this, which would seem to imply that this is a crash after all:

pid: 22487, tid: 22487, name: r.iot.wallpanel  >>> com.thanksmister.iot.wallpanel <<<
09-13 14:04:03.796   631 24171 V CrashDescriptorUtil: signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr --------
09-13 14:04:03.796   631 24171 V CrashDescriptorUtil: Abort message: '[FATAL:crashpad_client_linux.cc(667)] Render process (22753)'s crash wasn't handled by all associated  webviews, triggering application crash.

This post on stack overflow seems to indicate that should be possible survive such events by installing a onRenderProcessGone handler. Seems worth trying?

Please let me know what additional information I can provide to facilitate debugging.

(Currently I'm working around the issue with the 'Autostart and StaY!' app set to respawn Wall Panel on crashes, but that's obviously not a very satisfying solution :)

MiBe17 commented 2 years ago

+1! I experience exactly the same issue on a Fire HD 10 (2019) debloated with the Fire Toolbox. It happens about two times a day and is really annoying. Until this is fixed, I will also try the workaround with 'Autostart and StaY!'. Thanks to @mag1024

thanksmister commented 2 years ago

You need to try with the latest pre-release version, it has fixed an issue with MQTT causing the app to crash (or the background service which keeps the app from closing). https://github.com/thanksmister/wallpanel-android/releases/tag/v0.9.6.0

MiBe17 commented 2 years ago

I will try this out! Thanks, Mister! 😀

mag1024 commented 2 years ago

Upgrading to 0.9.6.0 does not solve the problem for me. The app still crashes after a few hours.

MiBe17 commented 2 years ago

Same for me. However, when I disable MQTT completely, this issue does not occur anymore. So it seems to be definitively related to MQTT. Maybe @mag1024 you can also try it out and confirm this?

mag1024 commented 2 years ago

Disabling MQTT does not fix the problem for me -- the app still crashes after a while. The render process crashes in the log seem like a pretty strong lead -- @thanksmister, any thoughts on that?

thanksmister commented 2 years ago

Disabling MQTT does not fix the problem for me -- the app still crashes after a while. The render process crashes in the log seem like a pretty strong lead -- @thanksmister, any thoughts on that?

Seems like it’s crashing in the webpage rendering?

thanksmister commented 2 years ago

I have one MQTT crash for the new version with Android 10 device.

Fatal Exception: java.lang.RuntimeException Unable to start service info.mqtt.android.service.MqttService@c6ab670 with Intent { cmp=com.thanksmister.iot.wallpanel/info.mqtt.android.service.MqttService }: java.lang.RuntimeException: android.os.DeadSystemException

mag1024 commented 2 years ago

Seems like it’s crashing in the webpage rendering?

Yes, and there's supposed to be a way to handle issues with the rendering process with onRenderProcessGone without having them kill the app. Is that something Wall Panel should do?

Is the background service supposed to monitor / restart the app? If so, it doesn't seem to be working. When I see these crashes, the app is gone, but the service seem to continue to run -- at least the "WallPanel running..." notification is still present.

thanksmister commented 2 years ago

Maybe we can try to catch the WebView render error and handle it properly rather than crashing. You can set the app as the home app and it should also restart if crashed. But the proper approach is to handle the crash.

thanksmister commented 2 years ago

I think the MQTT message probably has a bad format causing crashes because it cannot parse the MQTT as json. You can leave MQTT on and just turn off your HA automations that’s are send data like weather or sun.

esmoyer commented 1 year ago

Glad I am not the only one struggling with this, anything ever get figured out? I have been trying to figure this out as well and was about to give up on having wall panels; but will try the 'Autostart and StaY!' app and see how that works!

mag1024 commented 1 year ago

@esmoyer, this repository is abandoned. Try TheTimeWalker/wallpanel-android. MQTT handling there has had some fixes.

esmoyer commented 1 year ago

Thanks @mag1024, I could have sworn I had that one bookmarked but obviously had this one instead. I'll head over that way!