eyezm on iPhone broken after Zoneminder upgrade to 1.27

Forum for questions and support relating to the 1.27.x releases only.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

This morning I've updated my Zoneminder running on Ubuntu to v1.27. After that the eyezm app on my iPhone stopped working.
Anyone experiencing this issue as well?

On the zoneminder checklist there is also no check box ticked, to confirm eyezm testing. The request is received as normal on the zoneminder server, which also serves the XML content towards the iPhone app. I assume that the XML answer is changed and the iPhone app doesn't gets the new information.

Regards,
Ferry
User avatar
elfking
Posts: 35
Joined: Tue Mar 14, 2006 2:48 am
Location: Sonoma, California

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by elfking »

This also does not work for me after upgrading to 1.27
iitywygms
Posts: 123
Joined: Thu Nov 08, 2012 5:19 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by iitywygms »

No help, just wanted to add the I use ZmView for android and it takes much longer to load now. 45 seconds compared to 1 or 2 before.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

Indeed does ZMview work for me as well, and also noticed the longer load time.

I use eyeZM on the iPhone which is version 1.3, where online I see that there is also v1.4 (HD) for iPad.
Anyone using the iPad app, and does that work?

Grtz
windracer
Posts: 61
Joined: Sat Jul 23, 2011 1:15 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by windracer »

Hmmm, sure enough eyeZM is not working for me either after upgrading. I thought I had used it since upgrading, but once I saw this thread I re-checked and am getting the "invalid server authentication credentials" error. I can't find anything in the log that would indicate what's going on.

Zm View still works on my Samsung Galaxy Note 10.1.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

I just dropped an e-mail at the creator of eyeZM as a notification. When I've received an answer, I will share it on the forum. :idea:
windracer
Posts: 61
Joined: Sat Jul 23, 2011 1:15 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by windracer »

Good luck with that ... I've tried contacting them in the past and never heard back. The web site hasn't been updated since 2011 and still talks about how great v2.0 is going to be.
windracer
Posts: 61
Joined: Sat Jul 23, 2011 1:15 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by windracer »

Here's what I found in the eyeZM log:

Code: Select all

2014-03-22 15:48:39.311 eyeZm[4910:707] eyeZm Build 1.3.668 (1.3)
2014-03-22 15:48:39.323 eyeZm[4910:707] Device windracer's iPhone is an iPhone, iPhone OS v7.0.6
2014-03-22 15:48:40.135 eyeZm[4910:707] XML Parser Error: XML Parser Error 4, Page is Empty. Check that XML plugin is installed correctly
2014-03-22 15:48:40.139 eyeZm[4910:707] Could not parse server Home, error reason: Invalid server authentication credentials
Looking in my apache access.log, I can see eyeZM attempting to connect:

Code: Select all

"GET /zm/?skin=xml&protoVer=2&action=login&username=xxxxx&password=xxxxx&numEvents=10 HTTP/1.1" 200 347 "-" "eyeZm/1.3.668 CFNetwork/672.0.8 Darwin/14.0.0"
If I put that URL into my browser, I get valid XML back from ZoneMinder, but maybe something in 1.27's format has changed so eyeZM is not expecting something that's different? Strange that the Android app would work just fine, though, if it was a major XML change.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

Hi Windracer,

Just took a pcap to see what XML is actually past from Zoneminder towards the eyeZM app. This was interesting, as the app doesn't get the actual XML as what you get when pointing a regular browser to specific URL. See the information below, which was captured within Wireshark (actually tshark from command line)

Code: Select all

