maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] WatchDog - Motion Detector + Time Lapse (https://talk.maemo.org/showthread.php?t=86285)

tetris11_ 2012-08-24 14:02

[Announce] WatchDog - Motion Detector + Time Lapse
 
http://s13.postimage.org/bn4f71653/S...824_121450.png http://s14.postimage.org/8yhw5q24h/S...824_121549.png

http://s14.postimage.org/rgm8pyjwh/S...824_122054.png http://s16.postimage.org/a58v13rb9/S...824_122610.png

Hi folks :)

This is a small motion detector I wrote using the CImg library and FCam API.

The App is split into 3 components:
  • Motion Detector
    Detects motion and records to file. Can also send images via email.
    • Mask Size: Determines sensitivity of motion detection. The lower, the more sensitive (and more false positives). A high mask is generally favoured. If you specify a large image size, then you should specify a high mask too.
    • Show Image: Tickbox ensures that the frame where movement was detected will be shown. This comes up as a purplish image due to QPicture and FCam having wierd color issues. Will sort out later.
    • Threshold (the lower it is, the more sensitive)
    • Duration (HH:mm:ss) (default 00:01:00)
    • Max and Min Intervals. You don't want the detector checking for motion every second, so to save resources it fluctuates between these two interval ranges.
      Initially it starts at an interval halfway between the Max and Min. If motion is detected, it halves the interval and checks again. If motion is still occuring it keeps halving down to the min limit.
      If motion is not detected for 10 frames, the interval is doubled, and so forth, up to the max interval.
    • Modifier affects the halving/doubling of the interval. Lower = more sensitive, Higher = least sensitive.
    • Image sizes (320x240, 640x480, 800x600, 1280x960)
    • Image save directory. When motion is detected, movement frames are saved here.
    • Options to convert images to MPG when finished, and to delete images.
    • Email option to email user with an attached image of movement.
  • Time Lapse
    Records images at specified intervals. Essentially just a cronjob, but uses libalarmd.
    • Until: Specify the day and time to end photo capture.
    • Repeat: The frequency of photo cpature, up to the Until date. Repeat Never option takes just a single photo at that date
    • Image: Image size and framerate of video (if user wants to convert)
  • IP Streamer
    This is not working yet. This will essentially be the slot to launch a completely revamped version my current PhoneStreamer App. I've made a lot of changes to Phonestreamer, but haven't had time to implement it into the WatchDog yet. Todo.

There is also commandline functionality for remote usage, and users can run the app with various flags and switches.
For more info:

Code:

/opt/watchdog/bin/watchdog --help
note: weird bug where it throws an error for certain time values.
fix: Add
Code:

PATH=$PATH: /opt/watchdog/bin/
export PATH"

to the end of /etc/profile. Restart phone, then just run
Code:

watchdog -x -y -z -etc
where x y z etc are whichever flags you choose.


Installation
On extras-devel! Just need to update and install:
Code:

root
apt-get install fcam-dev fcam-drivers
apt-get update && apt-get install watchdog

TODO
* Fix layout bugs
* Fix target bug for timelapser
* Add SMS, warning sound
* Port to Harmattan


Warning
It works, but it's buggy as hell and will crash on you at least once - I am warning you that of now.

It was developed in just a few weeks and so there hasn't been much time to polish it. Absolutely will do once I finish the writeup, but till then - hang on.

Also, if you guys could post any bugs or suggestions here, I'd be really grateful. Thanks guys :)

Old-Deb Link: https://docs.google.com/open?id=0B0-...lBXUjZFT2d6T0U

deed 2012-08-24 19:35

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
hi!

I just wanted to say whaaa! and to thank you very much for this wonderfull app.
It seems that nowadays, developing for n900 does not get the deserved audience... things go that way and this baby is now getting old!, but thanks to genius developers like you (and few others of course!) the "THING" is still unbeatable and, at least for me nothing compare to the n900.

Thanks to those devs who make it feel new day after day and good luck.

_For the few tests I made till now, this app seems to work flawlessly

tetris11_ 2012-08-25 10:33

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
You're so right man - nothing comes close to the n900.

I keep looking out there on the market expecting to see better phones, only to see closed-source wannabe's with higher specs. I spit on them, they're not real devices.

