Activate Cameras Automatically
Activate Cameras Automatically
Hello!
I was trying to figure out a simple way to deactivate cameras when I get home and activate them when I leave when I realized I carry a phone with me that connects to my wireless network whenever I am home. So I'm trying to think of ways to use that to automatically activate and deactivate the cameras.
So here's my question:
Is there any way I can have the computer detect when a certain IP address has appeared on (or disappeared from) my network and change the ZoneMinder run state appropriately?
I'm using Ubuntu 8.10 with ZoneMinder 1.23.3
Thanks!
I was trying to figure out a simple way to deactivate cameras when I get home and activate them when I leave when I realized I carry a phone with me that connects to my wireless network whenever I am home. So I'm trying to think of ways to use that to automatically activate and deactivate the cameras.
So here's my question:
Is there any way I can have the computer detect when a certain IP address has appeared on (or disappeared from) my network and change the ZoneMinder run state appropriately?
I'm using Ubuntu 8.10 with ZoneMinder 1.23.3
Thanks!
How about adding a cron job to periodically run something like this?
Code: Select all
#!/bin/sh
if ping -qnw1 -c1 192.168.254.109 2>&1 >/dev/null
then
/usr/local/bin/zmpkg.pl start
else
/usr/local/bin/zmpkg.pl stop
fi
Your going to likely want to add to that. You don't want to send a start when zm is already running.
Code: Select all
#!/bin/sh
command=/usr/local/bin/zmpkg.pl
result=`$command status'
if ping -qnw1 -c1 192.168.254.109 2>&1 >/dev/null
then
if [ "$result" = "stopped" ]; then
$command start
fi
else
if [ "$result" = "running" ]; then
$command stop
fi
fi
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Also see my post about using a USB thumbdrive to change the run state.
http://www.zoneminder.com/forums/viewto ... 0&start=19
(my discovery spans a few posts)
You have a phone that connects to your WLAN and stays connected? Doesn't that kill the phone's battery life? I'd worry that if the battery died or the WLAN went down (or the IP address changed) I'd start recording things going on at home, and possibly sending emails/uploading files for hours.
Then again there have been times when I've forgotten to plug the USB stick back in when I've arrived home, only to find my inbox (and FTP server) full of events showing me walking around the house. So your solution would be better, assuming you didn't leave the phone in the car.
To prevent forgetfulness and remember to disarm the system, I thought about using ubuntu's "beep" command to beep the speaker now and then when the system is armed, but the ZM box is in a cabinet inside a room and it's hard to hear the speaker, so it's not ideal.
Just some ruminations. I'm semi-obsessed with improving visualization and control and *not* requiring web access to interact with ZM on a basic operational level, so solutions like your phone/IP solution are fascinating to me.
http://www.zoneminder.com/forums/viewto ... 0&start=19
(my discovery spans a few posts)
You have a phone that connects to your WLAN and stays connected? Doesn't that kill the phone's battery life? I'd worry that if the battery died or the WLAN went down (or the IP address changed) I'd start recording things going on at home, and possibly sending emails/uploading files for hours.
Then again there have been times when I've forgotten to plug the USB stick back in when I've arrived home, only to find my inbox (and FTP server) full of events showing me walking around the house. So your solution would be better, assuming you didn't leave the phone in the car.
To prevent forgetfulness and remember to disarm the system, I thought about using ubuntu's "beep" command to beep the speaker now and then when the system is armed, but the ZM box is in a cabinet inside a room and it's hard to hear the speaker, so it's not ideal.
Just some ruminations. I'm semi-obsessed with improving visualization and control and *not* requiring web access to interact with ZM on a basic operational level, so solutions like your phone/IP solution are fascinating to me.
On that note, if you happen to have a variety of the Axis models, they have outputs which can respond to remote triggers (a properly formatted wget or curl should do the job). You could set one of those up to a light(s) and turn them on/off when the system is live/not.
Depending on your texting plan and whether or not you pay for them, you could also send an email from the box to your phone as a text message telling you when it's activating/deactivating. There's some sort of SMS plugin available, but a simple email to phonenumber@txt.provider.com (variers by provider) would be easy. That may be a great way to find out if your phone's keeping a consistent wlan connection when home, if you get a barrage while you're home.
Depending on your texting plan and whether or not you pay for them, you could also send an email from the box to your phone as a text message telling you when it's activating/deactivating. There's some sort of SMS plugin available, but a simple email to phonenumber@txt.provider.com (variers by provider) would be easy. That may be a great way to find out if your phone's keeping a consistent wlan connection when home, if you get a barrage while you're home.
-
- Posts: 42
- Joined: Wed Mar 05, 2008 10:33 pm
- Location: Stanford-Le-Hope, Thurrock, Essex
Bluetooth with mobile
Hello
I have a similar setup for my Asterisk server, it has a bluetooth dongle in it which detects my bluetooth phone is present and changes the dialplan to not bother forwarding calls out of the house.
Heres the guide for Asterisk, likely to be partly relevant for Zoneminder:
http://nerdvittles.com/index.php?p=78
J
I have a similar setup for my Asterisk server, it has a bluetooth dongle in it which detects my bluetooth phone is present and changes the dialplan to not bother forwarding calls out of the house.
Heres the guide for Asterisk, likely to be partly relevant for Zoneminder:
http://nerdvittles.com/index.php?p=78
J
Last edited by Jason_Bassett on Thu Aug 19, 2010 10:56 am, edited 1 time in total.
These are such cool ideas. I love the BT one (since the BT radios on our phones are always on), but my house is laid out "long" and BT won't stay connected from one end to the other. I could try wiring a dongle to a USB extension (15ft max) and move it toward the center of the house....then a cron job could run and check for the presence of at least one of our BT phones and change the runstate accordingly.
Lots to think about. I'm still toying with the idea of a keypad but they're not cheap.
Lots to think about. I'm still toying with the idea of a keypad but they're not cheap.
-
- Posts: 42
- Joined: Wed Mar 05, 2008 10:33 pm
- Location: Stanford-Le-Hope, Thurrock, Essex
Multipul BT dongles
How about multipul BT dongles to cover the premises. Either connected to same machine using long cables or even on multipul machines if you have them on in various placed.
Last edited by Jason_Bassett on Thu Aug 19, 2010 10:56 am, edited 1 time in total.