How do I run a script when viewing a monitor?

Support and queries relating to all previous versions of ZoneMinder
Locked
devsforev
Posts: 3
Joined: Tue Jan 29, 2008 3:46 pm

How do I run a script when viewing a monitor?

Post by devsforev »

Good afternoon everyone. I'm working at getting my Logitech Orbit AF working completely with my box. I've gotten pretty far but I recently had an idea.

The camera has a status LED that I am able to turn on/off through the command line. It would be nice to have the light illuminate when somebody is viewing the monitor OR the monitor is on record mode. After somebody disconnects or recording mode is disabled, I would like to turn it off.

Would anybody have any insight on how to accomplish this? Thank you very much in advance. Have a good one.

-- Devsforev
sparx
Posts: 2
Joined: Wed Feb 06, 2008 6:43 pm

Post by sparx »

I may be able to look into this. Could you provide the command line you use to control the light or any other reference information? I am working on trying to find a better way to control the PTZ functions as well and any information would be greatly appreciated. Thanks!
devsforev
Posts: 3
Joined: Tue Jan 29, 2008 3:46 pm

Post by devsforev »

I am using uvcdynctrl-0.2 to interface with the Orbit AF. PZT is working great. I actually plan on writing a how-to once I figure out this one little detail and then posting a link to my results in this thread:


How to Configure ZoneMinder for Logitech Quickcam Orbit MP?

Anyway, the command I would use to turn the light on would be:
uvcdynctrl-0.2 -s "LED1 Mode" -- 1

And off:
uvcdynctrl-0.2 -s "LED1 Mode" -- 0

I've been trying to find a way to figure out how to tell when a user is watching or recording. Once I can do that, I can write a simple script to make it work. Any thoughts? Thanks for your interest. Like I said, I look forward to writing a detailed how-to once I get this 100% operational.

Take it easy,
Devsforev
sparx
Posts: 2
Joined: Wed Feb 06, 2008 6:43 pm

Post by sparx »

Sorry it has been so long.

I installed the libwebcam-0.1.1 and compiled uvcdynctrl

However , my 046d:08cc model (not the AF) , doesn't have that feature.

Code: Select all

localhost uvcdynctrl # ./uvcdynctrl -c
Listing available controls for device video0:
  White Balance Temperature
  White Balance Temperature, Auto
  Exposure (Absolute)
  Exposure, Auto
  Pan/Tilt (reset)
  Tilt (relative)
  Pan (relative)
  Sharpness
  Power Line Frequency
  Backlight Compensation
  Gain
  Saturation
  Contrast
  Brightness
localhost uvcdynctrl #
I looked at where we could insert code to trigger a script for recording/watching. My first look was at the cgi-bin nph-zms , but it is compiled, so version upgrades and pre-compiled packages would be a pain. You could probably redirect it through a wrapper script, that way you could keep count of users watching and only trigger light off when users less than 1, rather than a user leaving while other(s) still watching.
Another location may be zm_html_view_watch.php, but my php skills are not that great.
As for the when recording, you would probably have to modify the source to zma, or what zma calls when it begins capturing. (I assume your recording on motion trigger.) I'm guessing on this, I haven't looked that closely.

Been battling a uvcvideo driver issue. Using gentoo's linux-uvc-0.1.0_pre126 driver allows the pan/tilt, but when i upgrade to linux-uvc-0.1.0_pre157 or linux-uvc-0.1.0_pre173 the module no longer supports pan/tilt, but fixes a problem i had with corrupt video streams and having to rmmod/modprobe uvcvideo a couple times a day.

I wanted to re-write my wiki to use uvcdynctrl for tracking control instead of motion's http control interface. But since motion is holding it open, I can't set or get values from the uvcvideo device with uvcdynctrl. And vloopback doesn't pass through the device commands.
Locked