Adding new control settings

Forum for questions and support relating to the 1.24.x releases only.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Adding new control settings

Post by foxtroop11 »

The person that got the Orbit sphere working with the older uvc streamer is helping me gain control of the Orbit with the newer mjpg_streamer within zoneminder. I thought this would be somewhat easy but I'm beginning to think there is something wrong with either 1.24 or the way I installed it.

I can see the feed from the Orbit inside 1.24 no problem. If I click on the cam, then click control that is where the problems start. I've dropped a test file the person sent me in the folder along with Visca.pm and such and restarted Zoneminder.

Now, if I click control type edit button it brings up another window where I select add new. So far so good, I fill out the first tab called main. I give it a name, select remote and input mjpg_streamer for the protocl since I named the file mjpg_streamer.pm. Now, no matter what I do, if I click save right then and there or go onto the next tab and select some options and click save, it dumps the last pages settings. So I can get it to keep the name and protcol, and it will save the next tab if I tell it it can move, but If I go to the next tab for tilt and pan it dumps the option I selected in the last tab for it to move.

edit: I can go in to phpmyadmin under zm and manually put 1 instead of 0 next to some of the options, and the change will stick. As soon as I use the web interface it doesn't seem to work.
Last edited by foxtroop11 on Mon Jan 12, 2009 8:25 am, edited 3 times in total.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

I just did another test install of zoneminder 1.23.3 from a deb package. That version has no issue's what so ever adding a new control device or parameter and saving it.
Last edited by foxtroop11 on Mon Jan 12, 2009 8:26 am, edited 1 time in total.
dedmeet
Posts: 21
Joined: Sat Sep 08, 2007 9:38 pm
Location: Australia

Re: Adding new control settings

Post by dedmeet »

I have also found this issue in 1.24.

The only way to get the settings for a new control to be done is to manipulate the db directly.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

Atleast I'm not the only one :)

I just find it strange that we are the only two people with this problem out of all the other people trying 1.24. I'm not sure what your using for your install base, but I'm using Kubuntu 8.04 and I went back and recompiled after installing, ah I forgot the name, libcpr3-dev maybe? This removed the warning while running the ./configure where it said something about May not be able to control network camera's. I also made sure I installed all the perl modules that it said was missing, like the X10 support, email support, and a couple others.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

I installed the newest build and this bug is still there. I find it hard to beleive only two people are having this issue. So no one else notices that when you try and add a new Camera control the settings are not saved per page? Honestly the only way you can setup a new Control entry is using phpmyadmin or something similar to directly edit the database, otherwise you cannot save any entries other then the first page of adding a new control.
nuck
Posts: 148
Joined: Tue Nov 11, 2008 1:43 am
Location: Canada

Post by nuck »

foxtroop11 wrote:I installed the newest build and this bug is still there. I find it hard to beleive only two people are having this issue. So no one else notices that when you try and add a new Camera control the settings are not saved per page? Honestly the only way you can setup a new Control entry is using phpmyadmin or something similar to directly edit the database, otherwise you cannot save any entries other then the first page of adding a new control.
No, I've seen it too. Setting up monitors isn't the only place these sorts of glitches are happening. Keep in mind afterall that 1.24 is still in development.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

Understood, just wanted to make sure it wasn't over looked. No one else was saying anything so I was beginning to think it was a mistake in how I installed it.
nuck
Posts: 148
Joined: Tue Nov 11, 2008 1:43 am
Location: Canada

Post by nuck »

foxtroop11 wrote:No one else was saying anything so I was beginning to think it was a mistake in how I installed it.
No, it's not just you. :mrgreen:
http://www.zoneminder.com/forums/viewto ... 4&start=45
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I have verified the problem and yes it does exist. There are no errors on the page so I assume that only the arrays for the current tab are loaded but when it saves it try's to save all the data from all the tabs even though it only has one tabs array or it try's to reload the array from the database, either case the array is not behaving properly.

I'll see if I can sort it out. Likely just need to move the call for data in the script.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

Cool, atleast it's not an install error. I just used phpmyadmin to get around it all and edit what I needed manually.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I am looking at this issue now,
Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

:D Good because I'm not finding this one.
Settings for the checkboxs get lost between switching tabs.
Seems like the other values are okay :?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Try the latest RC (2734) or apply the patch below

Code: Select all

