Home

Forums

Statistics

Surveys

Top Ten

Your Account


Login
Nickname

Password

Security Code: Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like a private journal and posting comments or additions to articles.

Who's Online
There are currently, 10 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

Donations
If you find the information here useful,
help keep this web site online with a donation!
YTD Donations
$1.00
Thank You!

Host referer


  
AnOldMan.com: 4: Network based camera server and PTZ

Search on This Topic:   
[ Go to Home | Select a New Topic ]

Perl Script to Grab Picture from a Network Camera
Posted by anoldman on Tuesday, May 16 @ 13:53:57 CDT (517 reads)
Topic 4: Network based camera server and PTZ

The script in this example can be used to grab a webcam or network camera image.

It is a simple Perl script.  You just need to adapt the settings to fit your configuration.

You could also implement it using CRON.

With these two simple scripts, you can get MisterHouse to take a snapshot from a network camera, based on any MisterHouse event.  I am using an X10 tricky interface from my alarm system called $alarm and an Axis network camera server.

First make a file called MH/bin/get_cam
This is perl code that will retrieve a snapshot from your network camera.
$storedir should be set to the location you wish to have the picture placed.
$camurl is where you could point your browser to see a snapshot from your camera.
IMPORTANT: Right-click on your video camera's picture feed and choose "properties", then paste the URL into a new browser window.  You should see ONLY the snapshot in the browser window!
Some cameras offer a motion -or- refresh image feed.  Choose refresh image feed, then drill down to the jpg source. If your camera does not serve still pictures, the script here is unsuitable.
WebCam2000 is a program that will turn a Windows computer - that has a webcam - into a suitable source.

$basename plus HHMM timestamp plus $ext equals the stored filename.
So with the settings below, at 10:48PM, the filename would be Cam1-2048.jpg
remember there are 1440 minutes in a day, so you could end up with 1440 files!
(that's why I didn't add seconds or date to the filename, if you want to - it's your hard drive!)

    #!/usr/bin/perl -w
    use strict;         # Enforce safe programming
    use warnings;       #
    use File::Basename; # file name handling
    use LWP::Simple;    # WWW interface, exports HTTP::Status

    # Force the output buffer to flush
    $| = 1;
    # Set default values
    my $storedir = "/home/public/monitoring/";
    my $basename = "Cam1-";
    my $camurl = "http://net.cam.I.P/fullsize.jpg?camera=1&clock=on";
    my $ext = ".jpg";
    my $s = "0";
    my $m = "0";
    my $h = "0";
    my $mday = "0";
    # If the storage directory does not exist, create it.
    if( ! -e $storedir )
    {
    mkdir( $storedir ) || die "Could not create $storedir: $!";
    }
    # Generate file name
    ( $s,$m,$h,$mday ) = localtime( time );
    if( $s < 10 ) {$s = "0$s" }
    if( $m < 10 ) {$m = "0$m" }
    if( $h < 10 ) {$h = "0$h" }
    if( $mday < 10 ) {$mday = "0$mday" }
    my $fullFilename = "$storedir$basename$h$m$ext";
    # Get the file and store it locally
    my $response = getstore( $camurl, $fullFilename ) || die "Could not create $fullFilename: $!";
    # Check for a valid 'get' (RC_OK defined in HTTP::Status)
    if( $response == RC_OK )
    {
    if( -z $fullFilename )
    {
    print "File was 0 bytes. Removing.";
    unlink $fullFilename;
    }
    }
    else
    {
    print "HTTP response was $response. Could not download the image.";
    }
    exit 0; # =========== End of Main Program ===========
    

Don't forget to CHMOD the file so it has execute permissions.

Next you need a new user code file.  Store it in your MH user code directory.
i.e: MH/Code/Test/camtrigger.pl

if (state_now $alarm eq 'motion') {
    run 'get_cam';        
}

Remember to use the state_now function so that there isn't a picture taker spawned every loop!
(which is milliseconds!) Then activate the user code in MisterHouse.

By making several files and naming them get_cam1, get_ cam2, ect... you can have MisterHouse take pictures from multiple cameras.

You could use the time_now function to have a picture taken at a specific time every day.

You could set a timer, and take a picture every 5 minutes.

Remember: Questions can be posted in the FORUM section !




(comments? | Score: 0)

MV1000 by Active-Imaging
Posted by anoldman on Wednesday, February 23 @ 01:13:00 CST (3163 reads)
Topic 4: Network based camera server and PTZ

This thing has been driving me to distraction, I purchased two units almost a year ago and have been unable to use them.

The company apparently went out of business, and only a "dealer" can reset them to factory defaults.

I have attempted to hack the unit and change the password(s) and have have absolutely no luck.

The system is designed around a DGE TX486 PC104 board and a proprietary Active-Imaging I/O board.

The TX486 has two AMD 29F016 flash chips for memory. The first 32k are used for BIOS and the rest become a bootable disk.

I have removed the TX486 from the unit and built an interface, I can access the BIOS and boot the unit with a 2.5" IDE drive.

I have been unable to obtain any drivers to mount the flash disk.

I hope someday to encounter someone who has the "backdoor" password(s) for the unit. Until then, it remains shelved.

UPDATE

With the help of Stephen Day I was able to obtain the backdoor password by dumping the flash disk.

Username "backdoor" password "ploppy" - keep in mind that the username can be changed by nw-admin, so it might not work for you.

Unfortunately, even with this password I was stumped as to what to do: I end up at a bash prompt with no available commands to edit or modify files.

The default shell for user "backdoor" is /bin/sh. The default shell for "nw-admin" is mvnet/etc/htdocs.

I tried to invoke sh with htdocs and received an error. (htdocs is a script to set passwords, ip's, ect.)  I hope that snippet will assist others and perhaps they can pass back to me what to do from the bash prompt once access is gained: I can post the instructions here for future users.

Further searching in the data dump finally turned up another set of passords. They were encrypted.

With a decryption program, we were able to finally figure out what the passwords were currently set to.

This process is beyond most users, however, and I hope to someday have a simpler answer.

It would be very nice to know just what the backdoor allows a service tech to accomplish. It is my hope that someday one will see this article and tell me!


(Read More... | 20269 bytes more | Score: 0)

4: Interfacing a RadioShack CMOS camera's motion sensor
Posted by anoldman on Sunday, July 25 @ 22:01:36 CDT (955 reads)
Topic 4: Network based camera server and PTZ

I recently wanted to set my Axis 240 to take snapshots when motion was detected outside.  The 240 has an input connector that you can use to trigger a snapshot that is uploaded to an ftp server (my Magnia SG20).  To do this I needed an outdoor motion sensor as well as an outdoor camera. RadioShack fit the bill with a combination unit Catalog #: 49-2516 that works reasonably well and is very inexpensive.  Image quality is not the best, but what do you expect for a $80.00 CMOS camera?

I found that by default the camera's motion sensor is NOT AVAILABLE to the user.  You need to purchase a separate controller box.

This would be a simple solution, but at $80.00 it costs as much as the camera itself.  The idea here is to keep the cost as low as possible.

Instead I hacked the camera's interface cable.  This gave me access to the motion sensor signal.  The signal is TTL logic HIGH when there is no motion and LOW when motion is detected.  A simple circuit - two transistors, two resistors, a diode, and a relay - gives a dry contact output on the camera interface.  I put it in a small project box, you can even skip cutting open the camera's cable by purchasing a PS/2 mouse extension cord and cutting into it instead. (the camera uses a PS/2 style connector at the interface end)




(Read More... | 2232 bytes more | Score: 0)

3: VTEL Control codes
Posted by anoldman on Friday, February 27 @ 19:20:29 CST (2159 reads)
Topic 4: Network based camera server and PTZ
Here is a listing of the hex codes sent via serial port to the SmartCam controller - and thus to the camera(s) - to control pan/tilt/zoom, ect. (note: this information was "reverse-engineered" using a VTEL dos-based control program running in a window on an NT server with serial port sniffing, I attempted to obtain this information from VTEL - their technical support flatly stated that they had NO DOCUMENTS FOR THIS PRODUCT! )


(Read More... | 7502 bytes more | comments? | Score: 0)

2: Using an AXIS 240 Camera Server with your Magnia
Posted by anoldman on Friday, January 23 @ 11:24:31 CST (804 reads)
Topic 4: Network based camera server and PTZ

By default a magnia has only three options for security cameras.  It is relatively easy to modify the system to utilize an axis 240 instead of the more expensive 2400.

If you are interested in doing this, and have acquired a 240, let me know and I will type out the full instructions and post them here.

Remember: Questions can be posted in the FORUM section !




(comments? | Score: 0)

1: Axis 240 Camera Server and VTEL SMARTCAM
Posted by anoldman on Friday, August 29 @ 20:18:20 CDT (3193 reads)
Topic 4: Network based camera server and PTZ

AXIS 240 Network Camera Server

The AXIS 240 Camera Server, with built-in network technology, offers versatility and cost-savings.

AXIS 240 Camera Server

The AXIS 240 Camera Server is the easy way to provide remote monitoring of images over a network. Unlike traditional video monitoring -- which requires dedicated monitors and expensive coax cables -- the AXIS 240 lets you connect up to five plain or Pan/ Tilt/Zoom video cameras directly to any Ethernet network, intranet or even the Internet. Then, authorized users can monitor sites from a standard Web browser

The AXIS 240 is both easy to install and easy to use, and its relatively low cost makes it a versatile monitoring solution that enhances your existing system.


SmartCam PTZ Camera

The SmartCam camera is used on newer MediaMax and LC systems in conjunction with the SmartCam™ controller.

Up to four cameras can be controlled using the SmartCam™ controller


Photo Courtesy Terry Hegg


(Read More... | 1987 bytes more | Score: 0)

  
Old Articles
There isn't content right now for this block.

Web site powered by PHP-Nuke

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2003 by AnOldMan.com
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.07 Seconds