Motion - Bluetooth Motion
You are here: Foswiki>Motion Web>RelatedProjects>BluetoothMotion (23 Feb 2010, RupertPlumridge)Edit Attach

BluetoothMotion

Introduction

Start and stop motion based on the presence or absence of a bluetooth mobile phone.

Detailed Description

It requires you to have a working bluetooth module on your motion server that hcitool can access.

Attached Files

All files hosted on Google Code:

http://code.google.com/p/bluetoothmotion/

Installation

Make sure hcitool can scan for bluetooth connections by typing

hcitool scan

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.

Users Guide

Run the script at regular intervals via cron is the easiest way. I have it set to run every ten minutes.

Comments and Bug Reports


Hi, 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@trillke.net if you are interested.

Bye, Gerry

-- GeraldS - 30 May 2009

I also have a very similar script I put together a few years ago.

#!/bin/sh

MAC=00:AA:BB:CC:DD:EE

while true; do if `sudo l2ping -c 1 $MAC 2> /dev/null | grep -c "44 bytes from"` == "1" then echo "home" if `cat /home/user/home` = "YES" then echo YES > /home/user/home fi lwp-request -C user:password http://127.0.0.1:8080/0/detection/pause > /dev/null sleep 90 else echo "away" if `cat /home/user/home` = "NO" then echo NO > /home/user/home fi lwp-request -C user:password http://127.0.0.1:8080/0/detection/start > /dev/null sleep 15 fi

done

You might want to use the http interface to suspend and restart capture rather than totally stop motion.

-- BenHardill - 27 Jan 2010

Hi

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 wink

-- RupertPlumridge - 23 Feb 2010

RelatedProjectsForm edit

ProjectSummary Start and stop motion based on the presence/absence of a bluetooth phone
ProjectStatus Stable
ReleaseVersion 0.3
ProjectSubmitter RupertPlumridge
Topic revision: r4 - 23 Feb 2010, RupertPlumridge
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.