kofec / Domoticz-Enigma2

Enigma2 Plugin for domoticz
3 stars 1 forks source link

Plugin not working #1

Closed ageurtse closed 6 years ago

ageurtse commented 6 years ago

Hello,

I'm having trouble to get this plugin to work. i'm running the latest Beta v3.8796.

After installing the plugin and rebooting my pi, the plugin is visible, so far so good. when adding the plugin and filling the desired ip adres and port number, and hitting save, domoticz is crashing. i'm unable to load de hardware, device other pages.

Rebooting the device wouldn't help, no page is loading.

i have to completly remove the plugin dir to get domoticz running again.

Please need some advice on how to run this plugin.

below a log when i start domoticz bij command prompt.

pi@raspberrypi:~/domoticz $ sudo ./domoticz 2017-12-27 13:29:11.091 Domoticz V3.8796 (c)2012-2017 GizMoCuz 2017-12-27 13:29:11.092 Build Hash: 2d99bbbc, Date: 2017-12-24 07:06:53 2017-12-27 13:29:11.093 Startup Path: /home/pi/domoticz/ 2017-12-27 13:29:11.160 Sunrise: 08:43:00 SunSet: 16:26:00 2017-12-27 13:29:11.160 Day length: 07:43:00 Sun at south: 12:34:00 2017-12-27 13:29:11.160 Civil twilight start: 08:02:00 Civil twilight end: 17:07:00 2017-12-27 13:29:11.160 Nautical twilight start: 07:18:00 Nautical twilight end: 17:51:00 2017-12-27 13:29:11.160 Astronomical twilight start: 06:36:00 Astronomical twilight end: 18:33:00 2017-12-27 13:29:11.161 EventSystem: reset all events... 2017-12-27 13:29:11.373 PluginSystem: Started, Python version '3.5.3'. 2017-12-27 13:29:11.397 Active notification Subsystems: (0/14) 2017-12-27 13:29:11.400 WebServer(HTTP) started on address: :: with port 8080 2017-12-27 13:29:11.411 WebServer(SSL) started on address: :: with port 443 2017-12-27 13:29:11.415 Proxymanager started. 2017-12-27 13:29:11.418 Starting shared server on: :::6144 2017-12-27 13:29:11.419 TCPServer: shared server started... 2017-12-27 13:29:11.420 RxQueue: queue worker started... 2017-12-27 13:29:13.421 Kodi: Started 2017-12-27 13:29:13.421 (VU) Started. 2017-12-27 13:29:13.422 EventSystem: reset all events... 2017-12-27 13:29:13.424 EventSystem: reset all device statuses... 2017-12-27 13:29:13.523 Kodi: (Woonkamer) Starting thread. 2017-12-27 13:29:13.563 Kodi: (Woonkamer) Connected to '192.168.1.232:9090'. 2017-12-27 13:29:13.623 Kodi: Starting I/O service thread. 2017-12-27 13:29:13.665 PluginSystem: Entering work loop. 2017-12-27 13:29:13.717 Python EventSystem: Initalizing event module. 2017-12-27 13:29:13.722 EventSystem: Started 2017-12-27 13:29:13.723 EventSystem: Queue thread started... Segmentation fault

kofec commented 6 years ago

Hi, I have added file(enigma2.py) which can help in debugging. You can provide logs here - remove user and password if you use it

kofec commented 6 years ago

add Description in Readme

kezon commented 5 years ago

Hi, I have tested this plugin on latest beta 4.10427, Python 3.4, xmltodict installed however the plugin crashes whole app. Please let me know what logs do you want me to send for debugging?

kofec commented 5 years ago

try now

kofec commented 5 years ago

I have updated the repo

kezon commented 5 years ago

OK, will do.

kezon commented 5 years ago

So I have cloned a whole new repo, added new HW. I even saw in logs:

2019-02-21 14:47:54.956 Status: (Enigma) Started.

but then in a few seconds again as before, all Python plugins seem to fail:

2019-02-21 14:51:02.030 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:51:02.030 Error: Enigma hardware (8) thread seems to have ended unexpectedly 2019-02-21 14:51:16.033 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:51:16.033 Error: Enigma hardware (8) thread seems to have ended unexpectedly 2019-02-21 14:51:30.036 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:51:30.036 Error: Enigma hardware (8) thread seems to have ended unexpectedly 2019-02-21 14:51:44.039 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:51:44.039 Error: Enigma hardware (8) thread seems to have ended unexpectedly 2019-02-21 14:51:58.042 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:51:58.043 Error: Enigma hardware (8) thread seems to have ended unexpectedly 2019-02-21 14:52:12.051 Error: EventSystem thread seems to have ended unexpectedly (last update 72.000000 seconds ago) 2019-02-21 14:52:12.051 Error: WebServer:8080 thread seems to have ended unexpectedly (last update 70.000000 seconds ago) 2019-02-21 14:52:12.051 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly 2019-02-21 14:52:12.051 Error: Enigma hardware (8) thread seems to have ended unexpectedly

