zmcontrol-visca.pl "uninitialized value" error

Support and queries relating to all previous versions of ZoneMinder
Locked
gary-in-canada
Posts: 16
Joined: Tue Mar 22, 2005 11:53 pm
Location: halifax,canada

zmcontrol-visca.pl "uninitialized value" error

Post by gary-in-canada »

I finally got my perl working ....along with SerialPort.pm.
Now in the /tmp/zmcontrol-visca.log I get this error each time I try to move cam.......

--device=/dev/ttyS0 --panspeed=254 --panstep=9381 --command=move_rel_right
Can't call method "baudrate" on an undefined value at /usr/local/bin/zmcontrol-visca.pl line 135

then this error....

Use of uninitialized value in string eq at /usr/local/bin/zmcontrol-visca.pl line 542

it repeats about a dozen times.....

then this one error.

Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmcontrol-visca.pl line 656

I just don't have the know how to edit perl scripts... yet!

Using perl 5.86
FC3
Sony evi-d30 on /dev/ttyS0 (9600,8,n,1)

Thanks
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Hmm, this looks a little odd. The 'baudrate' message is a non-issue I think as it doesn't seem to affect anything and I get it all the time. The other messages seem to imply that the command is not being passed in successfully. Is there anything else in the zmcontrol-visca.log file at all as the second error you are getting is on a line that should be printing something?

Phil
gary-in-canada
Posts: 16
Joined: Tue Mar 22, 2005 11:53 pm
Location: halifax,canada

progress......

Post by gary-in-canada »

After two days ,headaches and MANY pots of coffee! :)
I have no more perl errors.... no motion either! :)

I downloaded and compiled 2 visca based utils to test cam/port libvisca and PTZ_serial , (changed perm. on ttyS0 to all rw).
both test/pan/tilt/zoom the cam fine. Libvisca seems to "open" the port for use before each command is sent.? I did manage to get the cam to pan twice in zm using "continuous" but it went to the max travel distance and then would not respond. The "stop" button didn't stop the travel during pan also. I've done reboots between settings changes for zm/visca and did not run any outside visca utils which may close port off after it completes. Still no response from cam. Testing cam with libvisca it responds to relative and absolute pans but zm when forced to use absolute, it errors in the visca log.
when set to continuous and relative I get no errors in the log except zoom in absolute mode:
eg:--device=/dev/ttyS0 --address=1 --panspeed=1 --tiltspeed=1 --command=move_con_downright
Move Down/Left
Tx: 81 01 06 01 01 01 01 02 ff [9]
--device=/dev/ttyS0 --address=1 --command=move_stop
Stop
Tx: 81 01 06 01 00 00 03 03 ff [9]
--device=/dev/ttyS0 --address=1 --speed=5 --command=zoom_con_tele
Zoom Tele
Tx: 81 01 04 07 25 ff [6]
--device=/dev/ttyS0 --address=1 --panspeed=1 --panstep=1 --command=move_rel_right
Step Right
Tx: 81 01 06 03 01 00 00 00 00 01 00 00 00 00 ff [15]
--device=/dev/ttyS0 --address=1 --command=preset_home
Home Preset
Tx: 81 01 06 04 ff [5]
--device=/dev/ttyS0 --address=1 --panspeed=1 --tiltspeed=1 --panstep=1 --tiltstep=1 --command=move_rel_downright
Step Down/Right

Toggled for cont. and relative motion....
**Does zm totally take care of port speed etc? 9600,8,n,1 or does it rely on external preconfig as in setserial? I have the evid30 visca command set in front of me and it makes no mention of the "pan>max/min>steps" variable, at least for my sony evid30 cam command set.
here are some settings for the "pan" section:
can pan =yes
min pan =1
max pan =370
min pan step=1
max pan step=1
has pan speed =yes
min pan speed =1
max pan speed =18
has turbo pan = no

When specifying visca control port "/dev/ttyS0" or "0" both seem to work
Is there a way to get a REAL detailed log for serial port activity to see if data is making it to the camera?

Thanks for the help ......
Gary
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I only have one visca camera to test on but I have found it to be the easiest of all to set up so things may be different for you (as it sounds like they are).

You are right that the zmcontrol script sets up the port, though it's simple for you to edit if you want to change it.

It's difficult remotely to see what might not be working for you, though I think you probably want to change the max pan step to a larger number. My visca cam has a range of several thousand and a movement of 1 will be imperceptible. Did the stock visca setup not work at all for you?

Debugging the serial comms is likely to be a bit tricky. The scripts use the Device::Serial perl module and you may find that has a debug facility but I've never used it. The ZM debug prints out the byte values if you want to check them against the Visca protocol.

Phil
gary-in-canada
Posts: 16
Joined: Tue Mar 22, 2005 11:53 pm
Location: halifax,canada

All fixed!!

Post by gary-in-canada »

At 3am (much coffee) I found a very nice piece of sony software to run the evid30
it had lots of nice features like a readout of data and commands going and coming from cam. It runs fine under wine no problems at all! After running that app my cam worked fine under zm , so I suspect it needed the cam or port initialized or something similar.
I have 2 outdoor visca ptz cams on the way so I used this little evid30 to get the bugs out before they arrive. One note: is there a way while the cam is in modect to disable the motion feature as it will trigger an alarm. Maybe have the toggle "controllable" in the monitor setup be part of the saved profile as I've created one for armed and unarmed that cron controls?
One quick question though for auto tracking does it rely on auto tracking being turned on in the cam or will it work on a cam without auto tracking built in, just memmaped?
Anyone want that sony file can email me ,it was very hard to find.
Thanks again guys/gals for taking the time to help me through this....!

Gary
Locked