Author Topic: FEATURE REQUEST: personal proximity auto start / stop  (Read 3173 times)

darne11

  • Newbie
  • *
  • Posts: 3
    • View Profile
FEATURE REQUEST: personal proximity auto start / stop
« on: August 19, 2012, 09:36:58 PM »
Great program!

I was unhappy with the scheduler and having to flip on/off for push notifications and recording pictures so I made a simple batch script to check for my cellphone on the local WiFi. If its there (i'm home) the icam exits or stays exited. If the phone is not there (if im not home) it starts icamclient, which is set to autorun and autopush / record.

 ;D

\icamsource\icamauto.bat :
Code: [Select]
@echo off
cd C:\Program Files\iCamSource\
echo - Checking for phone...
ping /n 1 192.168.0.105 | find "TTL">NUL
rem replace 192.168.0.105 with device IP
IF ERRORLEVEL 1 GOTO dead
IF ERRORLEVEL 0 GOTO alive
 
:dead
echo -- no response..
start /I /SEPARATE icamsource.exe
ECHO --- iCam ON
if exist %appdata%\off.tmp (del %appdata%\off.tmp)
GOTO end
 
:alive
echo -- Response!
if exist %appdata%/off.tmp GOTO :end
taskkill /F /IM icamsource.exe
ECHO --- icam OFF
echo placeholder > %appdata%\off.tmp
rem placeholder indicates process has been killed (otherwise "not found" error)
GOTO end

:end
echo ---- %time%
rem for reference
PING 1.1.1.1 -n 1 -w 20000 >NUL
rem (1.1.1.1 is arbitrary dead host) this is the "wait time" 20000 = 20 sec
"C:\Program Files\iCamSource\icamauto.bat"
« Last Edit: August 23, 2012, 10:22:54 AM by darne11 »

OUAnthony

  • Hero Member
  • *****
  • Posts: 801
    • View Profile
Re: personal proximity auto start / stop
« Reply #1 on: August 19, 2012, 11:32:42 PM »
Nifty! Nice scripting. It's important to note for people that might consider using it:

1) If someone breaks into your home while you're there, you would not have images of the intruders. Personally, I leave it recording even when I'm home...even though the push notifications are sometimes annoying. Better safe than sorry.

2) I would think the IP address used by the phone needs to be outside of the IP address range available to be assigned by the router to network devices via DHCP...otherwise the router might assign the IP address formerly used by your phone to some other device...and the script would then think your phone was present. This would also mean that your phone would need a static IP address on your network.

I think it would be really cool/handy if your script could be incorporated into the icamsource code so that you could add device detection for one (or more) devices and enable/disable recording and/or push notifications or even the actual camera feed itself on a per camera basis.

For example, let's say I have 4 cameras...2 monitoring building entrances and 2 monitoring interior common spaces. When I'm home, I don't want push notifications for motion in the common spaces, but push notifications for the entrances would still be highly desired, as well as the ability to view/record the feed from the common spaces (in case of an intruder...I know when they're coming my way). But maybe another user wouldn't want to record the feed, or even see the feed on their phone. With the per camera settings already available in icamsource, it seems like this could be easily programmed (this coming from a non-programmer)...maybe scanning the network every 30 seconds or so for an update. Is there a way to use command line to scan the network for iPhones and Android phones and auto-populate this information into a dropdown box in the proposed addition to icamsource? Or would the IP address have to be added manually by a user? I think it'd have to be easy for the average end-user before they'd consider adding it as a feature. Personally though, I'd use this feature...love it!

darne11

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: personal proximity auto start / stop
« Reply #2 on: August 21, 2012, 09:29:00 AM »
1) Yes, that is a risk. My apartment is small enough that anyone breaking in while I'm home would be impossible not to notice, even if I was asleep. Also small enough that if icamsource is running with push on I get constant notifications at home :|

2) I set a DHCP reservation for my phone. That way it has a "static" ip that wont be given to other devices, but still operates using regular DHCP on other networks.

