Smartphone Radar - Smartphone presence detection (Locked)

Posted on
Sun Nov 18, 2012 7:54 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Smartphone Radar - Smartphone presence detection (Update

hamw wrote:
I thought one might simply change the last line from "plugin.restart()" to something else.... I tried plugin.stop and plugin.disable but neither work. Looking at the documentation...

Correct -- currently stopping or starting a plugin requires UI action, whereas a plugin is allowed to be restarted from python. We haven't decided yet if we want to open up an API for the former (starting/stopping plugins) since we think it is something the end-user should directly control (and not have switched without their knowledge). We are not totally set on that though (yet) so fire away with opinions/logic. Note the reason we already added restart is because it doesn't change the enabled/disabled state of a plugin, so is "safer."

Image

Posted on
Sun Nov 18, 2012 8:05 pm
merchon offline
Posts: 13
Joined: Mar 08, 2006

Re: Smartphone Radar - Smartphone presence detection (Update

When I create a new device I get the following error:


Smartphone Radar Error Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
File "plugin.py", line 68, in deviceUpdated
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Smartphone Radar.indigoPlugin/Contents/Server Plugin/iPresence.py", line 265, in deviceStop
<type 'exceptions.KeyError'>: (752086668,)


With this error I can not get the pluging to ever work, the phone is always shown as home.

Posted on
Sun Nov 18, 2012 8:13 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Hmmmm. I'll check that tomorrow.

Posted on
Mon Nov 19, 2012 7:20 am
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Smartphone Radar - Smartphone presence detection (Update

All,
In regards to the temporarily suspending the SPR plugin... perhaps this could tie into the feature request I made when the plug-in closes to "suspend the states" as they currently are? Maybe I'm looking at it wrong, but to me it is a similar feature... this way the plug-in would always be running, but the states would be suspended. You could even build in a pester in to remind you that the presence states are suspended.

Posted on
Wed Nov 28, 2012 11:58 am
jaj737@gmail.com offline
User avatar
Posts: 22
Joined: Mar 20, 2010
Location: Dallas, Texas

Re: Smartphone Radar - Smartphone presence detection (Update

Ok, need some help. Just upgraded to indigo 6.0
I have 4 iphones as devices.
When trying to setup the router from the smartphone radar configuration window, there is no dropdown for router config?

First screen shot is from my computer and indigo. second from your initial post for set up instructions.

I have a year old time capsule 2 TB, various generation airport express' and a brand new uverse modem/router 3801HGV. My time capsule is set to "off" bridge mode, and "create a wireless network".
Attachments
Screen Shot 2012-11-28 at 12.01.42 PM.png
showing iphone devices and "home"
Screen Shot 2012-11-28 at 12.01.42 PM.png (122.8 KiB) Viewed 4992 times
Screen Shot 2012-11-28 at 10.15.33 AM.png
Screen Shot 2012-11-28 at 10.15.33 AM.png (81.89 KiB) Viewed 4992 times
Screen Shot 2012-11-28 at 10.12.54 AM.png
Screen Shot 2012-11-28 at 10.12.54 AM.png (85.2 KiB) Viewed 4992 times

Posted on
Wed Nov 28, 2012 2:10 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Pull down the "Plugins" menu, select Smartphone Radar, then Configure.

Posted on
Wed Dec 19, 2012 12:25 am
DPattee offline
Posts: 453
Joined: Jan 14, 2004
Location: Redmond, WA

Re: Smartphone Radar - Smartphone presence detection (Update

I just can't get this to work consistently enough to actually 'use it.'

I've got 3 devices defined (an iPad and 2 iPhones). The iPad stays at my house, as does one of the iPhones (my v4 that I just replaced), while my iPhone 5 goes with me when I leave.

All 3 devices are connected to my WiFi, they all are set to connect wirelessly to iTunes (which works, they always show up), and they all are set to poll one or more email accounts every 15 minutes.

They all use static dhcp leases that were set for 1440 minutes, but I did set one of them to a 10 minutes ttl to see if that would make a difference.

Router is a WNDR37 running DD-WRT's 14896 - which is 2 years old but is the latest version listed in their router db.

I've adjusted Smartphone radar's time to be shorter (like 10 minutes) longer (like 30 minutes) and right now it is set to 16 minutes. I also set a trigger to inform me every time the home/away changes via text message so I have an easy timer log. Every day that I ran it they always looked the same:

Me: ipad home 9:48 AM
Me: ipad away 10:04 AM
Me: ipad home 10:48 AM
Me: ipad away 11:04 AM
Me: ipad home 11:48 AM
Me: ipad away 12:04 PM
Me: ipad home 12:48 PM
Me: ipad away 1:04 PM
Me: ipad home 1:48 PM
Me: ipad away 2:04 PM
Me: ipad home 2:48 PM
Me: ipad away 3:04 PM
Me: ipad home 3:48 PM
Me: ipad away 4:04 PM
Me: ipad home 4:48 PM
Me: ipad away 5:05 PM
Me: ipad home 5:48 PM

Nice pattern... after 16 minutes the device goes 'away', and then 44 minutes later it comes 'home' again. For some reason the device is only being recognized hourly...

Posted on
Fri Dec 21, 2012 9:04 pm
dabido offline
Posts: 15
Joined: May 10, 2011

Re: Smartphone Radar - Smartphone presence detection (Update

bluenoise wrote:
Now, the problem: When the iPhones connect to the Express, they are no longer seen by the Extreme. Therefore, the plug-in thinks we're away when we're not.

*****

I figured it out. On the first generation Airport Express, the SNMP community string is the Airport's password. Once I put that into SPR, it was able to fetch the SNMP data from it. I still had trouble deciphering what it got back from the Airport as I could not find my iPhone's MAC address in the output. In fact, I was having trouble getting my iPhone to connect to it at all. Finally, I decided the easiest fix was to get a new Airport Express. I unplugged the old one, plugged in the new one and it automatically set up exactly as I wished. Now, my iPhone connects to it and SPR is able to see that my iPhone is home, whether it's connected to the Airport Extreme or the new Airport Express.


bluenoise:
I previously had my 3 Expresses set to "Join my network" and I never had any issues. The other day I switched the far bedroom Express to "Extend my network" (wirelessly), and it's now dropping any phones in the bedroom from Smartphone Radar.
I'm not sure I follow your solution in the above post- I have a new 2nd gen Express that is set to Extend the network, but it's not working out of the box. What do I have to do exactly?

To complicate things a bit, I'm on Mountain Lion across all my mac's and so I've lost the ability to use Airport Utility 5.6 (i believe...correct me if I'm wrong)

Thanks again for your help!

Posted on
Fri Dec 21, 2012 9:10 pm
dabido offline
Posts: 15
Joined: May 10, 2011

Re: Smartphone Radar - Smartphone presence detection (Update

dabido wrote:
To complicate things a bit, I'm on Mountain Lion across all my mac's and so I've lost the ability to use Airport Utility 5.6 (i believe...correct me if I'm wrong)



Update: Found this guy who automated the "cheat" to install the Old Airport Utility 5.6 on Mountain Lion:
http://frank.is/mountain-lion-and-the-old-airport-utility/

Now, what to do?

Posted on
Sun Dec 23, 2012 2:29 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

DPattee wrote:
I just can't get this to work consistently enough to actually 'use it.'

I've got 3 devices defined (an iPad and 2 iPhones). The iPad stays at my house, as does one of the iPhones (my v4 that I just replaced), while my iPhone 5 goes with me when I leave.

All 3 devices are connected to my WiFi, they all are set to connect wirelessly to iTunes (which works, they always show up), and they all are set to poll one or more email accounts every 15 minutes.

They all use static dhcp leases that were set for 1440 minutes, but I did set one of them to a 10 minutes ttl to see if that would make a difference.

Router is a WNDR37 running DD-WRT's 14896 - which is 2 years old but is the latest version listed in their router db.


DPattee,

I'm assuming you're using DD-WRT's syslog option to send the logs to SPR? Are you indeed seeing the IP's or MAC addresses of your phones in the logs if you turn on log output in SPR's config? It sounds like it is working since you are seeing the phones as home. What might be happening is the log is not verbose enough, or there is a limit of how many lines to log per minute. With that limit set it will often log a lot of other activity like torrents or web surfing, but then max out the per minute log limit and drop any log messages for the phones. I used this little trick in Tomato to guarantee my phones would get logged, you should be able to do the same thing in DDWRT.

In the logging setup, I just have logging enabled, with the only events being logged DHCP Client request. Connect logging is disabled. Then in the Scrips tab, under Firewall, I put the following iptables line:

iptables -I FORWARD -s 192.168.5.76 -m limit --limit 1/minute --limit-burst 1 -j LOG

That line tells iptables to log traffic for one of that IP address at a maximum of one line per minute. You have to have static IPs set for each phone for this to work. This guarantees the phone traffic will get logged without flooding the logs with connections from the phones or other devices. If you have more phones just add another line with the appropriate IP address.

Posted on
Sun Dec 23, 2012 2:34 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

bluenoise wrote:
I previously had my 3 Expresses set to "Join my network" and I never had any issues. The other day I switched the far bedroom Express to "Extend my network" (wirelessly), and it's now dropping any phones in the bedroom from Smartphone Radar.


I'm assuming that each airport's IP address and SNMP password have been added to the plugin's config (separated by commas)? It has to poll each Airport base station separately to see which clients are attached to which station.

Posted on
Sun Dec 23, 2012 3:23 pm
DPattee offline
Posts: 453
Joined: Jan 14, 2004
Location: Redmond, WA

Re: Smartphone Radar - Smartphone presence detection (Update

Yes, using DD-WRT's built-in syslogd feature with the remote server set to SPR's computer/port. There were no other options in the UI to set what should/shouldn't be logged.

I'll try enabling the firewall logging so I can use that iptables suggestion.

Posted on
Thu Jan 03, 2013 6:22 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: Smartphone Radar - Smartphone presence detection (Update

Just got the latest Smartphone Radar working on my Airport Extreme firmware 7.6.1 talking to a MacMini running OSX 10.7.5.

I had to use some commands to start the syslog on the MacMini listing for incoming syslog data, but they were pretty straight forward. I'm happy to post them if anyone wants them.

I'm running the plugin against two iPhone 4S phones, and it works like a champ so far.

Hats off to Travis!

Dave

Posted on
Tue Jan 15, 2013 7:44 pm
jrickmd offline
Posts: 109
Joined: Jun 01, 2003
Location: Texas

Re: Smartphone Radar - Smartphone presence detection (Update

Getting an occassional error that seems to be present with a server lockup... not sure it's the plugins fault yet, but I get this error repeatedly in the log:

Code: Select all
2013-01-15 12:42:12   Smartphone Radar Error   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 86, in runConcurrentThread
  File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Smartphone Radar.indigoPlugin/Contents/Server Plugin/iPresence.py", line 517, in startComm
  File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Smartphone Radar.indigoPlugin/Contents/Server Plugin/iPresence.py", line 405, in killProcesses
<type 'exceptions.OSError'>: (3, 'No such process')


Any ideas?

Thanks,

Rick

Posted on
Tue Jan 15, 2013 8:30 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Hmmm. I'd need the log lines that show up when the error first occurs. The ones that repeat over and over aren't of much use unfortunately.

Who is online

Users browsing this forum: No registered users and 2 guests