Firefox and montage view - SOLVED for Linux

Support and queries relating to all previous versions of ZoneMinder
Locked
asko
Posts: 10
Joined: Tue Aug 17, 2004 4:44 pm

Firefox and montage view - SOLVED for Linux

Post by asko »

Hi, i seem to have a problem with montage view and Firefox.

I have 3 640x480@5fps cameras. Montage view ought to be 24/7 displayed on client machine.

ZM v1.21.3 is running fine modect on the server, but the client machine shows images for usually half a day, then the image hangs, cameras freeze or disappear one at a time.

Closing montage window and reopening it helps for another 4-10 hours or so.
Client machine is Celeron 1200 512 MB RAM, SUSE 9.2.


And, Yes, i have set:
browser.cache.check_doc_frequency 3 -> 1
browser.cache.disk.enable True -> False
browser.cache.memory.enable -> False
network.http.use-cache -> False
network.http.max-connections-per-server -> 100
network.http.max-persistent-connections-per-proxy -> 100
network.http.max-persistent-connections-per-server -> 100

And also, ZM settings have "ZM_RAND_STREAM" enabled..

Please help, I'm tired of reopening Firefox windows all the time.. Has anyone got a solution for stable montage view? I think that IE with Cambozola didn't have that issue, but JAVA is so slooww :lol: . Client machine is fully occupied even with firefox JPEG streaming.

Please share your finer setup knowledge ;-) How do you view your cameras ?
Last edited by asko on Thu Oct 27, 2005 6:52 am, edited 1 time in total.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

this is an issue, firefox cannot run for extened periods. here has been talk of closing and reoping montage automatically every 4 hours or so but how you would do his i dont know. Is the client windows or linux
asko
Posts: 10
Joined: Tue Aug 17, 2004 4:44 pm

Post by asko »

thank you for your answer, the client is currently SUSE Linux 9.2 .. But it doesn't have to be, would IE & Cambozola work better?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

NO lol
i would assume that ie would be worse, but i havnt done any real tests on it. DO you know how to open montage using the command line, and how to kill all instances of firefox from the command line. If so then you could say every 4 hours close firefox and open it again.

James
asko
Posts: 10
Joined: Tue Aug 17, 2004 4:44 pm

Post by asko »

What about adding this script to the montage page? It sleeps 30 minutes and then reloads the URL..

<script language="Javascript">

var URL = "zm/index.php?view=montage&group=0"
var delaysecs = 1800
var timeconstant = 1000


function reload() {
location = URL
}

setTimeout("reload()", delaysecs*timeconstant);
</script>

OR

<META HTTP-EQUIV="Refresh"
CONTENT="1800; URL=zm/index.php?view=montage&group=0">

to the zm_html_view_montage HTML header?

I would test it, but i don't have access to proper test environment right now.. Maybe someone would do it?

for Linux, i have a shell script:

#!/bin/bash

ZMHOST="192.168.1.10"
ZMUSER="usr"
ZMPASSWORD="passwd"
ZMREFRESHTIME="1800"

while true; do
killall mozilla-bin
# log in
mozilla "http://$ZMHOST/zm/index.php?username=$ZMUSER&password=$ZMPASSWORD&action=login" &
sleep 10
# open montage
#mozilla -height 1024 -width 768 http://$ZMHOST/zm/index.php?view=montage&group=0 &
mozilla -remote "openURL(http://$ZMHOST/zm/index.php?view=montage&group=0)"
# sleep for half an hour
sleep $ZMREFRESHTIME
done

problem is that mozilla doesn't open the montage window full screen, and somewhy -height and -width command line parameters dont help.. so that's not a full solution yet, but getting closer :wink:
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

looks good but i cant kill mozilla.
I have run your script after changing

mozilla "http://$ZMHOST/zm/index.php?username=$ZMUSER&password=$ZMPASSWORD&action=login" &
sleep 10

to

mozilla-firefox "http://$ZMHOST/zm/index.php?username=$ZMUSER&password=$ZMPASSWORD&action=login" &
sleep 10

and other mozilla's as appropite but i cant work out how to kill the previous firefoxes, any clue?

