[SOLVED] Plugin DSP-W215 makes webservice refuses connections
Posted: Sunday 18 March 2018 18:27
I am using Domoticz on RPI with Stretch... Already running a while without any problem. Below you can find the version of the Domoticz (I switched to a Beta release to try to solve the described problem, but without result). I have installed Python 2.7, 3.4 and 3.5. Default "python3" is 3.5, "python" refers to 2.7. I created already a plugin to monitor my battery and it works without problem (you will see the difference with this problem).
When I am using now the plugin of the DSP-W215 available in the examples (copied into the "plugins" folder and restart domoticz, add hardware), domoticz is not accessible anymore through its webservice ("connection refused"). It can only be restored by removing this plugin (delete from the directory) and restart the RPI. Just restarting domoticz doesn't help...
If found out that it all has to do with the import of libraries "import hmac" and "import hashlib". I made a simple plugin with these imports and have the identical behaviour. Commenting them out solved the problem. So I did the same with the DSP-W215 plugin (and of course commented all the code using those libraries) and indeed the problem was gone. Of course the functionality does not work because these libraries are required for the SOAP protocol to the DSP-W215. I didn't install those libraries because they are coming by default with the installation of python (I find them in the "/usr/lib/python3.5" directory).
If start python3 (3.5) on the command line and try to import these libraries manually, there is no problem. I already forced domoticz using python3.4, but seems not possible. With "update-alternatives" I forced python and python3 to version 3.4, but if Domoticz starts, it uses always 3.5. So left this solution track because I don't believe it would solve my problem. "python --version" and "python3 --version" gives resp. "Python 2.7.13" and "Python 2.5.3".
I am already investigating the problem for one day and become desperate...
Any help or suggestions are welcome!
Domoticz version:
Version: 3.9052
Build Hash: 927ba005
Compile Date: 2018-03-18 08:38:55
dzVents Version: 2.4.1
Python Version: 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124]
When I am using now the plugin of the DSP-W215 available in the examples (copied into the "plugins" folder and restart domoticz, add hardware), domoticz is not accessible anymore through its webservice ("connection refused"). It can only be restored by removing this plugin (delete from the directory) and restart the RPI. Just restarting domoticz doesn't help...
If found out that it all has to do with the import of libraries "import hmac" and "import hashlib". I made a simple plugin with these imports and have the identical behaviour. Commenting them out solved the problem. So I did the same with the DSP-W215 plugin (and of course commented all the code using those libraries) and indeed the problem was gone. Of course the functionality does not work because these libraries are required for the SOAP protocol to the DSP-W215. I didn't install those libraries because they are coming by default with the installation of python (I find them in the "/usr/lib/python3.5" directory).
If start python3 (3.5) on the command line and try to import these libraries manually, there is no problem. I already forced domoticz using python3.4, but seems not possible. With "update-alternatives" I forced python and python3 to version 3.4, but if Domoticz starts, it uses always 3.5. So left this solution track because I don't believe it would solve my problem. "python --version" and "python3 --version" gives resp. "Python 2.7.13" and "Python 2.5.3".

Any help or suggestions are welcome!
Domoticz version:
Version: 3.9052
Build Hash: 927ba005
Compile Date: 2018-03-18 08:38:55
dzVents Version: 2.4.1
Python Version: 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124]