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_ 2014-08-06 14:03

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

Originally Posted by justmemory (Post 1434827)
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


hey cheers -- haven't done much to this in yonks :p

Yeah in my experience the timelapse bugs are more to do with the somewhat buggy native alarmd library than anything else -- I was trying to avoid using cron unneccesarily, but maybe I should switch for stability.....

Anyhoo, let me see if I can actually help or not:
* What params did you set for the timelapse?
* Were the relevant alarm cookies showing in the timelapse window?

justmemory 2014-08-14 08:13

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
2 Attachment(s)
Quote:

Originally Posted by tetris11_ (Post 1435010)
hey cheers -- haven't done much to this in yonks :p

Yeah in my experience the timelapse bugs are more to do with the somewhat buggy native alarmd library than anything else -- I was trying to avoid using cron unneccesarily, but maybe I should switch for stability.....

Anyhoo, let me see if I can actually help or not:
* What params did you set for the timelapse?
* Were the relevant alarm cookies showing in the timelapse window?

Hi,

thanks for your answer and help :)

I attached 2 images about the configuration.
*I just wanted to take pictures, so I set 1 minute time interval, not to convert to video.
*What are the relevant alarm cookies...? :) Those that let me set time interval...? That is why I attached the images, maybe this could help...

Thanks,

jm

tetris11_ 2014-08-15 10:10

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
The alarmd cookies are the listed items on the second image you provided -- these tell the alarmd daemon: when to run, what to run, and who set the alarm.

So right now you've just confirmed that the cookies are being set properly and read from alarmed properly, but unfortunately alamred is not processing them for some buggy reason I've seen before that comes with executing custom scripts....

This leaves me with two options:
* 1 . write my own background daemon, which would be overkill
* 2. Use cron, which is nice and easy but I have no idea how reliable or resource hungry it is.

I'll try and find some time to play with this over the coming months, but no promises as usual. Thanks for the feedback anyhow

justmemory 2014-08-15 12:04

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

Originally Posted by tetris11_ (Post 1435863)
The alarmd cookies are the listed items on the second image you provided -- these tell the alarmd daemon: when to run, what to run, and who set the alarm.

So right now you've just confirmed that the cookies are being set properly and read from alarmed properly, but unfortunately alamred is not processing them for some buggy reason I've seen before that comes with executing custom scripts....

This leaves me with two options:
* 1 . write my own background daemon, which would be overkill
* 2. Use cron, which is nice and easy but I have no idea how reliable or resource hungry it is.

I'll try and find some time to play with this over the coming months, but no promises as usual. Thanks for the feedback anyhow

that is OK, tetris11_, thanks for your reply and effort! :)
I shall make things manually until then :)

cheers,

jm

tetris11_ 2014-08-16 13:02

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
A quick fix until then would be to install cron, phone-control, and imagemagik and run:

TimeLapse.sh:
=============
Code:

#!/bin/bash

# Edit these
cap_script=/home/user/MyDocs/cap_script.sh
cap_dir=/var/tmp

an_script=/home/user/MyDocs/animate_script.sh
output_anim= $cap_dir/output_animation.gif

every_N_min=20
between_hour="11-12"

####################


# Make capture script
echo "
#!/bin/bash
phone-control --capture $cap_dir/`date +%Y_%m_%d-%H_%M_%S`.jpg
" >  $cap_script

# copy+backup current crontab
crontab -l  > old_cron.txt
cp old_cron.txt current_cron.txt

# Make the animate script that also restores the previous cron (and deletes the timelapse job)
echo "
#!/bin/bash
convert  -delay 20  -loop 0  $cap_dir/*.jpg  $output_anim
crontab old_cron.txt
rm old_cron.txt
" >  $an_script


# The following will execute the capture script "every N minutes" between the hours of "between_hour" just for today

echo "#min  hour  dom  mon dow year" >> current_cron.txt
echo " */$every_N_min  $between_hour  `date +%d\ %m\ %w\ %Y` $cap_script >> current_cron.txt

# Add animation script an hour after it runs to cron
echo " 0  $(( `echo $between_hour | egrep "[0-9]+$"` + 1 ))  `date +%d\ %m\ %w\ %Y`  $an_script >> current_cron.txt


# Write new crontab
crontab current_cron.txt
rm current_cron.txt


PUNK 2014-08-16 16:02

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
great app,keep n900 go on...

justmemory 2014-09-08 11:53

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

Originally Posted by tetris11_ (Post 1435982)
A quick fix until then would be to install cron, phone-control, and imagemagik and run:

TimeLapse.sh:
=============
Code:

#!/bin/bash

# Edit these
cap_script=/home/user/MyDocs/cap_script.sh
cap_dir=/var/tmp

an_script=/home/user/MyDocs/animate_script.sh
output_anim= $cap_dir/output_animation.gif

every_N_min=20
between_hour="11-12"

####################


# Make capture script
echo "
#!/bin/bash
phone-control --capture $cap_dir/`date +%Y_%m_%d-%H_%M_%S`.jpg
" >  $cap_script

# copy+backup current crontab
crontab -l  > old_cron.txt
cp old_cron.txt current_cron.txt

# Make the animate script that also restores the previous cron (and deletes the timelapse job)
echo "
#!/bin/bash
convert  -delay 20  -loop 0  $cap_dir/*.jpg  $output_anim
crontab old_cron.txt
rm old_cron.txt
" >  $an_script


# The following will execute the capture script "every N minutes" between the hours of "between_hour" just for today

echo "#min  hour  dom  mon dow year" >> current_cron.txt
echo " */$every_N_min  $between_hour  `date +%d\ %m\ %w\ %Y` $cap_script >> current_cron.txt

# Add animation script an hour after it runs to cron
echo " 0  $(( `echo $between_hour | egrep "[0-9]+$"` + 1 ))  `date +%d\ %m\ %w\ %Y`  $an_script >> current_cron.txt


# Write new crontab
crontab current_cron.txt
rm current_cron.txt


Hi tetris11_,

thanks for the reply and fix!

I was wondering about using gst-launch with "sleep x seconds".

EDIT: OK, forget about gst-launch; I'm unable to take apropriate pictures: the results are greenish and dark even with the back camera...

EDIT: My bad, it is possible to take fine pictures, just need to use the appropropriate commands: http://wiki.maemo.org/Phone_control#...h_front_camera

Cheers,

jm

viktor80 2015-03-02 09:57

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

Is it only for me or the app wont start?

tetris11_ 2015-03-03 12:11

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
no no, this is normal...

It's unable to allocate enough memory and so it just... doesn't.

You can ask the kernel to overcommit memory, or kill a few resource-hogging background processes and see if that works...

Neat app, huh?

pasko 2015-08-14 18:43

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
Hi.
I'm testing this app, but I can't set the white threshold above 4999: it complains with:
Code:

White needs to be a valid integer
The command line looks like:
Code:

/opt/watchdog/bin/watchdog -c -d -s 1280 960 -w 5999 -t 30:00
Is there a workaround for this?

Regards.

tetris11_ 2015-08-15 00:38

Re: [Announce] WatchDog - Motion Detector + Time Lapse
 
thats odd, but is likely a commandline parsing error.

my N900 died a while back so development of this is fully halted , but you can fork the code and try to debug it yourself I reckon - check out the command line class and play around a bit.

if you're not so keen on that, then a temporary fix might be to change the order of arguments and see if that works.

sorry ....


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

vBulletin® Version 3.8.8