GET /zm/?skin=xml&protoVer=2&action=login&username=xxxxxx&password=xxxxxx&numEvents=10 HTTP/1.1
Host: xxxxxxxx
Accept-Encoding: gzip, deflate
Accept: */*
Cookie: zmSkin=xml; ZMSESSID=05gc5q4fie7uiq2r13crrt37j2
Connection: keep-alive
Accept-Language: en-us
User-Agent: eyeZm/1.3.668 CFNetwork/672.1.13 Darwin/14.0.0

HTTP/1.1 200 OK
Date: Sat, 22 Mar 2014 20:59:42 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.10
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: zmSkin=xml
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 33
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

............+K..LQ..O.....".|       <===== This doesn't looks like the XML as what you get when pasting the URL into a browser.
Next to that I get "Invalid login" messages in desktop Chrome browser when playing around with it, which I only can rid of when clearing the browser cache or specifying ?skin=classic in the URL.

Looks like Zoneminder fails rather than the eyeZM app.
windracer
Posts: 61
Joined: Sat Jul 23, 2011 1:15 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by windracer »

Interesting find, stealthty! That would explain why the Android app still works.

Maybe knnniggett can shed some light on this for us ...
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

The reason the Android ZM View app still works, is that it queries a different URL.

Code: Select all

"GET /zm/index.php?skin=mobile&username=xxxxx&password=xxxxxxx&action=login HTTP/1.1" 200 5380 "-" "Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I9100 Build/JRO03H)"
"GET /zm/index.php?skin=mobile&view=watch&mid=2&username=xxxxx&password=xxxxxxx&action=login HTTP/1.1" 200 3190 "-" "Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I9100 Build/JRO03H)"
"GET /cgi-bin/nph-zms?mode=single&monitor=2&scale=100&maxfps=15&buffer=1000&auth=xxxxxxxkeyxxxxxxx HTTP/1.1" 200 131876 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)"
"GET /cgi-bin/nph-zms?mode=single&monitor=1&scale=100&maxfps=15&buffer=1000&auth=xxxxxxxkeyxxxxxxx HTTP/1.1" 200 113199 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)"
"GET /cgi-bin/nph-zms?mode=single&monitor=3&scale=100&maxfps=15&buffer=1000&auth=xxxxxxxkeyxxxxxxx HTTP/1.1" 200 186111 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)"
It doesn't call the XML skin, but the mobile skin and therefore they work different. My gut feel tells me that it has to do something with the way authentication in combination with the XML skin. Maybe it is introduced through the add-on for the new "flat" skin.

In the release notes from 1.24 I find a skin named "eyeZM". Could anyone with a pre-v1.27 have a look which skins are available, as the eyeZM app call's for the XML skin and Zoneminder seems to have/had a EyeZM skin as well?
Release 1.24.3 - 2011/05/16
Long delayed point release. Brought up-to-date to work with new versions of ffmpeg etc. A number of new features are included and several important bugfixes. A new contributed iPhone skin is also included.

FEATURE - Added contributed iPhone interface (thanks to user Jai Dhar). Use skin 'EyeZM' to try
Hopefully that at one of the Zoneminder coders a pop-up pop's up, that explains the changed behavior.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

I just got the eyeZM app working again.

The problem is authentication related. If you turn off authentication (disable OPT_USE_AUTH - Authenticate user logins to ZoneMinder) in the option section, the eyeZM app starts working again. As my Zoneminder is internet connected, I don't want to leave it open unauthenticated.... :? :roll:

Now trying to figure out what changed in the authentication part...

What I noticed is that the autorisation of the user lists "Monitor" twice, of which the second "Monitor" is left blank.
This seems an error to me.
User avatar
stealthty
Posts: 10
Joined: Fri Mar 21, 2014 5:34 pm

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by stealthty »

Oke I found out that the XML skin.php file was not altered, where those of classic, flat and mobile were altered.

Just made changes to the file /usr/share/zoneminder/skins/xml/skin.php like they are done in the file /usr/share/zoneminder/skins/flat/skin.php.
After that I was able to use the iphone eyeZM app again :D :D :D (joehoe)

Changes I made are outlined below

Code: Select all

if ( empty($view) )
   $view = 'console';

Changed this into

if ( empty($view) )
   $view = isset($user)?'console':'login';


and 

if ( !isset($user) && ZM_OPT_USE_AUTH )
{
	echo "Invalid Login";
	exit;
}

Changed this into

if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']
) )
{
     $view = "postlogin";
     $action = "login";
     $_REQUEST['username'] = $_SERVER['REMOTE_USER'];
}
Check it out and please feedback of this works for you as well.
Last edited by stealthty on Sun Mar 23, 2014 5:00 pm, edited 2 times in total.
windracer
Posts: 61
Joined: Sat Jul 23, 2011 1:15 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by windracer »

Nice work, stealthty! That fix to skin.php worked for me as well. 8)
iitywygms
Posts: 123
Joined: Thu Nov 08, 2012 5:19 am

Re: eyezm on iPhone broken after Zoneminder upgrade to 1.27

Post by iitywygms »

ZmView worked much slower on 1.27 for me.
The above fix returned my ZmView back to normal.
Thank you for the fix.
Locked