Zoneminder plugin for Kodi/XBMC

Forum for questions and support relating to the 1.28.x releases only.
thermionic
Posts: 16
Joined: Wed Mar 16, 2016 9:54 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by thermionic »

Good question about resolving the zm host from the kodi box, yes, I can resolve the zm server from the kodi box :-)

I enabled kodi debug and captured as per log fragment http://pastebin.com/YyGMtn42 and saw the 404 following the page request on line 13

Then I enabled HTTP on the zm server, changed the config to suit and it now connects

I'm only a moderately capable sysadmin, but I wonder if something additional is required for the plugin to handle HTTPS ?

If there is anything I can do to help get HTTPS working, please ask!
thermionic
Posts: 16
Joined: Wed Mar 16, 2016 9:54 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by thermionic »

oh, I think I know what the problem might be

I run HAProxy to terminate all HTTPS traffic, and as I have more HTTPS hosts than IP addresses, I use SNI in HAProxy, and I wonder if that is the problem.

I will configure another HAProxy front end on a high port, test over HTTPS on that port (presuming I can simply add a port onto the host name like "f.q.d.n:12443" and revert with my findings
thermionic
Posts: 16
Joined: Wed Mar 16, 2016 9:54 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by thermionic »

I'm happy to report it works perfectly over plain HTTPS :-)

kodibuntu being based on Ubuntu 14.04 only has python 2.7.6 which does not have support for SNI, hence my initial problem...

Thanks for pushing me in the right direction!
Jamo
Posts: 17
Joined: Tue Aug 13, 2013 6:25 am

Re: Zoneminder plugin for Kodi/XBMC

Post by Jamo »

No problem, glad to hear it is working!
spargopolis
Posts: 8
Joined: Mon Nov 30, 2015 10:52 am
Location: Ottawa, Canada

Re: Zoneminder plugin for Kodi/XBMC

Post by spargopolis »

Hi Folks,

Jamo great work adding support for 1.29.x, HTTPS, and the follow on support! I've tested the latest version with ZM 1.28.x and it still works fine.

I got busy with life but I hope in the coming weeks to have some time to work on montage mode. As you probably know that feature appears to be there but actually isn't functional.

Cheers
jes
Posts: 1
Joined: Fri Apr 29, 2016 11:09 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by jes »

I just installed the latest ZM on a CentOS container a week or two ago, which included self-signed HTTPS in the setup. Is there a clever way to tell the plugin to accept the certificate?

18:04:36 3302.775391 T:1756099568 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'urllib2.URLError'>
Error Contents: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
Traceback (most recent call last):
File "/home/osmc/.kodi/addons/plugin.video.zoneminder-master/default.py", line 462, in <module>
listCameras (addonHandle)
File "/home/osmc/.kodi/addons/plugin.video.zoneminder-master/default.py", line 205, in listCameras
doc, cookie = getHtmlPage (url, cookie)
File "/home/osmc/.kodi/addons/plugin.video.zoneminder-master/default.py", line 74, in getHtmlPage
response = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
-->End of Python script error report<--
18:04:36 3302.863281 T:1957209008 ERROR: GetDirectory - Error getting plugin://plugin.video.zoneminder/
18:04:36 3302.878418 T:1957209008 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.zoneminder/) failed
Jamo
Posts: 17
Joined: Tue Aug 13, 2013 6:25 am

Re: Zoneminder plugin for Kodi/XBMC

Post by Jamo »

Hello jes

I'm afraid I don't have an SSL server set up to test with so it would be a bit of a shot in the dark for me. If you like, try the following -

backup the /home/osmc/.kodi/addons/plugin.video.zoneminder-master/default.py
and then replace its contents with the code at the following link

http://paste.fedoraproject.org/362410/14623446/raw/

That doesn't seem to break my non-ssl installation... if it works with your ssl installation then good.

BTW, it bypasses server verification which is, of course, a security risk - so even if it works, you use it at your own risk.

let me know how you go.

James
mikeybs
Posts: 13
Joined: Fri Jul 24, 2015 3:41 am

Re: Zoneminder plugin for Kodi/XBMC

Post by mikeybs »

I am trying to get this kodi add on working, but I can not get any video streams to play. I am running zoneminder 1.29.0 on ubuntu 15.04 using repository ppa:iconnor/zoneminder. I am running Kodi 15.2 using openelec 6.0.3

The add on installs fine. In settings I replace the servername with the IP of my zoneminder install. When I open the addon I see a list of my monitors both live view and events. I am not able to play any video though. Opening the events I do see a listing of all the events for the monitor, but none of them play.

Looking at the kodi log the URL is wrong, it is missing the zm directory. I do have the "ZM Directory" set to zm in the settings...

Instead of trying to open:
http://192.168.60.24/zm/cgi-bin/nph-zms ... &maxfps=25
it tries to open:
http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25

Here is the kod log output when I try to play a live view:

11:46:59 T:140606843443072 NOTICE: DVDPlayer: Opening: http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25
11:46:59 T:140606843443072 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
11:46:59 T:140605820761856 NOTICE: Thread DVDPlayer start, auto delete: false
11:46:59 T:140605820761856 NOTICE: Creating InputStream
11:46:59 T:140605820761856 ERROR: CCurlFile::Open failed with code 404 for http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25
11:46:59 T:140605820761856 ERROR: Open - failed to open source <http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25>
11:46:59 T:140605820761856 ERROR: CDVDPlayer::OpenInputStream - error opening [http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25]
11:46:59 T:140605820761856 NOTICE: CDVDPlayer::OnExit()
11:46:59 T:140606843443072 ERROR: Playlist Player: skipping unplayable item: 0, path [http://192.168.60.24/cgi-bin/nph-zms?mo ... &maxfps=25
11:46:59 T:140606843443072 NOTICE: CDVDPlayer::CloseFile()
11:46:59 T:140606843443072 NOTICE: DVDPlayer: waiting for threads to exit
11:46:59 T:140606843443072 NOTICE: DVDPlayer: finished waiting
11:46:59 T:140606843443072 NOTICE: CDVDPlayer::CloseFile()
11:46:59 T:140606843443072 NOTICE: DVDPlayer: waiting for threads to exit
11:46:59 T:140606843443072 NOTICE: DVDPlayer: finished waiting
mikeybs
Posts: 13
Joined: Fri Jul 24, 2015 3:41 am

Re: Zoneminder plugin for Kodi/XBMC

Post by mikeybs »

I solved the problem by changing the servername to "192.168.60.24/zm" and then changing the ZM Directory to ""

Both live view and events now play fine
alexchini
Posts: 2
Joined: Wed Jun 08, 2016 10:25 am

Re: Zoneminder plugin for Kodi/XBMC

Post by alexchini »

mikeybs wrote:I solved the problem by changing the servername to "192.168.60.24/zm" and then changing the ZM Directory to ""

Both live view and events now play fine
Thanks i had same problem and this resolved it.

As further info i had to use rescan library for make it work after the configuration.

live view and events work fine not the montage view, but its not a big problem
petegriggs
Posts: 2
Joined: Mon Sep 05, 2016 10:51 am

Re: Zoneminder plugin for Kodi/XBMC

Post by petegriggs »

Hi,

Thanks for the addon.

I have just tried it and the live view is working fine but unable to use the montage, looking at the log it is trying to use a set username of admin and password of Inet598 not the one configured. If I change this it works but only displays one monitor. Looking in default.py I have found the line causing the issue:

#TODO Remove hard-coded test code
info["FileName"] = ("%snph-zms?mode=jpeg&monitor=1&scale=25&"
"maxfps=10&user=admin&pass=inet508" % (cgiurl))

I am guessing this is just a hardcoded test that needs removing, by changing the username and password here and the monitor ID I can get it connected and view different monitors but not the montage. Any idea how to get it to montage my 3 cameras correctly?

Thanks
Peter.
Jamo
Posts: 17
Joined: Tue Aug 13, 2013 6:25 am

Re: Zoneminder plugin for Kodi/XBMC

Post by Jamo »

Hi Peter

Glad it is working for you and sorry I haven't had a chance to work on this for a while. Keeps getting pushed down the to-do list.

Sadly, I don't know anything about montage view. I think it is something spargopolis (see his comments earlier in the thread) was starting to add but I'm not sure how he was planning to approach it, I haven't looked at the code. Would be a most useful addition, I agree - just wish I had time to work on it. If you have any ideas, post them. A few weeks back I bookmarked a link someone sent me about some other plugin that had some type of montage... in fact, if you know of any kodi plugins that show multiple videos on the screen at once, please post them and perhaps we can adapt that code for our purposes.

Sorry I can't be of more help at the moment!

James
thespy
Posts: 2
Joined: Wed Sep 21, 2016 7:12 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by thespy »

Just installed the plugin on ZM 1.30 and working great, thanks
Graham68
Posts: 1
Joined: Wed Dec 21, 2016 11:10 pm

Re: Zoneminder plugin for Kodi/XBMC

Post by Graham68 »

I'm running ZoneMinder 1.30.0 on CentOS 7 and Kodi 16.1 on Ubuntu 14.04 but not having much luck with getting this plugin to work. When launched it pauses before logging a URL timeout error in the log (see below). The odd thing is that runnung tcpdump doesn't even show any attempt to connect to my ZoneMinder server!

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'urllib2.URLError'>
Error Contents: <urlopen error timed out>
Traceback (most recent call last):
File "/home/kodi/.kodi/addons/plugin.video.zoneminder-master/default.py", line 461, in <module>
listCameras (addonHandle)
File "/home/kodi/.kodi/addons/plugin.video.zoneminder-master/default.py", line 204, in listCameras
doc, cookie = getHtmlPage (url, cookie)
File "/home/kodi/.kodi/addons/plugin.video.zoneminder-master/default.py", line 74, in getHtmlPage
response = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError: <urlopen error timed out>
-->End of Python script error report<--
kmg454
Posts: 58
Joined: Tue Apr 11, 2017 7:43 am

Re: Zoneminder plugin for Kodi/XBMC

Post by kmg454 »

The plugin works very good but the montage view does nothing, any plans to make this working?
Locked