Kodi Community Forum
[RELEASE] ZoneMinder CCTV Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] ZoneMinder CCTV Addon (/showthread.php?tid=90034)

Pages: 1 2 3 4


RE: [RELEASE] ZoneMinder CCTV Addon - eddiek2000 - 2015-02-20

I have emailed Mark and hope for a response. In the meantime, you can get the zip here:

https://github.com/eddiek2000/plugin.video.zoneminder/archive/master.zip


RE: [RELEASE] ZoneMinder CCTV Addon - netmonky - 2015-02-20

Thanks. When i try and install your zip I get told it is the wrong structure. i bumped the requires to 2.19 from the 1.1.2 version on github,which allowed me to install but not open the app. The errors i see are:

15:39:35 T:1647715392 NOTICE: -->Python Interpreter Initialized<--
15:39:37 T:1647715392 ERROR: Grabbing URL: http:////?skin=classic
15:39:37 T:1647715392 ERROR: Requesting page: http:////?skin=classic
15:39:37 T:1647715392 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 no host given>
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 170, in <module>
listcameras()
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 147, in listcameras
doc = gethtmlpage(url)
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 47, in gethtmlpage
response = urllib2.urlopen(req)
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 126, in urlopen
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 398, in open
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 1106, in do_request_
URLError: <urlopen error no host given>
-->End of Python script error report<--
15:39:38 T:1969082368 ERROR: GetDirectory - Error getting plugin://plugin.video.zoneminder/
15:39:38 T:1969082368 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.zoneminder/) failed
15:39:38 T:1647715392 NOTICE: Thread BackgroundLoader start, auto delete: false


RE: [RELEASE] ZoneMinder CCTV Addon - eddiek2000 - 2015-02-21

(2015-02-20, 17:59)netmonky Wrote: Thanks. When i try and install your zip I get told it is the wrong structure. i bumped the requires to 2.19 from the 1.1.2 version on github,which allowed me to install but not open the app. The errors i see are:

15:39:35 T:1647715392 NOTICE: -->Python Interpreter Initialized<--
15:39:37 T:1647715392 ERROR: Grabbing URL: http:////?skin=classic
15:39:37 T:1647715392 ERROR: Requesting page: http:////?skin=classic
15:39:37 T:1647715392 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 no host given>
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 170, in <module>
listcameras()
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 147, in listcameras
doc = gethtmlpage(url)
File "/storage/.kodi/addons/plugin.video.zoneminder-master/default.py", line 47, in gethtmlpage
response = urllib2.urlopen(req)
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 126, in urlopen
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 398, in open
File "/home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib2.py", line 1106, in do_request_
URLError: <urlopen error no host given>
-->End of Python script error report<--
15:39:38 T:1969082368 ERROR: GetDirectory - Error getting plugin://plugin.video.zoneminder/
15:39:38 T:1969082368 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.zoneminder/) failed
15:39:38 T:1647715392 NOTICE: Thread BackgroundLoader start, auto delete: false


I am running on Kodi on debian/i5NUC. Looks like you are running openelec on arm/RASPi. Let me try on my ODROID C1 and see if it barfs.


RE: [RELEASE] ZoneMinder CCTV Addon - eddiek2000 - 2015-02-21

update.

On my i5/NUC it works perfect - XBMC 14.0-Alpha4 (1-3-2015). Camera preview works, background is as expected, camera full screen works good for ALL cameras. I have 5, 4 at 2048, and one at 1080.

On the ODROID C1, it works. The preview works for all cameras, but the full screen is strange (image is seen with streaking on sides and bottom) for the 2048 camera and perfect for the 1080. Also, the background is strange during the preview. - Kodi 15.0 ALPHA1

I'll have to look into the problems on the c1 later in the week. PM me if you want to try the version I am running and I'll email it to you.


RE: [RELEASE] ZoneMinder CCTV Addon - netmonky - 2015-02-21

I am running Kodi 14.1 on openelec which seens to crash when opening up the app. Looking at the error, it does not appear to be able to read its settings - ieL the ip of zoneminder.


RE: [RELEASE] ZoneMinder CCTV Addon - eddiek2000 - 2015-02-21

(2015-02-21, 21:12)netmonky Wrote: I am running Kodi 14.1 on openelec which seens to crash when opening up the app. Looking at the error, it does not appear to be able to read its settings - ieL the ip of zoneminder.

Are you able to set up the ZM plugin? Right click on the Zoneminder plugin and select add-on settings. There you can set ZM IP and AUTH settings.


RE: [RELEASE] ZoneMinder CCTV Addon - netmonky - 2015-02-22

Sorted it. What is odd is the settings.xml file goes awol on install via the GUI. I ssh'd into openelec and manually added the settings.xml file under the resources directory after populating it with the correct ZM hostname as the code does not look handle a http error code when the hostname does not resolve.

All sorted now Smile - thanks for your help.


RE: [RELEASE] ZoneMinder CCTV Addon - eddiek2000 - 2015-02-22

Glad you got it working. I hope to learn some python and koi add-on coding to add montage view.


RE: [RELEASE] ZoneMinder CCTV Addon - c128 - 2015-03-21

(2014-12-03, 04:41)vskatusa Wrote: To view the camera this is what works for me in a browser

STEP 1
======
LOGIN using URL: http://xxx.xxx.xxx.xxx/zm with admin/pswd

