Mobile devices

Forum for questions and support relating to the 1.24.x releases only.
Locked
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Mobile devices

Post by c0mputerking »

Hello all i have an HTC Touch ( old i know but can't afford upgrade yet ) it uses Windows Mobile 6 Professional CE OS 5.2.1620 and some kind of mobile window internet explorer. I can login to zoneminder but after entering my username and password i just get ZoneMinder Login Logging In page, but no console page. I do remember at least being able to login and get stills on this phone with zm 1.23.3.

I have read about a few ways to get your phone working here on the forums but i figured i would like to try and login to the console page first.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

try

http:/example.com/zm/index.php?format=xhtml
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Post by c0mputerking »

Thanks for the quick reply following your advice i accidentally removed the index.php part and had http://my.site.net/ and now i have the console. However when i montage i get only fps no images same for individual cameras get the dvr style buttons but no live image and no events being listed.

PS there used to be a stills button in 1.23.3 right? it is gone now for 1.24.1?

I tried checking off the stream or stills button in the low bandwidth tab thinking that if i login and use low bandwidth i will get stills but still nothing for images on my screen. I do get the jpeg if i enter the events part of the console.
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Re: Mobile devices

Post by deads »

Try using

http://my.site.net/index.php?skin=mobile

That will set up the mobile view.

Works great on my Nokia 81

You can also set it up so that the web server automatically detects a mobile and invokes the skin auto magically.

Just add the following to your httpd.conf file and restart your Apache server
# This is a rewrite rule which redirects a Symbian phone to the mobile profile
# All it does is rewrite the URL to append ?skin=mobile to the end of the url if is sees Symbian in the user agent string.
# to see your user agent string enable logging at level 9 and grep the rewrite.log file
# The REQUEST URI is there so that it ONLY rewrites the url when there is nothing but /index.php in the url
<<<<<<<<<<<<< CUT HERE >>>>>>>>>>>>>>>>>>>>>
RewriteLog logs/rewrite.log
RewriteLogLevel 0
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} .*Symbian.*
RewriteCond %{REQUEST_URI} .=index.php$
RewriteRule /index\.php$ /index.php?skin=mobile [L]
<<<<<<<<<<<<<<< CUT HERE >>>>>>>>>>>>>>>>>>>>

steved
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Post by c0mputerking »

Using index.php?skin=mobile helps and gets me into the console however when i try to view a camera i get status idle = 5.15 fps which is good but instead of the picture i just get a big red X.

This is good a big red X is better than nothing i like progress heehee however having problems with the apache config too.

Also fot the automagic part i have used .*HTC-Touch*. and it looks like i got a match, but i am not seeing a mobile skin match and it is not working.