And so it stays in error, no new device added.

So I tested the enigma2.py test: ./enigma2.py 192.168.88.26:9080

but it does not seem to run properly, only shows information about wget use.

BTW, this is my Enigma box url: http://192.168.88.26:9080/web/about

The xmltodist is installed here: /usr/local/lib/python3.4/dist-packages/xmltodict.py

and I have also edited the pathOfPackages = '/usr/local/lib/python3.4/dist-packages' in the enigma2.py to match the installed python version 3.4 - didn't work either.

Finally I have also tested to edit the pathOfPackages in plugin.py to point to the place where packages are installed. It all failed again so that Domoticz didnt even start.

It seems that my environment is not quite the same as the standard expected... So it might not find what it needs. I can test further if you have something to ask me to do.

kofec commented 5 years ago

I think that I found a reason. I'm using default port so other was not tested. Try the latest version

kezon commented 5 years ago

Updated again only the path to the lib... and this is the result:

root@raspberrypi:/home/pi/domoticz/plugins/Domoticz-Enigma2# ./enigma2.py 192.168.88.26:9080
Namespace(IPaddress='192.168.88.26:9080', password=None, port=None, user=None)
Current paths where search for modules: ['/home/pi/domoticz/plugins/Domoticz-Enigma2', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-arm-linux-gnueabihf', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']
Adding path: /usr/local/lib/python3.4/dist-packages
GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
GNU Wget 1.16 built on linux-gnueabihf.

+digest +https +ipv6 +iri +large-file +nls +ntlm +opie +psl +ssl/gnutls 

Wgetrc: 
    /etc/wgetrc (system)
Locale: 
    /usr/share/locale 
Compile: 
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" 
    -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib 
    -D_FORTIFY_SOURCE=2 -I/usr/include -g -O2 -fstack-protector-strong 
    -Wformat -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 
    -g -Wall 
Link: 
    gcc -g -O2 -fstack-protector-strong -Wformat 
    -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall 
    -Wl,-z,relro -L/usr/lib -lnettle -lgnutls -lz -lpsl -lidn -luuid 
    ftp-opie.o gnutls.o http-ntlm.o ../lib/libgnu.a 

Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.
Read data about tuner with Enigma2: 
Connect via wget to website: wget -q -O - http://192.168.88.26:9080/web/about
Traceback (most recent call last):
  File "./enigma2.py", line 81, in <module>
    data = subprocess.check_output(['bash', '-c', 'wget -q -O - ' + url])
  File "/usr/lib/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['bash', '-c', 'wget -q -O - http://192.168.88.26:9080/web/about']' returned non-zero exit status 6
root@raspberrypi:/home/pi/domoticz/plugins/Domoticz-Enigma2# 
kezon commented 5 years ago

I can see now you added a new attribute - port. Let me test it then.

kezon commented 5 years ago

so now I seem to have the enigma2.py working. added port

