Stability with Python Plugins

Python and python framework

Moderator: leecollings

Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Stability with Python Plugins

Post by Noudje »

I know that the use of Python Plugins is beta.
But my experience is that after adding a python plugin as hardware, after a couple of hours, Domoticz stops working. When I restart the domoticz service, is works again for a couple of hours, but will stop again.
With Domoticz stopping, I mean that the domoticz web page gives off line, and (lua) scripts are not running. The raspberry pi is still accessible.
I am using jessie with python3 and python3-dev are the latest versions.

Any one with the same experience? Any suggestions how to solve this?
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Stability with Python Plugins

Post by EdwinK »

I have the problem that when I add a python plugin (buienrader, circle360) after activating it, there is an error regarding devices. I have to completely remove the plugin and then restarting domoticz to fix it.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Re: Stability with Python Plugins

Post by Noudje »

I didn't see any errors in the log. With a Python plugin created hardware but disabled(!), no problems.
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Stability with Python Plugins

Post by febalci »

Noudje wrote: Tuesday 05 December 2017 20:47 Any one with the same experience? Any suggestions how to solve this?
Is the problem with a specific plugin or all? Using 3.8153 stable with 4 plugins on synology, didnot had any problem so far.
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Stability with Python Plugins

Post by mrinner »

Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Re: Stability with Python Plugins

Post by Noudje »

It happens with any python plugin, even with the standard template plugin!!!

I just did a new installation with the latest stretch liet version on a Raspberry 2. Hopefully better result now
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Re: Stability with Python Plugins

Post by Noudje »

The Raspberry Pi with a new installation of Domoticz (latest beta) works fine. Two python plugins now running for 3 days without any problem.
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Stability with Python Plugins

Post by mrinner »

I tested on 2 dev machine the same set of plugins,
first with Ubuntu 16.04 with latest apt-get upgrades and latest beta - sometimes crashes
second with Ubuntu 16.04 without apt-get upgrades and latest beta - without crash for 4 days
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Stability with Python Plugins

Post by Dnpwwo »

@mrinner and @Noudje,

Sorry to hear you are still having issues. I have tried to reproduce them without success unfortunately. The stack traces which have been posted show errors very deep in Python which means I can't determine the cause.

On my main system I run 8 plugins continuously and the last time I restarted it had been running for 22 days without issue.

There is definitely some sensitivity to underlying software though. It has been know for some time that building from source for RPi gives a much more stable system than using the betas and its interesting that an Ubuntu without some patches is more stable than a patched one.

Running vanilla Stretch on an RPi3 built from source with nothing else on the Pi has been rock solid for me and has been for months.

Do you have anything else running on your machines?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Re: Stability with Python Plugins

Post by Noudje »

@Dnpwwo:

On one RPi2B with Jessie, is Domoticz (only) running for 2 years without any problems. This is the one with problems with plugins :oops: .
An other RPi2B with Stretch and a complete new install of the latest beta is running very good. 3 Plugins are running without any problem :) !!!
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Stability with Python Plugins

Post by EdwinK »

For me, this is still a problem. The Pi is only being used for Domoticz. The only thing I changed is that after booting everything else runs from an external drive. I do not really dare to compile this my self, as I'm not really into this. I rather install and forget. Besides, the instructions scare me a bit. I really hope that there will be a solution soon.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
lrybak
Posts: 40
Joined: Thursday 18 December 2014 20:12
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Stability with Python Plugins

Post by lrybak »

I have the same issue.
Domoticz crash just after I enable plugin
see catchsegv log below
https://gist.github.com/lrybak/f7be098b ... 989895dd9b

I'm running RPI3 on stretch lite.
There are no many tools installed on that Pi, domoticz, monit, mosquitto and few really small tools

I have running domoticz on ubuntu server on vmware machine. Plugin works rock stable there
HW: HP dc7900 USD running ESXi, RaspberryPi (few of it), AEON S2 USB stick, Fibaro modules (Dimmers, switches), 1-wire (DS18B20, DS2423), DSC Alarm with Envisalink ethernet module, MySensors, RFLink
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Stability with Python Plugins

Post by Dnpwwo »

Pushed a fix yesterday where plugins could crash when being stopped (or restarted) if they updated a device in onDisconnect or onStop.