209.167.5.74 - - [31/Mar/2009:23:49:44 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (2) init rewrite engine with requested uri /index.php
209.167.5.74 - - [31/Mar/2009:23:49:44 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (3) applying pattern '/index\.php$' to uri '/index.php'
209.167.5.74 - - [31/Mar/2009:23:49:44 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (4) RewriteCond: input='HTC-Touch/Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.6) UP.Link/6.5.1.0.0' pattern='.*HTC-Touch.*' => matched
209.167.5.74 - - [31/Mar/2009:23:49:44 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (4) RewriteCond: input='/index.php' pattern='=index.php$' => not-matched
209.167.5.74 - - [31/Mar/2009:23:49:44 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (1) pass through /index.php
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (2) init rewrite engine with requested uri /tools/mootools/mootools.js
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (3) applying pattern '/index\.php$' to uri '/tools/mootools/mootools.js'
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (1) pass through /tools/mootools/mootools.js
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (2) init rewrite engine with requested uri /js/mootools.ext.js
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (3) applying pattern '/index\.php$' to uri '/js/mootools.ext.js'
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (1) pass through /js/mootools.ext.js
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (2) init rewrite engine with requested uri /skins/classic/css/skin.css
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (3) applying pattern '/index\.php$' to uri '/skins/classic/css/skin.css'
192.168.1.1 - - [31/Mar/2009:23:49:47 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9829ef8/initial] (1) pass through /skins/classic/css/skin.css
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (2) init rewrite engine with requested uri /skins/classic/js/skin.js
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (3) applying pattern '/index\.php$' to uri '/skins/classic/js/skin.js'
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (1) pass through /skins/classic/js/skin.js
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (2) init rewrite engine with requested uri /skins/classic/views/js/postlogin.js
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (3) applying pattern '/index\.php$' to uri '/skins/classic/views/js/postlogin.js'
192.168.1.1 - - [31/Mar/2009:23:49:48 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#982df08/initial] (1) pass through /skins/classic/views/js/postlogin.js
209.167.5.74 - - [31/Mar/2009:23:49:49 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (2) init rewrite engine with requested uri /css/reset.css
209.167.5.74 - - [31/Mar/2009:23:49:49 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (3) applying pattern '/index\.php$' to uri '/css/reset.css'
209.167.5.74 - - [31/Mar/2009:23:49:49 --0600] [1.surveillanceking.net/sid#95e0fa0][rid#9831f18/initial] (1) pass through /css/reset.css
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

If you use ?skin=mobile on the initial page then the skin should be stored in a cookie and you should not need it specified on subsequent pages as it will be remembered. Can you check whether the cookie has been stored?
Phil
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Post by deads »

[quote="zoneminder"]If you use ?skin=mobile on the initial page then the skin should be stored in a cookie

Yes I agree phil, But my aim it to just enter the base url and have the server make the decision for me. (My fingers are too big for the phone buttons -:)


Modified httpd.conf conf below the first cut was buggy ( Hopefully this will work ok)

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} .*Symbian.*
RewriteCond %{REQUEST_URI} index\.php$ @
RewriteCond %{QUERY_STRING} !.
RewriteRule /index\.php$ /index.php?skin=mobile [L]
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Post by deads »

[quote="c0mputerking"]

Also fot the automagic part i have used .*HTC-Touch*. and it looks like i got a match, but i am not seeing a mobile skin match and it is not working.

<1> Ive updated the rewritecond - See new post.

<2> Im just using the standard mobile skin supplied by phil -- Works fine on the nokia dunno about the HTC -- Maybe you need to build a skin for it.
see the /zm/skins/ directory.

Steved
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Post by c0mputerking »

Your new conf.file does will not load in my apache could you double check? I'm to tired right now to check the logs gotta get some sleep
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Post by deads »

[quote="c0mputerking"]Your new conf.file does will not load in my apache

Just cut & Paste the 5 lines into you existing httpd.conf (In the globals section unless you using virtual servers and in that case in the virtual server section

Steved
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Post by c0mputerking »

Sorry i added your five lines to /etc/httpd/conf/extra/httpd-mobile.conf, and added an include line in /etc/httpd/conf/http.d. With your first config entries apache would restart, but with the new entry apache will not start up.

Nothing is output to the apache_error apache_access or the rewrite.log not sure what need to be fixed.
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Post by deads »

c0mputerking wrote: Nothing is output to the apache.
Ok Lets start again from scratch.

Intro:

Rather than having to define which skin you want every time you connect to your Zoneminder server you can have Apache do it for you by using the mod_rewrite module that lives in apache

THE ONLY MODIFICATIONS THAT YOU NEED TO DO ARE IN HTTPD.CONF, which in my centos system lives in:

/etc/httpd/conf/httpd.conf


so.. Open httpd.conf in an editor - i.e. vi /etc/httpd/conf/httpd.conf

Ensure that the following line exists
LoadModule rewrite_module modules/mod_rewrite.so
If its not there of commented out enable it.

ADD the following lines to the httpd.conf

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} .*Symbian.*
RewriteCond %{REQUEST_URI} index\.php$
RewriteCond %{QUERY_STRING} !.
RewriteRule /index\.php$ /index.php?skin=mobile [L]

Note: Symbian is used to identify a nokia Symbian browser -- Change this to a unique matching string from the HTTP_USER_AGENT that your phone puts out.

to debug the Rewrite engine ADD

RewriteLog logs/rewrite.log
RewriteLogLevel 9

You will find the log in /var/logs/httpd/rewrite.log

restart your httpd server

service httpd stop
service httpd start

Now when you send the following URL to the server, apache will rewrite the url when the URL matches all the conditions.
i.e.
http://my.server.com/index.php

Apache will only rewrite the URL when it sees index.php. If the url you are sending includes anything behind index.php i.e.

http://my.server.com/index.php?view=watch&mid=3

then it will just drop straight through.


Ive now had this working flawlessly for 2 days and it works fine. Ill post updated files when I add functionallity

regards

Steved
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

I also have a HTC device with windows mobile 6 - IE and opera installed.
Is there any way of streaming video to these devices or is it just stills? I only ever managed stills in the past.

Cheers
c0mputerking
Posts: 190
Joined: Tue Sep 16, 2008 5:22 am

Post by c0mputerking »

Thank you very much deads for your time and detailed post, yipee I got it working. It was the @ symbol after index.php @ in one of your first posts that was my hangup. Removing the @ symbol at the end of that line made apache happy again. You may want to edit your post so other don't get confused as i did.

A couple of questions this should be streaming on my phone right? What i mean to say it that zoneminder should be sending a stream to my phone right? Is it my HTC that is only picking up one image ( ie software on the HTC ) or is it the skin that only sends one image
deads
Posts: 7
Joined: Thu Jun 28, 2007 5:34 am

Post by deads »

[quote="c0mputerking"]Thank you very much deads
A couple of questions this should be streaming on my phone right?

Um No, The mobile profile is not a streaming profile, It just sends a snapshot

But it will refresh if you click on the image.

To get it to stream, you will need to modify the mobile skin files

/var/www/html/zm/skins/mobile.

Maybe phil could offer some hints or point us to some documentation on how the skins files are structured :-)
regards

Steved
Locked