VIEW CAMERA STEP 2
==================
URL:
Code:
http://xxx.xxx.xxx.xxx/zm/index.php?view=montage&group=0


I setup the zoneminder addaon as follows:

*** CONNECTION ***
SERVERNAME / IP = xxx.xxx.xxx.xxx
ZM DIRECTORY = zm
CGI DIRECTORY = left as defaults CGI-BIN

*** AUTHENTICATION ***
AUTHENTICATE : selected
USERNAME = admin
PASSWORD = pswd
HASHED AUTHENTICATION: not selected

Is my above inputs correct to mimic my browser url
Code:
http://xxx.xxx.xxx.xxx/zm/index.php?view=montage&group=0

I get message "AUTHENTICATION REQUIRED" when using the addon?? Any clue why it is not working?

I'm having exactly the same problem - although I'm using hashed authentication (and it's correctly configured).

Are any of you chaps that have this working using authentication?


RE: [RELEASE] ZoneMinder CCTV Addon - zoolii - 2015-08-06

Hi folks!

Any idea for montage view in Kodi?

Thanks ,


RE: [RELEASE] ZoneMinder CCTV Addon - d.kilshtein - 2015-10-23

i downloaded the zip file from the top (2015-02-20 13:09)
it installed fine but i am too having the authentication issue.
i checked the settings.xml file under ..\Kodi\userdata\addon_data\plugin.video.zoneminder and it looks fine (correctly reflects my settings)
so since the configuration works fine i guess it is a bug in the Python script (the script probably missing the auth=true option or the authentication string is wrong - not sure when the authentication message fires)

kodi version 14.2
OS win 7 ultimate + sp1 64bit

did anyone solved this issue?


i also tried to print out the authentication string by adding this to the listcameras() func (sorry for the syntax - never used py before Smile )

f=open(r"C:\abc.txt","w")

f.write("authurl = ")
f.write(authurl)

f.write("\n")

f.write("videoauthurl = ")
f.write(videoauthurl)

f.write("\n")

f.write("zmurl = ")
f.write(zmurl)

f.write("\n")

f.write("cgiurl = ")
f.write(cgiurl)

f.write("\n")

f.write("url = ")
f.write(url)

f.close()


got this:

authurl = &username=admin&password=xxxxx&action=login
videoauthurl = &user=admin&pass=xxxxx
zmurl = http://192.168.0.10/zm/
cgiurl = http://192.168.0.10/cgi-bin/
url = http://192.168.0.10/zm/?skin=classic&username=admin&password=xxxxx&action=login

so, everything looks fine. when i open the browser (chrome) and write this address:
http://192.168.0.10/zm/?skin=classic&username=admin&password=xxxxx&action=login

i see the ZM login screen...and all is missing is the click on the login button...
maybe the problem is with the zm configuration...

any ideas?


RE: [RELEASE] ZoneMinder CCTV Addon - d.kilshtein - 2015-10-23

from looking a little bit further at the code i found this part:

doc = gethtmlpage(url)
match = re.compile('<form name="loginForm"').findall(doc)
if len(match) > 0:
sys.stderr.write(localize(30200))
message(localize(30201), localize(30200))
__addon__.openSettings(url = sys.argv[0])
sys.exit()

again, i'm not a python expert but it looks like the function actually exits with an error if "<form name=loginForm" string found. in other words the code exits on error if a log in page appears. since the login page appears that what make the authentication fail in Kodi.
so looks like it's a mismatch between the Kodi plugin and ZM (i guess this plugin should be updated)

BTW, i'm running ZM v 1.27


RE: [RELEASE] ZoneMinder CCTV Addon - d.kilshtein - 2015-10-23

and another thing

in file default.py

in line
info["FileName"] = "%snph-zms?monitor=%s&mode=mpeg&format=avi%s%s" % (cgiurl, id, qualityurl, videoauthurl)

i needed to remove the &mode=mpeg for my camera to work
this should have been a parameter and not hard-coded. since it's a ZM configurable parameter....


RE: [RELEASE] ZoneMinder CCTV Addon - d.kilshtein - 2015-10-23

another test i made.
i ran wireshark and logged into ZM. i notice that there is another part missing from the connection url and it &view=postlogin

the whole url looks like:
http://192.168.0.10/zm/?action=login&view=postlogin&username=admin&password=xxxxx

when i type this url into my web browser, i log in with no authentication screen at all (first i see a transitional screen "logging in..." then the list of all my cameras)

i tried to add the missing part to the connection url in default.py but it catches the transitional screen and i get an error that there are o cameras (which make sense)

this is where i decided to draw the line. i guess it's after the developer of this plug in to do something to make the authentication to work...


RE: [RELEASE] ZoneMinder CCTV Addon - crashgybe - 2015-12-04

Thanks for your contribution, d.kilshtein.

I've taken your suggestions and implemented them with a few other hacks and have the plugin working on Kodi 14 and Zoneminder 1.28.1 with auth (not hashed). I haven't tested with hashed or without auth.

Basically what I've done is
1) added the "&view=postlogin" to the authurl which ensures the webserver will *not* return to the login screen if login was successful.
2) grabbed the cookies from the request (first login) which allows me to then pass these cookies to the index.php request to get the camera list without having to authorise again.
3) removed mode=mpeg from the video filename as you suggested above.

For anyone that wants to try, you can get the zip file from

https://github.com/jamoZA/plugin.video.zoneminder