Smartphone Radar - Smartphone presence detection (Locked)

Smartphone presence detection.
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by matt (support) »

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
merchon
Posts: 13
Joined: Wed Mar 08, 2006 8:30 pm

Re: Smartphone Radar - Smartphone presence detection (Update

Post by merchon »

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.
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by travisc »

Hmmmm. I'll check that tomorrow.
Dewster35
Posts: 1033
Joined: Tue Jul 06, 2010 6:29 pm
Location: Petoskey, MI

Re: Smartphone Radar - Smartphone presence detection (Update

Post by Dewster35 »

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.
User avatar
[email protected]
Posts: 22
Joined: Sat Mar 20, 2010 1:44 pm
Location: Dallas, Texas

Re: Smartphone Radar - Smartphone presence detection (Update

Post by [email protected] »

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
showing iphone devices and &quot;home&quot;
showing iphone devices and "home"
Screen Shot 2012-11-28 at 12.01.42 PM.png (122.8 KiB) Viewed 6701 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 6701 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 6701 times
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by travisc »

Pull down the "Plugins" menu, select Smartphone Radar, then Configure.
DPattee
Posts: 455
Joined: Wed Jan 14, 2004 8:56 pm

Re: Smartphone Radar - Smartphone presence detection (Update

Post by DPattee »

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...
dabido
Posts: 15
Joined: Tue May 10, 2011 6:09 pm

Re: Smartphone Radar - Smartphone presence detection (Update

Post by dabido »

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!
dabido
Posts: 15
Joined: Tue May 10, 2011 6:09 pm

Re: Smartphone Radar - Smartphone presence detection (Update

Post by dabido »

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-o ... t-utility/

Now, what to do?
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by travisc »

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.
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by travisc »

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.
DPattee
Posts: 455
Joined: Wed Jan 14, 2004 8:56 pm

Re: Smartphone Radar - Smartphone presence detection (Update

Post by DPattee »

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.
User avatar
dstrickler
Posts: 343
Joined: Fri Oct 08, 2010 4:58 pm
Location: Boston, MA

Re: Smartphone Radar - Smartphone presence detection (Update

Post by dstrickler »

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
jrickmd
Posts: 109
Joined: Sun Jun 01, 2003 3:21 pm
Location: Texas

Re: Smartphone Radar - Smartphone presence detection (Update

Post by jrickmd »

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
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: Smartphone Radar - Smartphone presence detection (Update

Post by travisc »

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.
Locked

Return to “Smartphone Radar”