PTZ control via serial/usb converter

Forum for questions and support relating to the 1.25.x releases only.
Locked
ositstomc
Posts: 12
Joined: Mon Sep 28, 2009 12:48 pm

PTZ control via serial/usb converter

Post by ositstomc »

Hi

I am using Zonminder V1.25.0 with a Sony EVI-D30 camera and the quality is great, I have moved zoneminder to a new PC with no serial ports so I have used a usb to serial converter to connect the visca cable to control the PTZ. I have set the camera control device to be /dev/ttyUSB0 as this appears to be the recognised converter but what do i enter for the control address field in the camera setup?

Any help would be greatly appreciated.

TomC
ka1axy
Posts: 3
Joined: Sat Jul 14, 2012 1:04 pm

Re: PTZ control via serial/usb converter

Post by ka1axy »

I'm using the same setup with zm 1.25 and Ubuntu Server 12.04. I have a D30L "lite" version, and it's PTZ'ing (after a fashion).

/usr/share/perl5/ZoneMinder/Control/Visca.pm is very buggy...I read somewhere that the guy never finished it: routine names don't match the web interface (this seems to be the cause of the "Can't access <function> member of object of class ZoneMinder::Control::Visca" failures), and there are a number of typos.

What you put in device name, is "/dev/ttyUSB0" and what you put in "device address" is the number of your camera. In my case, it's "1", because I have no switch like the full blown D30/31 has. You'd put whatever you have your switch set to.

There's one more thing you need to do (from here: jonwsmith com/projects/zoneminder/):
cd /dev/tts
chown apache 0

That solved some problems. But I'm still not able to control pan and tilt. The log from the ZM Console web page still shows errors, but they are getting fewer. PTZ seems to only go to the stops, but in the right directions. I think this is because the controls in the web interface are mapped to the wrong routines in Visca.pm (specifically, the U, D, L, R arrows are mapped to moveConUp instead of moveRelUp, etc) So a click on a move arrow does a continuous move instead of a relative move of some particular step size (and I don't understand how one would set the step size for the move, either). I don't think the web controls support click-and-hold, and there's a note somewhere that clicking a button runs the zmcontrol.pl task (which, I guess, calls Visca.pm) which terminates after it issues the command and gets an ack. So no state information is maintained.

Anyone interested in making the Visca module work? I'm going to start hacking on it anyway. Help would make it go faster :-)

What I could really use is some help figuring out how the http control interface is generated (I'd like to add a move continuous/relative/step option and the diagonal move arrows don't seem to be connected) and how it is mapped to the routines in Visca.pm.

Bugs I have found so far:
- need to fix typos in Visca.pm
- change " $self->{port}->handshake('rts');" in Visca.pm to 'none'
- move U,D,L,R go to limits (continuous move rather than relative?)
- zoom Tele goes to limit, zoom Wide doesn't work
- Focus goes to limit
- Diagonal moves not working
- Wake does something, not sure what
- Home sometimes works
- The VISCA manual says to do a power on comand and a reset device command, don't think this is happening.
- the default numbers for Pan, Tilt, Focus and Zoom limits in the Monitor/Control tab for Control Type: Sony VISCA are all
wrong: edit the values to agree with those on pages 8 and 9 of the manual: www chuktech net/video/EVID30.pdf (you will
need to convert from hex to decimal :-)

Pan:
Min Pan Range: -879
Max Pan Range: 880
Min Pan Step: 10
Max Pan Step: 100
Min Pan Speed: 1
Max Pan Speed: 50

Tilt:
Min Tilt Range: -300
Max Tilt Range: 300
Min Tilt Step: 10
Max Tilt Step: 50
Min Tilt Speed: 1
Max Tilt Speed: 50

Zoom:
Min Zoom Range: 0
Max Zoom Range: 1023
Min Zoom Step: 10
Max Zoom Step: 100
Min Zoom Speed: 2
Max Zoom Speed: 7

Focus:
Min Focus Range: 1000
Max Focus Range: 40959
Min Focus Step: 1
Max Focus Step: 100

I left the remainder as originally specified. The values I used are the decimal equivalents of the argument ranges listed in the D30 VISCA commands manual.

And does anyone know more details about the feature set on the EVI-D30L? I know it doesn't have an IR remote interface and it's missing a lot of the rear panel options, but how many presets does it have?
ka1axy
Posts: 3
Joined: Sat Jul 14, 2012 1:04 pm

Re: PTZ control via serial/usb converter

Post by ka1axy »

I have learned some more about the ZM control interface:

- *where* you click on the arrows in the control interface determines how fast the continuous slew is (base = slow, tip = fast)
- clicking in the center or between the arrows stops motion
- if you want incremental movement, you click *in the image*, at the place you want the new image centered.

This is probably hidden somewhere in the documentation, but I found it piecemeal, in various forum postings.
ka1axy
Posts: 3
Joined: Sat Jul 14, 2012 1:04 pm

Re: PTZ control via serial/usb converter

Post by ka1axy »

ositstomc wrote:Hi

I am using Zonminder V1.25.0 with a Sony EVI-D30 what do i enter for the control address field in the camera setup?

TomC
I have the exact same setup. Set the control address for the D30 to "1".

I went through the VISCA.pl and made a bunch of corrections. The only things left to get working are "wake/sleep".
When I get home, I will post the updated file.
Locked