PictureTel PTZ2N/PTZ2P Control Script Beta Now Available

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

Thanks for posting the old files. I've been trying off and on for a week to convert it to a module. While I've managed to learn a _little_ about Perl, I've not made any significant headway. The error I ca't seem to get around is :

zmcontrol[28877].FAT [Can't connect: No such file or directory]

I don't know if its a module problem or permissions to the /dev/ttyS0 or what...

So, until my frustration level wanes I will just monitor this thread and hope somebody gets around to converting the ptz-2 script. Be it known that whoever undertakes the endeavor, you have my full moral support and gratitude.

Mike
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

PowerRanger wrote:zmcontrol[28877].FAT [Can't connect: No such file or directory]
Please, look this issue, may be afected your script:

http://www.zoneminder.com/forums/viewtopic.php?t=12203
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

Thanks for the pointer, but I checked and don't think that's my issue.

my module so far can be reconstructed from:

http://pastebin.ca/1254938

just make a file named Ptz2.pm, chmod to make executable + copy to /usr/share/perl5/ZoneMinder

I don't even think you need the actual hardware (or a camera for that matter) to see the error.



Mike
Last edited by PowerRanger on Thu Nov 13, 2008 3:46 am, edited 1 time in total.
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

PowerRanger wrote:Thanks for the pointer, but I checked and don't think that's my issue.
In my experience, every time I was modify my module code, I need to delete the lock control file, because give the same error as you.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

Normando wrote:I need to delete the lock control file, because give the same error as you.

That's a little over my head, how would I do that?
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

PowerRanger wrote:That's a little over my head, how would I do that?
At my system, under /var/lib/zoneminder remove all your zmcontrol-*.sock files before try to test your modify module. Do this every time you want to test your module. It is the same folder for events - images - and temp folders.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

I have a /var/lib/zm but there's nothing there .

My ZM_PATH_SOCKS is set to /tmp

but I don't see any control sockets.

BTW I edited my earlier post with a pastebin link to the contents of the module.

Mike
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

If you have not socket files, then you will get the same errors:
zmcontrol[28877].FAT [Can't connect: No such file or directory]
Why can't connect to socket file? I don't know, but start looking at the tmp permissions, or if zm can write to this directory.

Look at your /var/log/messages file to see any ttySx file error.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

All of my log files write to the /tmp just fine. I've been tail -f on them and /var/log/messages, but I don't see any problems with permissions. I've chown'ed 777 the /dev/ttyS0


This is on Ubuntu 8.10 from repos. I think zm runs as user www-data. I've read that the user needs to be added to the modem users group to have access to the serial ports, but using the gui i couldn't figure out how to do that, hence the chown 777 /dev/ttys0


Probably the thing for me to do is try getting the original script working with .22 version , I have that installed on another machine. Once I get that working I can rule out permissions to the serial device.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

update-- I did a fresh install of ubuntu 8.04 and zm .22 from the repositories. I installed the original ptz2n script, and entered all parameters for PTZ and chown www-data.www-data /dev/ttyS0

The camera controls fine.

moved back to the 8.10 with my new module under zm .23, set permissions on serial device and still get the zmcontrol[8093].FAT [Can't connect: No such file or directory] error

I'm sure that if anyone knew how to debug modules a little better than me were to take my pastebin from above and make their own module, they could maybe get me past this problem without even having the actual hardware. I'm stuck. Any takers?

TIA

Mike
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

still stuck

Post by PowerRanger »

If somebody could give me a nudge by helping figuring out why I'm getting the 'can't connect; no file or directory' message, I would be very grateful. Again, the pastebin link from above can be used too re-create my module. I don't think the hardware is necessary to get to the point of the error. As an aside, can the module (or the the module through the control server) be called independently of ZM to exercise the code?

Something like: perl -d /usr/share/perl5/ZoneMinder/Ptz2n.pm


BTW-- I get a perl syntax error in the code when I execute this on my module.

Thanks

Mike
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

I played with this some more and made quite a few changes. I'm still having the 'can't connect' message though.

http://pastebin.ca/1270957

Mike
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

Anyone??

Please help me. I've been struggling with this for in earnest for 2 weeks now, and can't say whether I've made ANY headway. At this point I'm very depressed and discouraged and simply tired of banging my head with no results. I'm almost ready to toss in the towel. I am convinced that if somebody who knew how the stuff worked were to look at my code, they could in a few minutes tell me what I've been struggling with for days.

I'm not asking for somebody to do this work for me. I want to learn. I just need a little help.

I can post logs, or even make a whole system available for debug.

Sorry for the rant.

Mike
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

pm me with a public link to your camera, and I will try to help you running your camera controls at my zm server. If it is posible, you must leave for at least 72hours permanent connected to the inet.
PowerRanger
Posts: 23
Joined: Thu Oct 23, 2008 7:42 pm

Post by PowerRanger »

Thanks Normando

PM sent

Mike
Post Reply