On the full screen issue i assume phil has put in the php bit somewhere what size to make the window, as it resizes depends on the number of monitors. There must be a way to make it open full screen. I have had a look at montage php and its a bit over me but it gave me an idea. Maybe one for a sperate thread.

Your right though looking good, i like.

James

edit** on googling i found
mozilla -remote "openURL(www.mozilla.org, new-tab)"
Which doesnt help but io noticed the new-tab at the end, as there is a way to make it do a new tab can you passthe option to display a full screen mozilla windows without taskbar etc. , just wondering

**another edit. HAve found out that the full screen thing is doen by kwin. I assume this command can be added to the script but i cant find a list of cammand line option for kwin anywhere. Also i assume this will only work in a kde desktop so im not sure if this is a great idea (i dont mind but i bet others would)
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

got it

Modify zm_html_view_montage.php
add

Code: Select all

<script type="text/javascript">
window.onload = function() {
	window.moveTo(0, 0);
	window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
under <!DOCTYPE blah
<html>
insert above code here
<title><....

James

BTW killall mozilla-firefox-bin did the trick on killing it
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I added this as an autostart script. All seems cool. So 2 questions now


1 can i make cron run the script and tell it to use a desktop to load mozilla.

2 would a regular say every hour or 3 hours etc that just runs the script to close all firefox and open again, cos if the script fails it wont work will it but if cron runs it every hour etc if it misses one it dont matter?

James
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i have found this
http://www.mozdevgroup.com/clients/bm/

But cant getit to login automatically, you seem a better man than me so i thought you might like to take a look. All we really need it to do is go f11 full screen not really kiosk but its the best i can find

I did find an exe for windows that could send keys after loading firefox but obviously no good for linux.

WHat i ahve done on my linux server is set the taskbar so windows load over it, but it could be better press f11 it looks great, a few icons ther to bring console up, change split view/monitor selection etc but i digress. Think we took this one as far as it will go.

James
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi.


I have this issue working. search the autohide extension of firefox, then you could do firefox --full-screen

Victor Diago
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

excellent so if i pass --full-screen in the command line it will open full?

James
asko
Posts: 10
Joined: Tue Aug 17, 2004 4:44 pm

working solution

Post by asko »

Hi,

I finally have a solution that works, atleast for me..

Client machine is running following script: http://asko.ultrasoft.ee/shared/ZoneMinder/zmview.sh

firefox settings:

Code: Select all

browser.cache.check_doc_frequency 3 -> 1
browser.cache.disk.enable True -> False
browser.cache.memory.enable -> False
network.http.use-cache -> False
network.http.max-connections-per-server -> 100
network.http.max-persistent-connections-per-proxy -> 100
network.http.max-persistent-connections-per-server -> 100

Modify zm_html_view_montage.php, as was james wrote before (thanks!!):
add

Code: Select all

<script type="text/javascript">
window.onload = function() {
   window.moveTo(0, 0);
   window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
Montage has been working for me without user intervention for 1,5 days now..
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi man

is it still working ? how much cameras ? any other problem ?

thanks for now.

victor diago
asko
Posts: 10
Joined: Tue Aug 17, 2004 4:44 pm

Post by asko »

Hi victor,

yes it still works.. I'm running 3 Axis cameras at 640x480@5 fps and it seems to be OK. Btw, i'm running firefox 1.06, maybe the newest firefox 1.5 resolves these issues? Has anyone tried it?

--
asko
gola10
Posts: 150
Joined: Wed Nov 01, 2006 3:16 pm
Location: Panama

Firefox freeze need to reload it

Post by gola10 »

I am using Zoneminder installed from the mandriva 2006 livecd. The system is running 7/24 and the problem is that Montage under firefox freeze after a while. Manually stop and restart of firefox solve the problem. Here, there is reference to a bash script that stop and start firefox after 1800 second. i has modified the sleep time from 1800 to 100 so i do not has to wait so long to see if it works. I has tried it from a console. Firefox is inmediatelly stopped and then restarted but the loop does not seems to work because after 100 seconds (or more) it does not stop and restart firefox anymore. On the console the script seems to be active but nothing else happend.

What am i doing wrong. Where should this script be run from?
Locked