Page 1 of 1

Python not recognized in Domoticz 4.10726

Posted: Tuesday 03 September 2019 13:24
by yo3ggx
Hi,

I'm struggling for weeks to make the plugins work on my Domoticz installation.
I'm using CentOS 7(3.10.0-957.27.2.el7.x86_64), Domoticz 4.10726 and the following python packages installed:
python36-3.6.8-1.el7.x86_64
python36-libs-3.6.8-1.el7.x86_64
python36-devel-3.6.8-1.el7.x86_64

# python3 -V
Python 3.6.8

Tried with 3.4.x too, with the same result.

In the Domoticz Info page, I get:
About Domoticz
Version: 4.10726
Build Hash: be79a17
Compile Date: 2019-05-10 12:37:55
dzVents Version: 2.4.19
Python Version: None

What else I can try to make Python accessible from Domoticz?

Thank you.

Re: Python not recognized in Domoticz 4.10726

Posted: Tuesday 03 September 2019 15:36
by pipiche
Did you try Domoticz beta ?

It looks like some users are having issues with the stable branche of Domoticz

Re: Python not recognized in Domoticz 4.10726

Posted: Tuesday 03 September 2019 16:15
by yo3ggx
No, I didn't tried. Can I revert to the stable version, if something is going wrong, without losing the configuration?

Re: Python not recognized in Domoticz 4.10726

Posted: Tuesday 03 September 2019 16:18
by pipiche
yo3ggx wrote: Tuesday 03 September 2019 16:15 No, I didn't tried. Can I revert to the stable version, if something is going wrong, without losing the configuration?
Most-likely the move to beta will upgrade the Domoticz Database and you won't have the possibility to downgrade.
If you do a test and you do the proper backup before and so you can restore after the test on beta, and the restore the all environment with stable

Re: Python not recognized in Domoticz 4.10726

Posted: Wednesday 04 September 2019 22:55
by yo3ggx
I cannot compile the beta version because of some errors.
I've tried release version on a different CentOS 7 server with the same results: python installation not recognized.
I have both python 34 and 36 (including libs and devel).
What is needed for a python installation in order to be recognized by Domoticz?

Re: Python not recognized in Domoticz 4.10726

Posted: Wednesday 04 September 2019 23:54
by Dnpwwo
Can you post the Domoticz log of Domoticz starting up? That would help.

Re: Python not recognized in Domoticz 4.10726

Posted: Thursday 05 September 2019 9:53
by yo3ggx
As you can see, nothing about plugins.

Code: Select all

2019-09-05 10:50:04.356 Status: Startup Path: /home/domo/domoticz/
2019-09-05 10:50:04.366 Status: WebServer(HTTP) started on address: :: with port 8282
2019-09-05 10:50:04.368 Status: WebServer(SSL) started on address: :: with port 4343
2019-09-05 10:50:04.369 Status: TCPServer: shared server started...
2019-09-05 10:50:04.369 Status: RxQueue: queue worker started...
2019-09-05 10:50:04.505 Status: Incoming connection from: 192.168.88.121
2019-09-05 10:50:06.369 Status: Hardware Monitor: Started
2019-09-05 10:50:06.570 Status: RFLink: Using serial port: /dev/ttyACM0
2019-09-05 10:50:07.491 Status: RFLink: Controller Initialized!...
2019-09-05 10:50:07.567 Status: RFLink Detected, Version: 1.1 Revision: 46 Build: 0

Re: Python not recognized in Domoticz 4.10726

Posted: Thursday 05 September 2019 20:38
by Xorfor
Did you check: Setup -> Settings -> Other.
Is on this page EventSystem (Lua/Blockly/Scripts) enabled?

Re: Python not recognized in Domoticz 4.10726

Posted: Thursday 05 September 2019 21:37
by yo3ggx
Yes, both are enabled.
I have two Domoticz installations on two separate CentOS 7 servers and the behavior is the same. Python installation is not recognized.

Re: Python not recognized in Domoticz 4.10726

Posted: Friday 06 September 2019 6:07
by Dnpwwo
@yo3ggx,

I assume from this that you built Domoticz yourself from source but Python support was not included.

I don't know much about CentOS but the CMakeLists.txt has this in it:

Code: Select all

option(USE_PYTHON "Use Python for Plugins and Event-Scripts" YES)
IF(USE_PYTHON)
  find_package(PythonInterp 3.4)
  find_package(PythonLibs 3.4)
  IF(PYTHONLIBS_FOUND)
    MESSAGE(STATUS "Python3 includes found at: ${PYTHON_INCLUDE_PATH}")
    INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
    add_definitions(-DENABLE_PYTHON)
  ELSE(PYTHONLIBS_FOUND)
    MESSAGE(FATAL_ERROR "Python3 not found on your system, use USE_PYTHON=NO or sudo apt-get install python3-dev)")
  ENDIF(PYTHONLIBS_FOUND)
