joba-1 / Tasmoticz

Domoticz MQTT autodiscovery plugin for Tasmota devices
MIT License
24 stars 18 forks source link

Domoticz beta (build 13251) randomly crashes on switches tab #22

Open jenshenk opened 3 years ago

jenshenk commented 3 years ago

Finally wanted to get away from dummy switches, checked out emontnemery's plugin but liked this one better. However, after being happy to instantly see all my tasmota devices it seems the very feature I liked about it (the simplicity how switches without any setoption changes etc are just being added) seems to lead to problems. At least with the latest beta version of domoticz, cannot say anything about earlier versions nor whether it also happens with the stable version. I'm running domoticz on a rpi4 with debian buster.

The issue is reproducible and happened multiple times like this:I might have just restarted domoticz a couple of minutes ago, everything works fine, yet at some point I click on the switches tab, first get an empty page (no switches) afterwards the domoticz webserver and domoticz in general crashes. I'm just shooting in the dark here, but it seems something about the autoadding of switches might be the issue - so could the solution be be adding an option toggle "do not auto-enable devices" for the plugin? Would love to keep using this plugin however to keep my homeautomation dependable I had to uninstall it again.

Let me know if I can add necessary info that might help.

jenshenk commented 3 years ago

Additional Info: I tried to catch the log entry in domoticz until it crashed and got lucky, this is the point when the switches tab (and all other tabs) get empty, interestingly this time domoticz did not fully crash (I named the Autodiscovery plugin Tasmota Devices)

2021-05-08 07:21:46.282 Error: Domoticz(pid:4604, tid:4644('Tasmota Devices')) received fatal signal 6 (Aborted) 2021-05-08 07:21:46.282 Error: siginfo address=0x11fc, address=(nil)

gizmocuz commented 3 years ago

The latest Domoticz versions is using the SQLite externally instead of linking it statically Is it possible you could try building Domoticz yourself (see https://www.domoticz.com/wiki/Build_Domoticz_from_source), but at the cmake step issue

cmake -DCMAKE_BUILD_TYPE=Release -DUSE_BUILTIN_SQLITE=YES CMakeLists.txt

If that is working, just to be sure, try again with

cmake -DCMAKE_BUILD_TYPE=Release -DUSE_BUILTIN_SQLITE=NO CMakeLists.txt

after compilation just copy the new domoticz executable to your domoticz install folder (you have to stop domoticz first of course)

joba-1 commented 3 years ago

regarding the request for not enabling new devices: I had thought about that feature and dismissed it for being against the philosophy of the plugin. But if the stability issue persists, I‘ll reconsider. And if plugins need to change for working with new domoticz versions I‘m all ears for hints from the expert :)

jenshenk commented 3 years ago

The latest Domoticz versions is using the SQLite externally instead of linking it statically Is it possible you could try building Domoticz yourself (see https://www.domoticz.com/wiki/Build_Domoticz_from_source), but at the cmake step issue

cmake -DCMAKE_BUILD_TYPE=Release -DUSE_BUILTIN_SQLITE=YES CMakeLists.txt

If that is working, just to be sure, try again with

cmake -DCMAKE_BUILD_TYPE=Release -DUSE_BUILTIN_SQLITE=NO CMakeLists.txt

after compilation just copy the new domoticz executable to your domoticz install folder (you have to stop domoticz first of course)

Wow thanks so much for this to the point tip, sounds much more goal oriented than the fiddling around I tried :) gonna try asap!

jenshenk commented 3 years ago

regarding the request for not enabling new devices: I had thought about that feature and dismissed it for being against the philosophy of the plugin. But if the stability issue persists, I‘ll reconsider. And if plugins need to change for working with new domoticz versions I‘m all ears for hints from the expert :)

Thanks for considering! I can't yet tell whether it would really make a difference, based on my gut feeling I'd just assume that without the constant scanning + autoadding the plugin would put a bit less strain in the system, hopefully leading to more stability

joba-1 commented 3 years ago

@jenshenk thats something different: I auto-activate devices so that they are visible on the relevant domoticz pages. I could leave them „hidden“ on the devices page where the user would have to enable them manually. That wont save cpu.

If you want to avoid scanning, you could deactivate the plugin while you dont expect new devices to appear. That is a normal domoticz function on the hardware page.

jenshenk commented 3 years ago

@jenshenk thats something different: I auto-activate devices so that they are visible on the relevant domoticz pages. I could leave them „hidden“ on the devices page where the user would have to enable them manually. If you want to avoid scanning, you could deactivate the plugin while you dont expect new devices to appear

Ohhh thanks for this! I never thought about that you can just disable it and the devices it created before would still be working, thought this would disable them, too. Maybe this solves my problem already!

I'm already compiling a custom domoticz in the background following up on @gizmocuz's tip... but if this already works I won't need to recompile with every update :)

Edit: Unfortunately the switches also disappear when I disable the plugin, too bad.