Connect via wget to website: wget -q -O - http://root:xxxxxxx@192.168.88.26:9080/web/about
b'<?xml version="1.0" encoding="UTF-8"?>\n<e2abouts>\n\t<e2about>\n\t\t<e2oeversion>PLi-OE</e2oeversion>\n\t\t<e2enigmaversion>2018-09-01-release-4</e2enigmaversion>\n\t\t<e2distroversion>openpli</e2distroversion>\n\t\t<e2imageversion>4</e2imageversion>\n\t\t<e2driverdate>3.13.5+20161228-r0.2</e2driverdate>\n\t\t<e2webifversion>OWIF 1.2.8</e2webifversion>\n\t\t<e2fpversion>None</e2fpversion>\n\t\t<e2model>Zero</e2model>\n\t\t<e2lanmac>00:1d:ec:0c:8e:c4</e2lanmac>\n\t\t<e2landhcp>False</e2landhcp>\n\t\t<e2lanip>192.168.88.26</e2lanip>\n\t\t<e2lanmask>255.255.255.0</e2lanmask>\n\t\t<e2langw>192.168.88.1</e2langw>\n\t\t<e2tunerinfo>\n\t\t\t<e2nim>\n\t\t\t\t<name>Tuner A</name>\n\t\t\t\t<type>BCM7362 DVB-S2 NIM (internal) (DVB-S2)</type>\n\t\t\t</e2nim>\n\t\t</e2tunerinfo>\t\t\n\t\t<e2servicename></e2servicename>\n\t\t<e2servicenamespace></e2servicenamespace>\n\t\t<e2serviceaspect>0</e2serviceaspect>\n\t\t<e2serviceprovider></e2serviceprovider>\n\t\t<e2videowidth>0</e2videowidth>\n\t\t<e2videoheight>0</e2videoheight>\n\t\t<e2servicevideosize>0x0</e2servicevideosize>\n\t\t<e2apid>0</e2apid>\n\t\t<e2vpid>0</e2vpid>\n\t\t<e2pcrpid>0</e2pcrpid>\n\t\t<e2pmtpid>0</e2pmtpid>\n\t\t<e2txtpid>N/A</e2txtpid>\n\t\t<e2tsid>0</e2tsid>\n\t\t<e2onid>0</e2onid>\n\t\t<e2sid>0</e2sid>\n\t</e2about>\n</e2abouts>\n'
e2oeversion => PLi-OE
e2enigmaversion => 2018-09-01-release-4
e2distroversion => openpli
e2imageversion => 4
e2driverdate => 3.13.5+20161228-r0.2
e2webifversion => OWIF 1.2.8
e2fpversion => None
e2model => Zero
e2lanmac => 00:1d:ec:0c:8e:c4
e2landhcp => False
e2lanip => 192.168.88.26
e2lanmask => 255.255.255.0
e2langw => 192.168.88.1
e2tunerinfo => OrderedDict([('e2nim', OrderedDict([('name', 'Tuner A'), ('type', 'BCM7362 DVB-S2 NIM (internal) (DVB-S2)')]))])
e2servicename => None
e2servicenamespace => None
e2serviceaspect => 0
e2serviceprovider => None
e2videowidth => 0
e2videoheight => 0
e2servicevideosize => 0x0
e2apid => 0
e2vpid => 0
e2pcrpid => 0
e2pmtpid => 0
e2txtpid => N/A
e2tsid => 0
e2onid => 0
e2sid => 0
OrderedDict([('e2oeversion', 'PLi-OE'), ('e2enigmaversion', '2018-09-01-release-4'), ('e2distroversion', 'openpli'), ('e2imageversion', '4'), ('e2driverdate', '3.13.5+20161228-r0.2'), ('e2webifversion', 'OWIF 1.2.8'), ('e2fpversion', 'None'), ('e2model', 'Zero'), ('e2lanmac', '00:1d:ec:0c:8e:c4'), ('e2landhcp', 'False'), ('e2lanip', '192.168.88.26'), ('e2lanmask', '255.255.255.0'), ('e2langw', '192.168.88.1'), ('e2tunerinfo', OrderedDict([('e2nim', OrderedDict([('name', 'Tuner A'), ('type', 'BCM7362 DVB-S2 NIM (internal) (DVB-S2)')]))])), ('e2servicename', None), ('e2servicenamespace', None), ('e2serviceaspect', '0'), ('e2serviceprovider', None), ('e2videowidth', '0'), ('e2videoheight', '0'), ('e2servicevideosize', '0x0'), ('e2apid', '0'), ('e2vpid', '0'), ('e2pcrpid', '0'), ('e2pmtpid', '0'), ('e2txtpid', 'N/A'), ('e2tsid', '0'), ('e2onid', '0'), ('e2sid', '0')])
check power state: 
Connect via wget to website: wget -q -O - http://root:xxxxxx@192.168.88.26:9080/web/powerstate?
b'<?xml version="1.0" encoding="UTF-8"?>\n<e2powerstate>\n\t<e2instandby>\ntrue\t</e2instandby>\n</e2powerstate>\n'
OrderedDict([('e2instandby', 'true')])
Wakeup form Standby: 
Connect via wget to website: wget -q -O - http://root:xxxxxx@192.168.88.26:9080/web/powerstate?newstate=4
b'<?xml version="1.0" encoding="UTF-8"?>\n<e2powerstate>\n\t<e2instandby>\ntrue\t</e2instandby>\n</e2powerstate>\n'
Wait 5 seconds
Connect via wget to website: wget -q -O - 'http://root:xxxxxx@192.168.88.26:9080/web/message?text=Domoticz%20plugin%20test%0AYour%20Tuner%20will%0Abe%20off%20in%205%20seconds&type=1&timeout=5'
b'<?xml version="1.0" encoding="UTF-8"?>\n<e2simplexmlresult>\n\t<e2state>True</e2state>\n\t<e2statetext>Zpr\xc3\xa1va \xc3\xbasp\xc4\x9b\xc5\xa1n\xc4\x9b odesl\xc3\xa1na!</e2statetext>\t\n</e2simplexmlresult>\n'
Wait 5 seconds
Standby: 
Connect via wget to website: wget -q -O - http://root:xxxxxx@192.168.88.26:9080/web/powerstate?newstate=5
b'<?xml version="1.0" encoding="UTF-8"?>\n<e2powerstate>\n\t<e2instandby>\nfalse\t</e2instandby>\n</e2powerstate>\n'
OrderedDict([('e2powerstate', OrderedDict([('e2instandby', 'false')]))])

Testing the plugin itself after restart....

I can see in logs: 2019-02-21 17:55:04.776 Status: (Satelit) Started.

but in few seconds I keep seeing the error in log:

2019-02-21 17:56:16.928 Error: Yamaha AVR hardware (7) thread seems to have ended unexpectedly
2019-02-21 17:56:16.928 Error: Satelit hardware (8) thread seems to have ended unexpectedly

Tried to disable the Yamaha, but again the same result, the whole Domoticz is unresponsive until I remove the plugin from plugins folder.