Solved: Watch window not displaying events

Forum for questions and support relating to the 1.24.x releases only.
Locked
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Solved: Watch window not displaying events

Post by chippy »

I have just upgraded to v1.24.3 and everything is working ok apart from the watch window which is not displaying events below the live image. Also the FPS never updates and remains blank. In montage view the FPS does update and shows when an alarm has occurred. Hardware is AMD 64 running on Ubuntu server 11.04. Have checked all log files and can see no errors. I would be grateful of any suggestions as to how to track down what the problem is.

thanks, John
Last edited by chippy on Thu May 19, 2011 5:32 am, edited 1 time in total.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Watch window not displaying events

Post by zoneminder »

If you are running FireFox can you check with FireBug and see if you are getting any javascript errors. It would also help to show if the ajax messages are being sent and received correctly.
Phil
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Re: Watch window not displaying events

Post by chippy »

Thanks for the reply, I enabled the console in Firefox and I get 2 errors when I open the watch window.
First one is a syntax error in index.php?view=watch&mid=1 on line130 "var appletRefreshTime = ;".

Second one which I think is the problem is in zm/skins/classic/views/js/watch.js error reads "STATE_IDLE is not defined" on line 46 which reads "var alarmState = STATE_IDLE;"
Anyone got any ideas where STATE_IDLE should be getting defined ?
graphicw
Posts: 34
Joined: Thu May 19, 2011 12:57 am

Re: Watch window not displaying events

Post by graphicw »

I am also having the same problem and getting the syntax error and STATE_IDLE is not defined. Seems to be watch.js that is at fault as well. Montage view works as it should showing the state and the video fps.
tommy
Posts: 45
Joined: Sun Aug 17, 2003 2:58 am

Re: Watch window not displaying events

Post by tommy »

I have had this same problem since using the svn. It seems that the initial database creation script is setting an empty string for several values.
Any boolean value with a default of "yes" is being assigned 1, any default of "no" is being left empty. This results in syntax errors in some of the java scripts. The Cambozola reload value is also left empty. Setting it to any value, even 0, results in the proper execution of the java scripts. I have been going directly into the database using MYSQL Browser and assigning values to every option. The Watch window then comes up with the events listed, Force Alarm available, etc.
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Re: Watch window not displaying events

Post by chippy »

I have looked in the Config table in the zm database and could not find any boolean fields that did not have a value set. Is this the table you are referring to ?
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Re: Watch window not displaying events

Post by chippy »

Solved:
You need to put a value into RELOAD_CAMBOZOLA (I put 300) which is in Options under the images tag. Then all should work ok
tommy
Posts: 45
Joined: Sun Aug 17, 2003 2:58 am

Re: Solved: Watch window not displaying events

Post by tommy »

Here is an excerpt from the zm_create.sql script after running ./configure.

insert into Config set Id = 115, Name = 'ZM_OPT_CONTROL', Value = '', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', .........
insert into Config set Id = 116, Name = 'ZM_OPT_TRIGGERS', Value = '', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', .................
insert into Config set Id = 117, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))',............
insert into Config set Id = 118, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)',..............
insert into Config set Id = 127, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))',...................

Anything with a default value of yes has an actual value of 1. Anything with a default value of no has an actual value unset. This results in syntax errors in the java scripts.
If you have checked in Options that Cambozola is installed, the script loads the refresh value from the config table. If it is empty, a syntax error results. This happens whether or not your browser is actually using Cambozola. Are you really using Cambozola with FireFox?

The defaults may be corrected if you have made any changes to the Config through the Zoneminder Options panels. The scripts for updating the Config might be different than the create database scripts.
graphicw
Posts: 34
Joined: Thu May 19, 2011 12:57 am

Re: Solved: Watch window not displaying events

Post by graphicw »

I needed to change the RELOAD_CAMBOZOLA to a number to fix the problem in my case just as chippy noted. The 0 and 1 Boolean entries were all in place on the database, however, I used the SVN after the official release of 1.24.3 and it is likely that the Boolean entry issue was fixed on the release. Over all not a major bug and will be and easy fix in the svn by placing a 0 in the RELOAD_CAMBOZOLA field.
DREMA
Posts: 162
Joined: Fri Dec 12, 2008 2:39 am
Location: México

Re: Solved: Watch window not displaying events

Post by DREMA »

Awesome! Was looking to fix this error too, thanks a lot.

Is the svn the same as the current release ??
Just... enjoy life! :D
graphicw
Posts: 34
Joined: Thu May 19, 2011 12:57 am

Re: Solved: Watch window not displaying events

Post by graphicw »

Yes.
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Re: Solved: Watch window not displaying events

Post by chippy »

Hi, credit must go to Tommy for resolving this. Many thanks Tommy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Solved: Watch window not displaying events

Post by zoneminder »

I have tracked this down to a problem in zmconfgen.pl. If you can't wait for an official fix then you can apply this patch yourself

Code: Select all

Index: zmconfgen.pl.in
===================================================================
--- zmconfgen.pl.in     (revision 3343)
+++ zmconfgen.pl.in     (working copy)
@@ -184,7 +184,7 @@
 sub addSlashes
 {
        my $string = shift;
-    return( "" ) unless $string;
+    return( "" ) if ( !defined($string) );
        $string =~ s|(['"])|\\$1|g;
        return( $string );
 }
and then you will have to rerun configure and make. However while this will fix the db creation script and so any new databases created will be fine, it will not fix existing ones. To do that I think it's just a case of running the following SQL in the mysql cli tool

Code: Select all

update Config set Value = 0 where Type = 'boolean' and Value = '';
and then you should be set.
Phil
Locked