GameDevHobby / Domoticz-LGTV-WebOS-Plugin

LG TV WebOS 3 Plugin for Domoticz
14 stars 13 forks source link

plugin corrupts domoticz system #25

Open mapsindustrial opened 3 years ago

mapsindustrial commented 3 years ago

I have installed this amazing plugin on a Raspberry pi3 + together with domoticz and nothing else, after a day or two of correct operation my domoticz system falls and stops working, allí domoticz stop and and it is impossible to recover it.

Help ! Any solution?

SkeletonRocky commented 3 years ago

Hey, delete the plugin from the folder, open the domoticz db with sqlite3 and remove the device from the DB. After this you will be able to start domoticz and re-add the plugin with the TV. I have this situation as well, when the IP address of the TV is changed.

mapsindustrial commented 3 years ago

I have a fixed IP address on all my devices, including the TV, that can't be the problem.

mapsindustrial commented 3 years ago

could you help me with another possible solution?

SkeletonRocky commented 3 years ago

I have experienced this issue when I used multiple copies from this plugin under domoticz, and modified one of them. Maybe the Rpi restarted, and it caused some data loss on domoticz side. Very weak idea, but try to configure it up, save the config, and restart domoticz, then the rpi. Also try to turn on debug node on domoticz side, hopefully it will write out something. Also if you start the domoticz on tty instead of daemon, you will see where is the problem.

Hope this help.

mapsindustrial commented 3 years ago

I don't really understand your solution. Excuse me.

pczolee commented 2 years ago

Well, I have the same problem. For me it causes that my tv have old webos which not support wol. So that means my tv ip not responding when is is standby. It looks that the plugin try to pool or do something with the tv so that's why the domoticz freezing. If I turn the tv on with the remote after that the domoticz start to work again.

So I think the solution would be if we can choose the webos version, and if there is no wol, the plugin can sleep while the tv is standby...

odelma commented 2 years ago

Well, I have the same problem. For me it causes that my tv have old webos which not support wol. So that means my tv ip not responding when is is standby. It looks that the plugin try to pool or do something with the tv so that's why the domoticz freezing. If I turn the tv on with the remote after that the domoticz start to work again.

So I think the solution would be if we can choose the webos version, and if there is no wol, the plugin can sleep while the tv is standby...

This might be something different you are experiencing. I have observed the corrupt db issue a few times and cannot pinpoint it to anything specific. The TV is at our summer cottage and it happens only when we are there, usually once coming after some period of time - so it is somehow maybe related to the power status of the TV. TV is LG OLED A1 (2021) so it should have latest WebOS.

I tried to recover from the corrupt db with editing the db file and disabling the hardware for the TV but it did not work. Going with the backup from day before works though. At home I have LG OLED B7 from few years back (WebOS 3?) and there I've never had this issue.

Unlike @mapsindustrial I am not running multiple instances, only one instance per system.

odelma commented 2 years ago

Tried to look into this a bit and this seems to fit my situation where the db corrupt/crash happens after a period of not using the TV:

https://github.com/bramvreugd/Domoticz-LGTV-WebOS-Plugin/commit/18dc37e54a6509d16a331a25a9c0330c6c04552e Update to prevent crash of Domoticz when TV was off. When the TV is off a very long status (JSON) message was displayed which would crash domoticz if device was displayed on the web front end. In case the TV is off and a timeout error is returned the status is set to "off"

What I can see in the status log from time to time is: TimeoutError() occurred, is the TV off? ({'returnValue': False, 'errorCode': -1000, 'errorText': 'com.webos.service.utp/bind returns invalid result(response error)'} )

But as such this does not cause the issue - at least not in all cases. Maybe it is like it says in the commit that one would need to be loading the web front end and when this is shown as status, then Domoticz will crash. And as long as it remains the status, it will crash again when you load the web frontend. Although, I'm pretty sure it crashes in my case even sooner than I reload the UI...

edit: in my own setup I have now added the time out handler to plugin.py as outlined here: bramvreugd@18dc37e Let's see if crashes / db corruptions end...

odelma commented 2 years ago

I was not able to get this work. the handler by @bramvreugd caused the Tv status not to update at all. Any other suggestions, anyone?

sixzeroone commented 1 year ago

Hi all, I've the same issue after a day or two the plugin is installed and add just one tv. the only things I had to do for restarting domoticz was paste in the DZ folder the db backup of some days before; afterwards domoticz started but with the db corrupted again, so I did restore db from the GUI loading the same db file pasted before. thus everything back to work. I hope this can help some one in the restoring procedure.

obliviously, before to upload the backup, I deleted the relative webOs plugin folder