<rant>
Nokia deserve a real round of applause for what they tried to do with this phone and Qt. Sure it's not a completely open phone, but it was a brave step in the right direction and Qt is by far one of the best framework's out there - almost every OS uses Qt apps in form or another.

But then they got scared. Nokia dropped Maemo, then Meego, and even shunned Symbian to choose Windows. Not only that, but they sold Qt (despite the fact that Qt was doing very well at the time) to Digia.

I love this community, and I have nothing but undying respect for those who maintain CSSU. Nokia are such bastards to turn their backs on all the loyal devs that have followed them so far.

Rignt now I have my eye on Project Tizen. When they release that, then I'll maybe stick my head out for a new phone.

Edit: No I won't, Tizen has dropped Qt. They're not making this easy.....

Till then, all the current ones can go **** themselves. :)
</rant>

HtheB 2012-08-25 12:35

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Great that people still develop for our beloved N900

any Harmattan version in the plan? :D

tetris11_ 2012-08-25 13:20

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Heh, it shouldn't be too hard to port. I'll add it to the the TODO after I finish pollishing it a few weeks from now

Crogge 2012-08-25 14:08

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Great work, my N900 will be happy :)

imo 2012-08-25 14:13

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
simply amazing

tetris11_ 2012-09-01 16:53

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
^ Thank you!

Guys, don't mean to sound ungrateful, but the lack of responses so far has been staggering.... exactly how many of you still own N900's?

If you've still got yours lying around somewhere, but are attached to your new phone (whatever it may be), then this is the perfect end-app for it.

Just stick in a secret location and watch people come and go. Or use it as a doorbell securicam, which sends you an email everytime someone knocks on the door.

recluse 2012-09-02 11:07

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
1. Can you combine all features?
That is: Stream a timelapse over IP that only records when there is motion.
This would be useful for watching my guinea pigs.

2. Can you get it to work on Nokia N9 (Harmattan)?

fw190 2012-09-02 17:30

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Will you put it someday in the repos?

tetris11_ 2012-09-04 21:09

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Quote:

Originally Posted by fw190 (Post 1259751)
Will you put it someday in the repos?

I've been trying, but Maemos Assistant keeps rejecting my changes file. Should be up within the week though.


Quote:

Originally Posted by recluse (Post 1259599)
1. Can you combine all features?
That is: Stream a timelapse over IP that only records when there is motion.
This would be useful for watching my guinea pigs.

2. Can you get it to work on Nokia N9 (Harmattan)?

1. So you want that app to motion detect your guinea pigs at long intervals and to deposit each frame on your PC precisely when it is obtained?

This can already be done by specfying a high max interval (of say 5 minites) and a high min interval (of say 45 seconds), and ticking the email option to email you the frame with the motion precisely when it is obtained. :D

2. N9 port is on the TODO

malfunctioning 2012-10-17 00:29

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
This is a very impressive application. Thank you for developing it! I will find some time to test this soon.

By the way, I think part of the lack of response might have to do with:
- The fact that many people are much less willing to install anything if it's not in the repos.
- This thread not reaching "critical mass."

Still, you prove that the N900 is an amazing machine, and capable of almost anything in the right hands.

Looking forward to future developments with WatchDog!

And thanks again :)

Muddy_physicist 2012-10-18 20:06

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Great application! Thanks for making it.
:)

impeham 2012-10-20 12:31

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
First - An impressive application :)

from command line i get many times the following error:

---
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
---

i find it very inconsistent - there are times that i paste the same command line to x-term and it works and some other times it gives this error - maybe a parsing issue - might be related to email address.

for example - this command gives the error:

/opt/watchdog/bin/watchdog -m 20 -i /home/user/MyDocs/DCIM/MotionDetection/ -s 1280 960 -r 1 2 -t 00:01:00 -e 'johns@gmail.com' 'Last image' 'Motion Detection' y

and this one doesn't:


/opt/watchdog/bin/watchdog -m 20 -i /home/user/MyDocs/DCIM/MotionDetection/ -s 1280 960 -r 1 2 -t 00:01:00 -e 'j@gmail.com' 'Last image' 'Motion Detection' y

the change is in the email address - i thought that it might be related to the length of the command but it isn't - i even tried shortening other values with no change - the error still happened.

tetris11_ 2012-10-21 19:40

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Quote:

Originally Posted by impeham (Post 1282925)
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

I used to get this alot too. And yes it is very inconsistent, to this day I still don't know why this is caused, but I believe it relates to a flaw in my pointer control in main class.

Have you tried:
Code:

PATH=$PATH: /opt/motiondetect/bin/
export PATH"

as suggested on Page 1?

Sometimes this fixes that bug.... not sure why.

@Muddy_physicist - thanks :)
@malfunctioning - I've been trying! Maemos Assistant keeps rejecting my changes file. I once toiled on this for 12 hours straight, only to find out that MA was down. I'll try again, but don't hold your breath.

fw190 2012-10-22 08:08

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Maybe someone from the current council could hel you out with this?

PUNK 2012-10-23 06:27

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
great idea,keep going...

tetris11_ 2012-11-04 16:04

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Well... I tried again.
Maemo Upload Assistant once again rejects my changes file. It even rejects an old changes file that it once accepted, so I'm stumped.

Scratchbox is too much of a buggy hassle to even bother with and my garage account is refusing my public key, so scp and dput are not going anywhere either.

If any admins can lend a hand here, I'd be grateful.
I can upload my source here, but I dont want anybody re-uploading to extras under their name

(I trust you guys for the most part, but it only takes one :P )

vetsin 2012-11-04 16:23

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
i think you should PM ivgalvez or other council members. :)
thanks for still developing for the N900.

tetris11_ 2012-11-05 22:28

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Okay, well by a combination of:
  • Switching to Windows
  • Copying my source to ~\Desktop\watch\watchdog (important -- have a folder within a folder, Desktop is not writable)
  • Cleaning the build in Qt, running qmake,
  • Leave the rules file with all the 'Uncomment' parts LEFT uncommented.
  • Edit the desktop file for the appropriate display name
  • and finally using MADDE terminal to build:
    Code:

    mad dpkg-buildpackage -sa -S -uc -us
autobuilder finally agreed to lift up its skirt and build the fricking app.

And to think it only took 19 <*~&@%$?> attempts and half my sanity... :o

TLDR: We are on the repos and good to go. Let the bug reports come streaming in ;)

handaxe 2012-11-20 01:29

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Just back on the n900 after a looong and traitorous sojourn with Android. Will try this one out tetris11_, for sure.

Quite an emotional return - old tech maybe but I simply love the n900 in ways I do not and suspect cannot enjoy 'droid.

HA

Siren 2012-11-20 10:10

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Just out of curiosity - is tetris still around here, and developing this? Looks like very interesting project, no idea how I could have missed it.

handaxe 2012-11-20 10:58

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Yes he is - posted a few days back.
Report back on app: text on setup screens is very small. So much so I struggle to test :) Yup, old eyes, .... (sigh)

tetris11_ 2012-11-20 14:12

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Hey handaxe, good too see you again buddy!

My code has (noticeably) improved since phonestream (no more single-class apps), but my layouts still suck. Will work on that.

@Siren - cheers! Yes I'm still around. I don't plan to get a new phone any time soon.

handaxe 2012-12-25 18:50

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Is time-lapse meant to save to the same folder as motion-detect? Motion works fine but I am not getting images from 'lapse.
Battery flat, so later.... Just seen the info on CLI operation.
Small bug on Repeat screen: if minutes dial is set to 0, then seconds cannot be set below 20.

Also tick boxes at bottom overlap with dial (you likely know that).

This app has huge value for n900 in retirement. Add send sms alongside email (and even a sound alarm?) in motion-detect and the n900 really is a pocket alarm system.

handaxe 2012-12-26 20:01

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Ah, yes - you need to edit the first post to reflect the new path for watchdog: "/opt/watchdog/bin/watchdog" and not "motiondetect".

Indeed, the time-lapse routine seems to be trying to run a motion-detect executable and thus tripping up.

And what is the run-time variable "--teenage-diplomacy" that time-lapse attempts? /opt/watchdog/bin/watchdog segfaults if fed that.

tetris11_ 2012-12-27 12:42

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Ah I forgot to change targets when I renamed the app... that was smart of me. Heh '--teenage-diplomacy', that's a switch with all the camera settings for the shot attached which only runs the app if the present date is less than the attached variable.
(I was also listening to "Blinded by the Lght" by ELO on a repeat for a couple of hours and the chirpiness slowly drove me insane...)

The Repeat screen bug is actually a safegaurd to prevent the phone from crashing if it executes too many jobs close together. Launching+Shooting+Closing the watchdog takes around 5-10 seconds depending on how busy the CPU is, so I made the minimum interval 20 seconds for caution.

Okay, so TODO:
Fix targets on app
Update frontpage to correct target
Fix layouts
Add SMS + Sound alarm

Will try fixes today if not busy

handaxe 2012-12-27 15:02

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
@ tetris11_ : have you looked at the intervalometer package? No reason to ask other than curiosity. Is unfinished it seems - as the plugins do not seem built and the advanced setting appears not to present any advanced options.

tetris11_ 2012-12-28 16:18

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
yeah I tried it out but couldn't get it to work.
I haven't looked at the source, but I was the under the impression it used its own background daemon to schedule jobs.

Btw, I fixed a few bugs but created a few new ones so I'll release a hotfix update either today or tomorrow

impeham 2013-03-19 17:22

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
This application looks great. I can not stop myself from wondering - these days we can see Galaxy S4 being released to market and it has a cool feature - being able to do operations without actually touching the screen (the hand just needs to be moved above the screen).
Is it possible somehow, to make the front camera track simple hand movement (right to left for example) and make it launch a user script as a result? if this was possible, using the N900 could have been awesome in cases where you cannot/do not want to touch the screen (like if you are in the kitchen and your hands are dirty).

Just some thoughts running in my head - what do you think?

MrWeasel 2013-04-23 19:57

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
First, thanks for this great app!

Nevertheless, I am experiencing one serious bug when using the commandline: Whenever the screen is turned off, the program segfaults after a few frames. This is reproducible and it runs fine once I set the screen to "always on".

Maybe this is connected to the yellow "Motion detected!" banners you are showing?

kike 2013-04-24 05:39

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
How about symbian port? 808 would be perfect ip camera with all connections and camera.

handaxe 2013-04-24 07:32

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
The dev may have left these shores...... and watchdog was a "work in progress" app.

Half-Life_4_Life 2013-10-14 08:43

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Too bad..I will try this app when I get home.
Took me a while to find it.

tetris11_ 2013-10-21 19:20

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
I'm alive... but haven't worked on this in months.

I recently installed this back onto the phone, but can't seem to be able to get it to work... hmm....

If anyone wants to fork the code, feel free. I might work on it if I get time

@handaxe - hey dude

whayong 2013-10-21 21:29

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
I can't believe I didn't see this sooner as well. Interested in giving it a go and looking forward to any possible updates/releases.

handaxe 2013-10-22 18:37

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Quote:

Originally Posted by tetris11_ (Post 1381723)
@handaxe - hey dude

Well, well, well lookee there...:)

tetris11_ 2013-10-23 12:40

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
^ hey-hey, I haven't jumped ship yet ;)
(though as soon as someone makes an Ubuntu smartphone with a HW keyboard I am gone! Woosh! Nah jk jk)

really should spend more time on this app. The GUI's a bit crap but am proud of everything else.

handaxe 2013-10-23 21:04

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Quote:

Originally Posted by tetris11_ (Post 1381955)
really should spend more time on this app. The GUI's a bit crap but am proud of everything else.

That would be great. The gui mainly has size issues IIRC. Watchdog type apps are reasons to keep the n900 for fun applications (eg. leave it in the forest for a while to see who/what you capture) once one moves on to another phone.
Glad to hear from you..

justmemory 2014-08-04 11:55

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Quote:

Originally Posted by handaxe (Post 1307678)
Is time-lapse meant to save to the same folder as motion-detect? Motion works fine but I am not getting images from 'lapse.
Battery flat, so later.... Just seen the info on CLI operation.
Small bug on Repeat screen: if minutes dial is set to 0, then seconds cannot be set below 20.

Also tick boxes at bottom overlap with dial (you likely know that).

This app has huge value for n900 in retirement. Add send sms alongside email (and even a sound alarm?) in motion-detect and the n900 really is a pocket alarm system.

Hi,

first of all I would like to thank the development of this app! :)

Motion detection is working fine with stock camera app, but the timelapse doesn't take any picture at all (tested with stock camera and FCam). Do you have any idea what I am doing wrong...?

Thanks,

jm


All times are GMT. The time now is 08:57.

vBulletin® Version 3.8.8