Page 1 of 1

Python plugin.py module error

Posted: Sunday 20 May 2018 20:41
by lucasub
Hello, I have this problem: when I import sqlite3 module into python plugin, Domoticz invoke the plugin and apparently there are no errors.
The problem is that Domoticz call never onStart() and all other functions on Class.

With others import module (Ex. sys, os, pprint....) the plugin work well.
Also with stopped Domoticz, the log error: Error: (Luca) Plugin did not finish start after 30 seconds

Thank you for answer.
Bye
Luca

Re: Python plugin.py module error

Posted: Sunday 20 May 2018 22:59
by zak45
lucasub wrote: Sunday 20 May 2018 20:41 Hello, I have this problem: when I import sqlite3 module into python plugin, Domoticz invoke the plugin and apparently there are no errors.
The problem is that Domoticz call never onStart() and all other functions on Class.

With others import module (Ex. sys, os, pprint....) the plugin work well.
Also with stopped Domoticz, the log error: Error: (Luca) Plugin did not finish start after 30 seconds

Thank you for answer.
Bye
Luca
Some module do not work with python framework, this is the case with requests and probably with sqlite3. try to found some others one.

Re: Python plugin.py module error

Posted: Sunday 20 May 2018 23:55
by Dnpwwo
@lucasu,

@zak45 is correct. The framework is single threaded so any imports that attempt to do thread operations during the initial import will fail in this way. Sqlite3 is one of them.

Re: Python plugin.py module error

Posted: Monday 21 May 2018 11:44
by lucasub
Thank you for quick answer.

I'll have to look for another way to import data from the DJANGO database

Bye
Luca