ENDIF(USE_PYTHON)
which makes the code be compiled with ENABLE_PYTHON if USE_PYTHON is specified in the 'cmake' command (which it normally is by default).

If the code is built with this flag you will always get a Python related message at startup saying which version it found or stating it didn't find one.

Re: Python not recognized in Domoticz 4.10726

Posted: Friday 06 September 2019 8:29
by yo3ggx
Is enabled in CMakeLists.txt.

Code: Select all

option(USE_PYTHON "Use Python for Plugins and Event-Scripts" YES)
IF(USE_PYTHON)
  find_package(PythonInterp 3.4)
  find_package(PythonLibs 3.4)
  IF(PYTHONLIBS_FOUND)
    MESSAGE(STATUS "Python3 includes found at: ${PYTHON_INCLUDE_PATH}")
    INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
    add_definitions(-DENABLE_PYTHON)
  ELSE(PYTHONLIBS_FOUND)
    MESSAGE(FATAL_ERROR "Python3 not found on your system, use USE_PYTHON=NO or sudo apt-get install python3-dev)")
  ENDIF(PYTHONLIBS_FOUND)
ENDIF(USE_PYTHON)
I have both Python 3.4 and 3.6 installed.

I've done a 'make clean' and then 'make' with the latest release.
Still the same issue and no message related to Python at startup.

Code: Select all

[domo@nuc domoticz]# ./domoticz -www 8888 -sslwww 4443 
2019-09-06 09:28:11.040  Status: Domoticz V4.10726 (c)2012-2019 GizMoCuz
2019-09-06 09:28:11.040  Status: Build Hash: be79a17, Date: 2019-05-10 12:37:55
2019-09-06 09:28:11.040  Status: Startup Path: /home/packages/domoticz/
2019-09-06 09:28:11.047  Sunrise: 05:46:00 SunSet: 18:19:00
2019-09-06 09:28:11.047  Day length: 12:33:00 Sun at south: 12:02:00
2019-09-06 09:28:11.047  Civil twilight start: 05:23:00 Civil twilight end: 18:42:00
2019-09-06 09:28:11.047  Nautical twilight start: 04:55:00 Nautical twilight end: 19:10:00
2019-09-06 09:28:11.047  Astronomical twilight start: 04:28:00 Astronomical twilight end: 19:37:00
2019-09-06 09:28:11.049  Active notification Subsystems: email (1/13)
2019-09-06 09:28:11.049  Status: WebServer(HTTP) started on address: :: with port 8888
2019-09-06 09:28:11.051  Status: WebServer(SSL) started on address: :: with port 4443
2019-09-06 09:28:11.052  Starting shared server on: :::6144
2019-09-06 09:28:11.052  Status: TCPServer: shared server started...
2019-09-06 09:28:11.052  Status: RxQueue: queue worker started...
2019-09-06 09:28:11.467  Status: Incoming connection from: 192.168.33.101
2019-09-06 09:28:13.052  Status: Hardware Monitor: Started
2019-09-06 09:28:13.253  Status: RFLink: Using serial port: /dev/ttyACM0
2019-09-06 09:28:14.174  Status: RFLink: Controller Initialized!...
2019-09-06 09:28:14.249  Status: RFLink Detected, Version: 1.1 Revision: 46 Build: 0

Re: Python not recognized in Domoticz 4.10726

Posted: Friday 06 September 2019 9:06
by yo3ggx
I've solved the issue based on the suggestion from here:
https://github.com/YosysHQ/nextpnr/issues/214

It was just about removing the file CMakeCache.txt and rebuilding the release version.
Now I get the following when compiling.

Code: Select all

-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.10", minimum required is "3.4") 
-- Found PythonLibs: /usr/lib64/libpython3.4m.so (found suitable version "3.4.10", minimum required is "3.4") 
-- Python3 includes found at: /usr/include/python3.4m
When I start domoticz, I can see in the "About" page:

Code: Select all

Python Version: 3.6.8 (default, Apr 25 2019, 21:02:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

Re: Python not recognized in Domoticz 4.10726

Posted: Thursday 24 October 2019 21:47
by 00luke
This worked for me! Just for anyone else in the future..

I just had to navigate to the domoticz install folder, run:

Code: Select all

mv CMakeCache.txt CMakeCache.old
and then:

Code: Select all

make
and voila - it worked! Thank you :D