It'd be cool if it was a feature! While a scanner for devices would be great, it could just be a little box for putting in IP (putting a scanner in would require a lot more code and function than just a simple PING check). You can always check the IP on the device, on the DHCP server (router) or using one of many dedicated scanning programs out there.

I'm not sure of all the switches, but I think you can choose sources when running icamsource.exe from command line. If you rename the EXE (icamsource2.exe) you could have some cams on all the time where others go off and on ;)

OUAnthony

  • Hero Member
  • *****
  • Posts: 801
    • View Profile
Re: personal proximity auto start / stop
« Reply #3 on: August 22, 2012, 11:40:47 PM »
#1 was more for evidence purposes than alarm purposes. If someone breaks in and manages to shoot me before I shoot them, I'd like the cops to have an easy case.

#2 - Yeah, most newer routers have that feature. Mine is older though...so I had to do it manually.

I agree an entry box would be easiest for entering the IP...but ease of use for the lay person would be key, I'd think. Most people lack our computer skills...by a good deal.

I know the older versions of icamsource allowed/required multiple instances...and you didn't even have to rename the executable. I'm not sure if the newer versions allow multiple instances to run, and what the system performance impact might be (vs. having multiple feeds in once instance). But they already have the ground work laid with the multiple camera tabs in one instance of icamsource, so if they added the feature, it seems like it would be very easy to implement on a per-camera basis. That would make it easier for the end users as well, I'd think. Running multiple instances can be kind of a pain.

Maybe you can edit the subject of this thread to "feature request" so SKJM will be sure to read it and consider it.

Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 2358
    • View Profile
Re: FEATURE REQUEST: personal proximity auto start / stop
« Reply #4 on: August 23, 2012, 10:29:17 AM »
darne11, does this setup work well for you? I thought that the iPhone only connects to a WiFi network if it's actively doing something and one is available ... That it doesn't maintain a WiFi connection indefinitely.

I just tried it with my iPhone, actually, and it does drop the WiFi connection. The phone was pingable, but after a minute or so of idly sitting on my desk I am no longer able to ping it. As soon as I press the home button it re-connects, but it doesn't maintain the WiFi connection while idle.
« Last Edit: August 23, 2012, 10:31:12 AM by Stefan »

darne11

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FEATURE REQUEST: personal proximity auto start / stop
« Reply #5 on: August 23, 2012, 12:20:44 PM »
Iphones maintain the wifi connection when plugged in. With older versions of iOS they maintained the Wifi connection always, but as of iOS 5 (I think..) the data switches to cellular when in "standby mode" (for push notifications it needs an active connection) . Pretty lame feature IMO - Apple might change this back in future versions, many people have been complaining about it. I havent checked, but I dont think this would be an issue for an android device.

For me it works well, as I usually have my phone plugged in or am using it while at home. It does go into standby, icamsource comes on and usually detects movement right away as im home doing stuff, then sends the push notification via 3G to my phone which takes it out of standby and reconnects to the wifi (pingable again). It also makes the notification sound reminding me to dock my phone.

Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 2358
    • View Profile
Re: FEATURE REQUEST: personal proximity auto start / stop
« Reply #6 on: August 23, 2012, 03:34:32 PM »
I see what you're saying ... After waiting a few minutes I can still ping my "standby mode" phone when it's plugged in. It's probably a power-saving feature so that it doesn't have to keep both antennas on simultaneously.

OUAnthony

  • Hero Member
  • *****
  • Posts: 801
    • View Profile
Re: FEATURE REQUEST: personal proximity auto start / stop
« Reply #7 on: August 24, 2012, 06:16:16 AM »
Hmm, that puts a damper on the idea. :( Could use bluetooth...but the range would only be 10 meters max...plus the battery hit. I hope Apple changes it back to the way it used to be...or at least give users the choice to change it so wifi is always connected. I did some reading and someone suggested disabling cellular data would force the wifi to stay connected. haha Some solution, huh?