Posted: Wed 05 Sep 2007, 08:48 Post subject:
Dotpet Package of Motion (Webcam Video Surveillance)Subject description: Now updated to current version with HOWTO on compile and making dotpet

EDIT 15 Oct 2013: Note well that the attached dotpets are for very old versions of Motion. Some more recent compilations of motion can be found later in this thread and probably elsewhere on the forum.

Dotpet for motion-3.2.8 Video Surveillance application
plus mini-howto on its compilation and construction

Author: William McEwan (mcewanw). Revision 1, 10Sept2007

[ Please also refer to the new Puppy Linux Wiki page on the Motion Video Surveillance project at:
http://puppylinux.org/wikka/Motion ]

Please find download link for motion-3.2.8.pet at the foot of this message.

This update includes motion detection capturing of avi as well as jpeg images plus considerably more functionality. It has been compiled from the original sources.

I have kept the original information at the bottom of this message, concerning the earlier motion-3.1.19.pet for completeness, but I strongly advise upgrading to the more advanced, but equally easy to use, motion-3.2.8 as soon as possible.

I've just discovered a nice article on setting up Motion and webcams in general by Mark Alexander Bain entitled "CLI Magic: Getting into Motion" at http://www.linux.com/articles/114118

For attitional information you might also want to refer to my recent but rough HOWTO: Manually get your webcam and/or TV card working at: http://www.murga-linux.com/puppy/viewtopic.php?t=21464

For an alternative, sophisticated video surveillance solution, which uses the "zoneminder" video surveillance package (from http:://www.zoneminder.com), you might like to try the Puppy Watchdog distribution available via: http://puppylinux.org/wikka/WatchDog
--------------------------------------------------------------

motion-3.2.8 compile notes and dotpet mini-howto:

[Compiled and created on Puppy Linux 2.17.1 with devx_217.sfs loaded, and then packaged as a dotpet using dir2pet].

I have created a new dotpet for the Motion video surveillance application. This dotpet, motion-3.2.8.pet, is for the current version of motion (as of Sept 2007) and includes ffmpeg support (so it can produce avi videos as well as jpegs) but not mysql support. If you have mysql installed on your system, and would like Motion to use that, it is a simple matter to recompile the application (just follow the steps below; the straightforward compilation procedure will automatically detect your mysql libraries). For my compilation, for ease of later upgrade, I have faithfully kept to the installation procedure, and associated install directories, recommended at motion's website:

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

For the moment, you will find the new dotpet, motion-3.2.8.pet, via the link provided at the bottom of this thread message.

Though, you simply need to install the dotpet to get motion working correctly (assuming your webcam driver is already installed), I have briefly detailed below the procedure I used compiling the package (just prior to producing the dotpet). Hopefully, this may help you should you wish for any reason to recompile the application yourself. Please refer to my earlier "HOWTO:Manually get your webcam and/or TV card working" (at: http://www.murga-linux.com/puppy/viewtopic.php?t=21464) for more general information concerning getting your webcam itself working.

That howto also points you to an older version of motion, motion-3.1.19.pet, should you want to try that as an alternative. Note, however, that motion-3.2.8 provides superior facilities to motion-3.1.19 and is equally easy to use.

Note: When you run it, the motion program automatically looks in /usr/local/etc/ for the text file motion.conf (its configuration file). Since you now have a backup (motion-dist.conf), you can edit motion.conf as much as you desire. Refer to motion's website for details of motion.conf's format:

[At this stage I edited /usr/local/etc/motion.conf and changed "the Start in daemon (background) mode" parameter to off]

INSTALLING THE DRIVER MODULE FOR YOUR WEBCAM

If you haven't already done so, you should now install the driver module for your webcam. For example, I installed vabene06's dotpet: gspcacav1-20070508-i586.pet, which automatically places the correct driver module for my own webcam, gspca.ko, into /lib/modules/2.6.21.5/kernel/drivers/usb/media. You can get vabene06's dotpet from forum thread:

http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=5467

Then you need to register the new driver module with the system and load it and the videodevice up by entering the commands:

You can now start the motion video surveillance application by entering:

/usr/local/motion-3.2.8/motion
[or simply: /usr/local/motion/motion
because of the symbolic link made earlier
Note that, an intermediate shell script, /root/.motion/motion.sh, is used in the final dotpet to start the applicaton].

On detecting motion, the jpeg and/or avi images will by default be captured into /usr/local/apache2/htdocs/cam1. You can change that behaviour by editing /usr/local/etc/motion.conf, altering the line starting with the words target_dir to point to wherever you want to store the jpegs etc.

When running in this non-daemon mode you can stop motion running by pressing Ctrl-C. You can alternatively always stop it by finding the process id using, for example, either top or ps, and entering: kill <that process id>

Apart from editing /usr/local/etc/motion.conf, to whatever behaviour you desire, everything is now installed. You should, if you wish, consult motion's website manual for details regarding the alterable configuration parameters in motion.conf. You will find the complete manual at: http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuide

For your convenience, however, the dotpet I produced to avoid your having to go through all the above steps includes a JWM Menu icon and entry:
Menu > Multimedia > Motion-3.2.8 Video Surveillance
That menu item calls up a tiny shell script I have written, /root/.motion/motion.sh, which runs the motion application from a new rxvt shell (unless daemon mode has been turned on in motion.conf).

Enjoy!

------

Further notes: PRODUCING THE DOTPET

You might be interested in how the actual dotpet itself was produced.

After compiling motion-3.2.8 and getting it all working, I created another empty directory called motion-3.2.8 elsewhere on my system (anywhere I had space). Then I created a dummy directory structure mimicking where I wanted the bits and pieces of motion to end up. That is, I created:

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

This puppy linux pet is was produced from the original Damn Small Linux compilation found at: http://distro.ibiblio.org/pub/linux/distributions/damnsmall/mydsl/multimedia/motion.tar.gz dated: 04/14/2005
[Thanks are due newOldUser of the DSL community. The application looks for its config file motion.conf in /home/knoppix or in ~/.motion so perhaps the source originally comes from the knoppix distribution?]
For ease of future upgrade, I have tried to keep the directory structure of my installation pet for motion as close to the original DSL installation as possible.

This is a simple compilation of motion which, for ease of installation, has been stripped of mysql and ffmpeg operability.
However, there is nothing to stop a more complex compilation, with more facility, being successful on puppy linux.

-------------

Some Details:

I extracted motion.tar.gz into a single directory motion-3.1.19
I then created the directory motion-3.1.19/root/,motion and moved motion.conf from motion-3.1.19/home/dsl into there so that the application motion would be able to find motion.conf post-installation.
I then used dir2pet to produce the puppy linux pet archive motion-3.1.19.pet.
I have arranged for the installation to add a mini-eye.xpm icon and Motion-3.1.19 Video Surveillance entry to the main JWM menu under Multimedia. To make it easier to stop motion running when desired, I use the main menu to start motion via a simple shell script, /root/.motion/motion.sh which opens a controlling rxvt console. The advantage of that method is that it makes it easy to stop motion running when desired by clicking on the console and pressing Ctrl-C. The user can also more easily finetune the start-up procedure, if they wish, by editing motion.sh

This motion-3.1.19.pet archive stores the following files and directories on your system:

Before running motion make sure your webcam is setup and working correctly. Unless you have already arranged that, you may first need to: depmod -a; modprobe videodev; modprobe <your_webcam_driver_module>
This pet does not include any webcam driver modules, you must find the approprate one for your webcam and install that yourself. You may find some useful information related to that in a howto I have written (HOWTO: Manually get your webcam and/or TV card working) and posted to the puppy murga-linux forum at:
http://www.murga-linux.com/puppy/viewtopic.php?t=21464

To run motion, either:

* click on JWM menu > Multimedia > Motion-3.1.19 Video Surveillance or
* open an rxvt or any commandline window and enter the command: /opt/motion/motion or
* open a file manager window at /root/.motion and single-click on the motion.sh application icon found there or
* open a file manager window at /opt/motion and single-click on the motion application icon found there

The first three of these method have the advantage that you can easily press keys Ctrl-C to stop motion running. Alternatively, you can always use the command top (or ps) to obtain the process id of the running motion application and then enter kill <that process id> to terminate it.
--------------

After installation, motion is initially configured to store the jpeg images it captures in the directory /home/dsl/motion/pics. If you wish them to be stored in a different directory, edit /root/.motion/motion.conf and change the line starting with target_dir to wherever you wish your images to go.

Refer to http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome for detailed information on using motion and for detailed help on understanding and modifying its configuration file motion.conf
-------------

You can download motion-3.x.x.pet from http://dotpups.de/dotpups/Multimedia/MotionVideoSurveillance/
or you can use the links below to download from this forum.

I have been using 'motion' under Grafpup since Spring 2007 and previously on a NSLU2 running Openslug.

I'm quite familiar with the motion program so can offer configuration help or tips if needed. I run a 3 IP camera system myself.

I've also written a couple of patches for motion (Kenneth's Wiki has a separate section for patches, so if Motion doesn't quite act how you want, you can submit additional program code in the form of a patch). My user name over there = SimonW.

One thing I have been wondering about Simon. I know Motion can be compiled to work with mysql. However, Puppy Linux 2.17.1 seems to come with sqlite3 (version 3.3.5). Do you know if that could be usefully used with Motion at all? Would maybe save having to install mysql, for example, in order to get database functionality of some sort.

I have been working for some time on a embeded motion server using puppy and motion I currently have a functioning version of Motion intergrating sqlite3 Setup is
puppy 2.17
motion 3.2.9
sqlite 3-0.5
I have pet packaged it as far as new2dir but have no idea how to upload it if anyone would like it please advise
As for details it has been running for many months with motion 3.2.8 and have recently recompiled with 3.2.9 which captures motion in a far better manner. The sqlite part which I have embeded into the motion code will auto generate valid sqlite tables via the normal motion configure options/file. The whole thing is part of a web interface for motion that I have been playing with for many months. for those intrested a sample image is attatched

motion-img-05-4pup.png

Description

Add from query Making a (UTL User Time Line) with motionMon CSS beta version

. . . I currently have a functioning version of Motion intergrating sqlite3 Setup is
puppy 2.17
motion 3.2.9
sqlite 3-0.5
I have pet packaged it as far as new2dir but have no idea how to upload it if anyone would like it please advise
. . . The whole thing is part of a web interface for motion that I have been playing with for many months. for those intrested a sample image is attatched

It would be great if you could upload your pet package of the above. I'd certainly like to give it a spin! I imagine the package is over the limits for posting directly to this forum (1 MByte max I believe), however, you could create a folder for it under your name on servage, ftp your pet there, and then send a private forum message to MU to ask him to store it at dotpups.de.

Ask MU if he would store it alongside the previous Motion uploads, but in its own subdirectory:

The versions I uploaded a while ago are stored in subdirectories Motion-3.1.19 and Motion-3.2.8, with the respective pet names of motion-3.1.19.pet and motion-3.2.8.pet. I also ftp'd md5sums for them plus short readme files.

You will find the information about how to upload at the following thread, and what MU needs to know about the package (just a couple of lines in a readme):

http://murga-linux.com/puppy/viewtopic.php?p=99400#99400

It would also be good if you could add info about your package to the Wiki page concerning Motion at http://puppylinux.org/wikka/Motion

Check the Wiki help pages for the procedure to obtain a password for editing Wiki pages, or ask Lobster about it. As the Wiki page explains, raffy should sort you out with the password.

Tis taken me some time to get back on this but at last I think I have a portable package of the motion/sqlite pet. I have run it via a number of installation configurations and it seems to hold up but This is my first package so at the bottom end of the learning curve.
I have more on the way
php-sqlite3.pet (connects sqlite to php without the pdo pear overhead)
motionMon the main reason for all this and the GUI to motion
sqlitedbms a light weight sqlite user interface
plus others to offer a complete monitoring solution that should be capable of running on an embedded puppy system (such as micro client jnr)
I have a version of the pet running on a Thinkpad 600 300Mhz with 196M ram
and this is prior to profiling the php for hangs and it seems to be able to deal with it all so its looking promising.
for now I'm attaching the pet here which is just the pre compiled version which I built on the Thinkpad as it should be upward portable
I will post the other elements soon Docs and source as pets
then turn my attention to the wiki when I have some feed back on issues with this version
The package should install as a pet (it includes as a requirement ffmpeg )
the version I used came in two parts off the site here
http://www.murga-linux.com/puppy/viewtopic.php?t=14213
to run it at an open terminal just type motion.sh and it should guide you from there
more details can be obtained by using the option motion.sh notes
hope you enjoy
below is the md5 for the package
1cf134c21fb291ad684170373a549a3e litemon-3.2.9-i486.petLast edited by Igo AtM on Thu 22 Nov 2007, 17:15; edited 2 times in total

Tis taken me some time to get back on this but at last I think I have a portable package of the motion/sqlite pet.

Sounds like you've been busy working hard on this. I'm looking forwards to trying it out when I find some time. It will be great to see the extra GUI/monitoring parts once you have them finished.

I've been working flat out too on a (highly-compressed sound) recording project which I'm hoping might eventually, in customised form, be useful for integrating with Motion too. Hopefully I'll be able to integrate it with your build (if I ever get it finished that is...). Actually, my main project is nothing to do with sound recording per se; it's really a general purpose control and communication interface for certain types of commandline utilities which just happens to include some sound recording utilitites I've also interested in.

I originally started my sound-related project because of Motion though; I recognised that Motion could be used to record sound on the detection of movement too, and felt that would be a nice additional facility, so I decided to build an easily controlled sound recording app with that purpose in mind. However, I recognised that a more general purpose control interface would be even more useful, which is what I'm hoping to produce (so not just for Motion). Anyway, I won't say more about that since I have long to go with it still.

More generally, I really think Motion is a great app and I'm quite excited by the GUI image you published in your previous post; looks like you are putting together a nice front-end GUI management console for it; really useful! It will be interesting to see how the overall system compares (once more complete) to forum member hushpuppy's "Watchdog" Puppyv2.16 iso (which uses zoneminder for its main functionality). There is merit I feel in both approaches. I haven't used zoneminder, though hushpuppy suggests it is more sophisticated than Motion overall. However, I tend to think of Motion itself as a very flexible engine, which is useful for building any complexity of system desired; just a matter of bolting on the extra functionality (Linux/UNIX lends itself to that philosophy of course).

The Watchdog iso-based approach, I feel, is good for producing a fully pre-configured dedicated video surveillance system (just switch it on and go...), whereas the "Motion" dotpet approach has the advantage of easy portability and upgrade (with as much or as little pre-configuration as you like).

In any case, the more alternative solutions the better! With active projects like these, Puppy Linux is well-placed to become a leading distribution in the video-surveillance domain generally; it is small, efficient and modular, so perfect for building complex dedicated systems like these.

I doubt you've had time to add anything to the Wiki about your work as yet, but it will be good to update (and polish) the docs concerning Motion on Puppy there, once everything is more complete and ready. I also look forward to the day people inevitably start publishing examples of how they are using these Puppy solutions in their homes and businesses! That's always fun to see.

It was good to hear from you again (I was wondering and hoping that would happen but I recognised that you had a big job on your hand fine tuning and packaging everything together...). Now I had better get back to my own neglected efforts.

I am updating the original pet package with a new version with a more comprehensive motion.sh script also more importantly there was a typo in the sql insert statement in the main configuration file. It is not a major change but just adding the colon ie
sqlite_query INSERT INTO security VALUES (%t', .......
should read
sqlite_query INSERT INTO security VALUES ( '%t', .....
this prevented proper parse in the sqlite engine
now
motion.sh status
should give you some idea of the installation environment and
motion.sh notes
now has a quick start paragraph added

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum