Python plugin.py module error

Python and python framework

Moderator: leecollings

Post Reply
lucasub
Posts: 15
Joined: Monday 28 March 2016 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Python plugin.py module error

Post 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
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python plugin.py module error

Post 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.
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: Python plugin.py module error

Post 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.
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
lucasub
Posts: 15
Joined: Monday 28 March 2016 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin.py module error

Post by lucasub »

Thank you for quick answer.

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

Bye
Luca
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest