Start and stop motion based on the presence or absence of a bluetooth mobile phone.
It requires you to have a working bluetooth module on your motion server that hcitool can access.
All files hosted on Google Code:
Make sure hcitool can scan for bluetooth connections by typing
in console, it should return the name of your phone and its MAC address, alongside any other phones and bluetooth devices it might find.
Then modify the script so it has your mobile's MAC address and name in the correct places.
Run the script at regular intervals via cron is the easiest way. I have it set to run every ten minutes.
I think your idea is great to use bluetooth to detect the presence/absence of oneself. I had to buy bluetooth for my computer to test that out.
I completely wrote new scripts, based on your idea. I didn't like the trick of using cron, first of all there are 10 unwatched minutes, second my arrival is always filmed and third, I also want to be filmed but films where I am present should be stored at a complete different location.
To do the trick: I used the on_movie_start and on_movie_end Variables in motion.conf. As soon as the movie starts, the computer checks, if my handy is around. When the movie ends, a decision is taken, what should be done to the movie, depending if I were around when the movie started.
I don't want to start another project, which uses the same topic as your project does. I would like to share my scripts with you, so you can test them and if you like them, we could make a release 0.2 out of your project with both of us mentioned, if you like.
Drop me an email at motion@trillkePLEASENOSPAM.net
if you are interested.
- 30 May 2009
I also have a very similar script I put together a few years ago.
while true; do
if `sudo l2ping -c 1 $MAC 2> /dev/null | grep -c "44 bytes from"` == "1"
if `cat /home/user/home` = "YES"
echo YES > /home/user/home
lwp-request -C user:password http://127.0.0.1:8080/0/detection/pause
if `cat /home/user/home` = "NO"
echo NO > /home/user/home
lwp-request -C user:password http://127.0.0.1:8080/0/detection/start
You might want to use the http interface to suspend and restart capture rather than totally stop motion.
- 27 Jan 2010
Really sorry for the hyper late reply, there is no way of informing me of replies so I didn't know there were any.
Please feel free to contact me via the googlecode page and I can add your stuff to mine
- 23 Feb 2010