Index: web/skins/classic/views/controlcap.php
===================================================================
--- web/skins/classic/views/controlcap.php	(revision 2720)
+++ web/skins/classic/views/controlcap.php	(working copy)
@@ -40,118 +40,122 @@
 else
     $tab = "main";
 
-if ( !empty($_REQUEST['cid']) )
+if ( isset( $_REQUEST['newControl'] ) )
 {
-    $control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
+    $newControl = $_REQUEST['newControl'];
 }
 else
 {
-    $control = array(
-        'Name' => $SLANG['New'],
-        'Type' => "Local",
-        'Protocol' => "",
-        'CanWake' => "",
-        'CanSleep' => "",
-        'CanReset' => "",
-        'CanMove' => "",
-        'CanMoveDiag' => "",
-        'CanMoveMap' => "",
-        'CanMoveAbs' => "",
-        'CanMoveRel' => "",
-        'CanMoveCon' => "",
-        'CanPan' => "",
-        'MinPanRange' => "",
-        'MaxPanRange' => "",
-        'MinPanStep' => "",
-        'MaxPanStep' => "",
-        'HasPanSpeed' => "",
-        'MinPanSpeed' => "",
-        'MaxPanSpeed' => "",
-        'HasTurboPan' => "",
-        'TurboPanSpeed' => "",
-        'CanTilt' => "",
-        'MinTiltRange' => "",
-        'MaxTiltRange' => "",
-        'MinTiltStep' => "",
-        'MaxTiltStep' => "",
-        'HasTiltSpeed' => "",
-        'MinTiltSpeed' => "",
-        'MaxTiltSpeed' => "",
-        'HasTurboTilt' => "",
-        'TurboTiltSpeed' => "",
-        'CanZoom' => "",
-        'CanZoomAbs' => "",
-        'CanZoomRel' => "",
-        'CanZoomCon' => "",
-        'MinZoomRange' => "",
-        'MaxZoomRange' => "",
-        'MinZoomStep' => "",
-        'MaxZoomStep' => "",
-        'HasZoomSpeed' => "",
-        'MinZoomSpeed' => "",
-        'MaxZoomSpeed' => "",
-        'CanFocus' => "",
-        'CanAutoFocus' => "",
-        'CanFocusAbs' => "",
-        'CanFocusRel' => "",
-        'CanFocusCon' => "",
-        'MinFocusRange' => "",
-        'MaxFocusRange' => "",
-        'MinFocusStep' => "",
-        'MaxFocusStep' => "",
-        'HasFocusSpeed' => "",
-        'MinFocusSpeed' => "",
-        'MaxFocusSpeed' => "",
-        'CanIris' => "",
-        'CanAutoIris' => "",
-        'CanIrisAbs' => "",
-        'CanIrisRel' => "",
-        'CanIrisCon' => "",
-        'MinIrisRange' => "",
-        'MaxIrisRange' => "",
-        'MinIrisStep' => "",
-        'MaxIrisStep' => "",
-        'HasIrisSpeed' => "",
-        'MinIrisSpeed' => "",
-        'MaxIrisSpeed' => "",
-        'CanGain' => "",
-        'CanAutoGain' => "",
-        'CanGainAbs' => "",
-        'CanGainRel' => "",
-        'CanGainCon' => "",
-        'MinGainRange' => "",
-        'MaxGainRange' => "",
-        'MinGainStep' => "",
-        'MaxGainStep' => "",
-        'HasGainSpeed' => "",
-        'MinGainSpeed' => "",
-        'MaxGainSpeed' => "",
-        'CanWhite' => "",
-        'CanAutoWhite' => "",
-        'CanWhiteAbs' => "",
-        'CanWhiteRel' => "",
-        'CanWhiteCon' => "",
-        'MinWhiteRange' => "",
-        'MaxWhiteRange' => "",
-        'MinWhiteStep' => "",
-        'MaxWhiteStep' => "",
-        'HasWhiteSpeed' => "",
-        'MinWhiteSpeed' => "",
-        'MaxWhiteSpeed' => "",
-        'HasPresets' => "",
-        'NumPresets' => "",
-        'HasHomePreset' => "",
-        'CanSetPresets' => "",
-    );
-}
-if ( !isset( $newControl ) )
-{
+    if ( !empty($_REQUEST['cid']) )
+    {
+        $control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
+    }
+    else
+    {
+        $control = array(
+            'Name' => $SLANG['New'],
+            'Type' => "Local",
+            'Protocol' => "",
+            'CanWake' => "",
+            'CanSleep' => "",
+            'CanReset' => "",
+            'CanMove' => "",
+            'CanMoveDiag' => "",
+            'CanMoveMap' => "",
+            'CanMoveAbs' => "",
+            'CanMoveRel' => "",
+            'CanMoveCon' => "",
+            'CanPan' => "",
+            'MinPanRange' => "",
+            'MaxPanRange' => "",
+            'MinPanStep' => "",
+            'MaxPanStep' => "",
+            'HasPanSpeed' => "",
+            'MinPanSpeed' => "",
+            'MaxPanSpeed' => "",
+            'HasTurboPan' => "",
+            'TurboPanSpeed' => "",
+            'CanTilt' => "",
+            'MinTiltRange' => "",
+            'MaxTiltRange' => "",
+            'MinTiltStep' => "",
+            'MaxTiltStep' => "",
+            'HasTiltSpeed' => "",
+            'MinTiltSpeed' => "",
+            'MaxTiltSpeed' => "",
+            'HasTurboTilt' => "",
+            'TurboTiltSpeed' => "",
+            'CanZoom' => "",
+            'CanZoomAbs' => "",
+            'CanZoomRel' => "",
+            'CanZoomCon' => "",
+            'MinZoomRange' => "",
+            'MaxZoomRange' => "",
+            'MinZoomStep' => "",
+            'MaxZoomStep' => "",
+            'HasZoomSpeed' => "",
+            'MinZoomSpeed' => "",
+            'MaxZoomSpeed' => "",
+            'CanFocus' => "",
+            'CanAutoFocus' => "",
+            'CanFocusAbs' => "",
+            'CanFocusRel' => "",
+            'CanFocusCon' => "",
+            'MinFocusRange' => "",
+            'MaxFocusRange' => "",
+            'MinFocusStep' => "",
+            'MaxFocusStep' => "",
+            'HasFocusSpeed' => "",
+            'MinFocusSpeed' => "",
+            'MaxFocusSpeed' => "",
+            'CanIris' => "",
+            'CanAutoIris' => "",
+            'CanIrisAbs' => "",
+            'CanIrisRel' => "",
+            'CanIrisCon' => "",
+            'MinIrisRange' => "",
+            'MaxIrisRange' => "",
+            'MinIrisStep' => "",
+            'MaxIrisStep' => "",
+            'HasIrisSpeed' => "",
+            'MinIrisSpeed' => "",
+            'MaxIrisSpeed' => "",
+            'CanGain' => "",
+            'CanAutoGain' => "",
+            'CanGainAbs' => "",
+            'CanGainRel' => "",
+            'CanGainCon' => "",
+            'MinGainRange' => "",
+            'MaxGainRange' => "",
+            'MinGainStep' => "",
+            'MaxGainStep' => "",
+            'HasGainSpeed' => "",
+            'MinGainSpeed' => "",
+            'MaxGainSpeed' => "",
+            'CanWhite' => "",
+            'CanAutoWhite' => "",
+            'CanWhiteAbs' => "",
+            'CanWhiteRel' => "",
+            'CanWhiteCon' => "",
+            'MinWhiteRange' => "",
+            'MaxWhiteRange' => "",
+            'MinWhiteStep' => "",
+            'MaxWhiteStep' => "",
+            'HasWhiteSpeed' => "",
+            'MinWhiteSpeed' => "",
+            'MaxWhiteSpeed' => "",
+            'HasPresets' => "",
+            'NumPresets' => "",
+            'HasHomePreset' => "",
+            'CanSetPresets' => "",
+        );
+    }
     $newControl = $control;
 }
 
 $focusWindow = true;
 
-xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$control['Name'] );
+xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$newControl['Name'] );
 ?>
 <body>
   <div id="page">
@@ -172,7 +176,7 @@
     else
     {
 ?>
-        <li><a href="?view=<?= $view ?>&cid=<?= requestVar( 'cid' ) ?>&tab=<?= $name ?>"><?= $value ?></a></li>
+        <li><a href="#" onclick="submitTab( '<?= $name ?>' ); return( false );"><?= $value ?></a></li>
 <?php
     }
 }
It's really only the last changed line that is significant I think however.
Phil
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

Thank you for fixing that, it will be so much easier now to setup controls.

Did you get the addon for mjpg_streamer control added? It's pretty cool to control my Orbit with Zoneminder.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I don't think anyone send either one of us the module for the orbit.

I stared at that section of code for almost two hours Last night, I knew it had to be there :lol:
Locked