Control wansview q2

Forum for questions and support relating to the 1.30.x releases only.
Locked
drbubbles
Posts: 4
Joined: Sun Feb 11, 2018 8:29 am

Control wansview q2

Post by drbubbles »

Trying to control pan and tilt for a wansview q2. One post suggested the solution required digest authentication and gave a DBPower.pm as a working solution:
viewtopic.php?t=23792

I put the .pm file into /usr/share/perl5/ZoneMinder/Control but DBPower didn't appear in the "Control Type" list in zoneminder under "control". I tried to refresh the mysql database to make it appear with:

sudo /etc/init.d/mysql reload

but DBPower still didn't appear in the list that appears when you click on "edit" next to "Control Type" in the "Control" tab.

How do you get a new .pm to appear in the list? (or is there a more direct way to get a lansview q2 to pan and tilt in zoneminder?)
dave111
Posts: 2
Joined: Mon Sep 19, 2011 7:42 pm

Re: Control wansview q2

Post by dave111 »

After clicking on "edit" in the control tab. Scroll down to the bottom of the control capabilities list then click "Add new control"
Give the control a name and enter the "protocol" ensuring it is the same name as the name of the .pm file. (DBPower)
Also check it matches this section of the .pm file :

package ZoneMinder::Control::DBPower;

Then click on the various control tabs and tick the relevant boxes for pan and tilt functions.

Save the control and also click "save" on the main control tab and it should then be available to choose when you next open the control tab.

When you use it, if you get an error message in the log about being unable to load the control, check the .pm file has the correct ownership and permissions (same as the others in that folder).

(I have been trying to get digest authentication working using this script modified for a Dahua camera, so far unsuccessfully.)
drbubbles
Posts: 4
Joined: Sun Feb 11, 2018 8:29 am

Re: Control wansview q2

Post by drbubbles »

Thanks Dave111, that's got me quite a bit further. I did as you suggested and the log shows I am successfully authenticating the video stream and starting the control server (using user:pass@ip.address:port in the "Control Address" field of the Control tab, keeping Control Device blank, as otherwise I was getting an authentication error when using "user=xxx&pwd=yyy" in the "Control Device" field .

2018-02-11 18:13:29.965132 zms 5374 INF Authenticated user 'admin' zm_user.cpp 140

2018-02-11 18:14:37.387650 zmcontrol 5495 INF Control server 7/DBPower starting at 18/02/11 18:14:37 zmcontrol.pl
2018-02-11 18:14:37.304730 zmcontrol 5491 INF Starting control server 7/DBPower zmcontrol.pl


Although the camera isn't moving yet, I am probably getting a lot closer now!

I've set Can Move, Can Tilt, Can Pan, and tried a few values for step size and speed, with range 290 degrees pan and 120 degrees tilt. If I hit the left right or up down arrows in ZM control, I don't see anything in the logs. If i enable the (non-existent in .pl file) diagonal controls, I get an error (see below) so the commands are using the right .pl file.

2018-02-11 18:14:30.085770 zmcontrol 5468 FAT Can't access moveConUpLeft member of object of class ZoneMinder::Control::DBPower zmcontrol.pl

I need to poke around a bit more.
drbubbles
Posts: 4
Joined: Sun Feb 11, 2018 8:29 am

Re: Control wansview q2

Post by drbubbles »

Solved. Just needed to disable "HAS PAN SPEED" and "HAS TILT SPEED" in the DBPower Control Capability dialog.

Wireshark showed that the command that worked from the web interface to move the camera up had no numbers after "up" in:

uri="/hy-cgi/ptz.cgi?cmd=ptzctrl&act=up"

That is where the speed value gets appended if it exists in the Control Capability zoom and tilt tabs and is enabled. Enabling it and including a value there made the camera ignore the command so it didn't move.

Now the camera moves using controls in ZoneMinder.
Locked