Don't think it will help with general stability but every fixed issue get us closer to where we want to be !
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Noudje
Posts: 16
Joined: Monday 25 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta

Re: Stability with Python Plugins

Post by Noudje »

I found out that most of the problems come from plugins using connections!
I created a simple plugin based on the HTTP.py example. In the example in onStart, you find:

Code: Select all

        self.httpConn = Domoticz.Connection(Name="HTTP Test", Transport="TCP/IP", Protocol="HTTP", Address=Parameters["Address"], Port=Parameters["Port"])
        self.httpConn.Connect()
I removed the last line and placed that in the onCommand and onHeartbeat procedures. It is running now for days without any problem.
Raspberry Pi 2 with latest beta version
1x Aeon Labs USB Z-Stick S2
5x Fibaro Modules
micha_pr
Posts: 82
Joined: Friday 24 October 2014 12:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany, near Berlin
Contact:

Re: Stability with Python Plugins

Post by micha_pr »

Noudje wrote: Thursday 21 December 2017 22:04 I found out that most of the problems come from plugins using connections!
I created a simple plugin based on the HTTP.py example. In the example in onStart, you find:

Code: Select all

 self.httpConn = Domoticz.Connection(Name="HTTP Test", Transport="TCP/IP", Protocol="HTTP", Address=Parameters["Address"], Port=Parameters["Port"])
 self.httpConn.Connect()
I removed the last line and placed that in the onCommand and onHeartbeat procedures. It is running now for days without any problem.
Yes possible... I have got here (using Domoticz.Connection) as sample:

Code: Select all

'CConnection_send' failed 'TypeError':''dict' does not support the buffer interface'.
Michael Pruefer
----------------------------
http://www.zwave-review.com (German only)
http://www.SmartHome.Work (German only)
gerardwr
Posts: 32
Joined: Saturday 28 January 2017 11:30
Target OS: -
Domoticz version:
Contact:

Re: Stability with Python Plugins

Post by gerardwr »

Noudje wrote: Thursday 21 December 2017 22:04 I found out that most of the problems come from plugins using connections!
That matches with a problem I encountered this week.

A plugin based on the plugin template, doing “almost nothing” has been running without problem for many months.

This week I started with a plugin using Http connections and suddenly Domticz crashes frequently.

Since I am just starting with those plug-ins I assumed I created the problem myself, So maybe I did not!

Thanks for the hint.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Stability with Python Plugins

Post by Dnpwwo »

@micha_pr,

You are getting an error returned, not a crash. If you post some of your code I can have a look to see if the Send function can be improved.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
micha_pr
Posts: 82
Joined: Friday 24 October 2014 12:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany, near Berlin
Contact:

Re: Stability with Python Plugins

Post by micha_pr »

Dnpwwo wrote: Sunday 24 December 2017 1:47 @micha_pr,

You are getting an error returned, not a crash. If you post some of your code I can have a look to see if the Send function can be improved.
No, it is an additional part of the crash. Maybe not everytime it will appear in the log,
Please look here, there is the plugin and more info:
https://www.domoticz.com/forum/viewtopi ... 65&t=20625
Michael Pruefer
----------------------------
http://www.zwave-review.com (German only)
http://www.SmartHome.Work (German only)
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Stability with Python Plugins

Post by Dnpwwo »

@micha_pr,

What version of the beta are you running? I had a look at the link you specified and the error message

Code: Select all

failed to parse parameters, Message or Message,Verb,URL,Headers,Delay expected.
is very out of date, the parameters (and error) are now

Code: Select all

failed to parse parameters, Message or Message, Delay expected.
can you update to the latest and see if the problem still exists?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
micha_pr
Posts: 82
Joined: Friday 24 October 2014 12:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany, near Berlin
Contact:

Re: Stability with Python Plugins

Post by micha_pr »

Hi,

I was going back to stable version, because of problems with plugin in latest Beta (3.8795).
Original errors came from 3.8794. See also here:
https://github.com/domoticz/domoticz/issues/1891

But release version didn't help. I will update to latest version again and tell you.
Michael Pruefer
----------------------------
http://www.zwave-review.com (German only)
http://www.SmartHome.Work (German only)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest