Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


CactiCam (0.1.5) - Motion Sensing Webcam for Cacti

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Announcements
Author Message
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Jul 10, 2008 9:13 am    Post subject: CactiCam (0.1.5) - Motion Sensing Webcam for Cacti Reply with quote

Over on Hackaday the other week there was a post about a guy that had developed a way to have his Webcam update Twitter. So that got me thinking. We need Webcam support for Cacti. A way to embed a video stream directly into the Cacti application.

What I've done, is written a plugin that is able to view a Webcam that is either directly connected to your Cactibox or it can connect to a remote stream. The remote stream can be a NetCam, or it could be another webcam connected to a remote Linux box running the software I'm about to go through.

The WebCam that I'm currently using is this:

http://www.logitech.com/index.cfm/webcam_communications/webcams/devices/352&cl=us,en

Why am I using it, because I tried a cheap one I got from Geeks, and I couldn't make it work at all. After a couple weeks of trying to get it work, I finally gave up after I saw a discussion about Video4Linux not supporting USB 1.1 that well. I picked mine up at BJ's for $25.00, and it worked in Ubuntu and on my CentOS 5.2 box without any real issues.

The driver you'll need for that camera is this:

http://mxhaard.free.fr/download.html

I'm using gspcav1-20071224.tar.gz on my CentOS box.

You'll need to install FFMpeg as it's a pre-requisite to the Motion sensing software. You can get it from here:

http://ffmpeg.mplayerhq.hu/

I used this command to compile it on my system, this may not work on your system. Check your paths first to ensure they're correct before you just copy and paste this command.

Code:
./configure --bindir=/usr/bin --libdir=/usr/lib --shlibdir=/usr/local/lib --incdir=/usr/local/include --enable-shared --enable-decoder=all --enable-encoder=all --enable-avfilter


It might have some pre-requisites as well, just follow it's instructions for getting it installed.

Once FFMpeg is in, you'll need to install Motion from here:

http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome

I used this command to compile this on my system, it may not work on yours, check your paths to ensure they're correct before you just copy and paste this command.

Code:
./configure --with-ffmpeg=/usr/local/lib --with-mysql --with-mysql-lib=/usr/lib/mysql --mysql-include=/usr/include/mysql


When you have Motion installed, test it by connecting directly to the stream with Firefox (Not IE, IE does not know how to interpret the stream). I've attached an example motion.conf file to this post, feel free to use it to get your system up and running.

You'll need to create a directory inside the Root of your webserver for motion to store it's images. On line 356 of the motion.conf file that's attached you'll need to enter that path.

To have motion write to the database, you'll have to create a webcam database in MySql and run this command to create it's structure:

Code:
CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), text_event timestamp(14));


You'll need to grant rights to that table to whatever user you choose to have motion run under.

You can have Motion email you images that it captures, but I found in a busy office where there's lots of movement it gets to be a real pain. I do have a shell script that will select the last image saved and email it to you. If anyone is interested in that script, I'll post it.

Hopefully that's enough to get motion up and running. If you have issues getting any of those programs compiled on your machine, I'm sorry I cannot help you out, anytime I ran into an issue, I did research on the problem until I resolved it. With all the different flavors of Linux out there, there's no way I can troubleshoot compilation problems across the board. I go this working on CentOS 5.2, which I highly recommend as a nice stable platform that everything just seems to work. So if you have compilation issues, please take them up with whatever distro you're using, research the issue and try to determine where you went wrong.

Now, onto the Cacti portion.

Obviously, download the the Cacticam archive and install it the way you would any other plugin.

Download the Cambozola archive, extract it and copy the cambozola.jar file into the root of your webserver, this is very important, this jar file MUST be in your root, and readable by your web user.

Make sure you configure all the options under Settings -> Misc -> Cacticam. The box for External port is there because I do a port redirection on my external so that when I'm connecting to my Cactibox my URL looks like this:

http://bleh.company.com:8080/ You'll just need to put the 8080 in there if you're doing something similar. My firewall redirects traffic from 8080 to an internal IP address to port 80, but there's some translation that needs to take place because of the difference in ports that Motion is running on. The code should make those changes for you, and it should work if you're inside your firewall, or outside your firewall.

Troubleshooting: If you get no video in the plugin, verify that you can connect directly to the stream. If you get video there, then the problem could be that your java applet is not loading properly.



CactiCamLive.jpg
 Description:
 Filesize:  46.31 KB
 Viewed:  1641 Time(s)

CactiCamLive.jpg



CactiCamHistory.jpg
 Description:
 Filesize:  110.25 KB
 Viewed:  1641 Time(s)

CactiCamHistory.jpg



cacticam-0.1.5.tar.gz
 Description:
CactiCam 0.1.5 8/12/2008

New version: Can now sort images from videos in the history page.

Uploaded a new version to fix a real minor bug 7/24/2008 09:57 EST

Resolved problem where version changes were not detected.

Resolved issue where IE would not

Download
 Filename:  cacticam-0.1.5.tar.gz
 Filesize:  98.26 KB
 Downloaded:  76 Time(s)


motion.conf.txt
 Description:
Example motion.conf file.

Download
 Filename:  motion.conf.txt
 Filesize:  23.92 KB
 Downloaded:  154 Time(s)


cambozola-0.68.tar.gz
 Description:
cambozola java applet

Download
 Filename:  cambozola-0.68.tar.gz
 Filesize:  141.32 KB
 Downloaded:  171 Time(s)



Last edited by streaker69 on Tue Aug 12, 2008 7:58 am; edited 7 times in total
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Jul 10, 2008 10:08 am    Post subject: Reply with quote

One thing just to get you guys thinking. Supposedly the Motion software has the ability to not only control a Pan/Tilt manually, but it can track with the movement.

These just came out a little while ago:

http://www.geeks.com/details.asp?invtid=IP800&cat=VID

It would be great to get one of these, and see if it could be used with this plugin and see if it could actually track movement.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9723
Location: MI, USA

PostPosted: Wed Jul 23, 2008 6:27 pm    Post subject: Reply with quote

Funny

Larry
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Jul 24, 2008 8:59 am    Post subject: Reply with quote

I just uploaded a new version. I never use IE, so I didn't really test this out on IE, but I found today that the live video wouldn't work in it. I've fixed that problem with this version.

I guess no noose is good noose since people have downloaded it and not posted questions. Does anyone else have this working, I'd like to hear from you.
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Tue Aug 12, 2008 7:59 am    Post subject: Reply with quote

Updated the version so that you can now sort Jpg's captures from the Video captures.
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Aug 14, 2008 2:58 pm    Post subject: Reply with quote

CentOS notified of Kernal updates today, which I ran. In doing so, the driver for the webcam no longer functioned. All I did to fix it was to re-run make and make install and unplugged, replugged the camera. Everything worked fine after that.

Just in case someone is actually using this and runs into the same issue.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Announcements All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group