Smartphone Radar - Smartphone presence detection (Locked)

Posted on
Sat Jun 18, 2011 1:48 am
hammer32 offline
Posts: 66
Joined: May 13, 2006
Location: Copperas Cove, TX

Re: Smartphone Radar - Smartphone presence detection (Update

I've been watching the logs and my TimeCapsule for a bit... I restarted the router about 30 minutes ago.

On the Airport Utility page that shows the wireless signal strength of wireless clients I see my iPhone listed by MAC address, it's been there continuously since the reboot, but searching the web, checking email, using Indigo Touch - nothing makes a log entry (now set at level -7 "Debug"). Smartphone radar show's my iPhone as not having been seen since the router reboot.

My wife's iPhone doesn't show up on the Wireless Clients page continuously. Her's pops in and out every few minutes, corresponding with log entries like these:

Code: Select all
  Smartphone Radar                Router Log: <133>Jun 18 02:34:41 192.168.1.1 house-base-station 80211: Associated with station 7c:c5:37:ec:dd:8f

  Smartphone Radar                Router Log: <133>Jun 18 02:34:41 192.168.1.1 house-base-station 80211: Installed unicast CCMP key for supplicant 7c:c5:37:ec:dd:8f


  Smartphone Radar                Router Log: <133>Jun 18 02:34:55 192.168.1.1 house-base-station 80211: Disassociated with station 7c:c5:37:ec:dd:8f


Most of the day, however, both phones have a Last Seen time of between 0 and 3 minutes ago. It's just every now and then that the behavior changes and they are no longer showing up in the logs.

Both iPhones have push email enabled and also manually check additional imap accounts every 15 minutes. They also have the PushMail app installed and get a "wake up" email sent by Indigo every 10 minutes to 'force' them back onto wifi.

I've been thinking about picking up an additional router just for the iPhones to connect to, that has more robust logging... What do folks recommend? I figure it's probably cheaper than your average Insteon module anyway ;)

Posted on
Sat Jun 18, 2011 6:03 am
loafbread offline
Posts: 137
Joined: May 25, 2009

Re: Smartphone Radar - Smartphone presence detection

travisc wrote:
That's great, thanks!

If you ever notice Smartphone Radar thinking your phones are away when they really are home, it might be because the iPhone is not doing the DHCP every time it connects. When I tested this it was a previous version of iOS, things may have changed by now. But legally the iPhone can usually assume it's leased the address for 24 hours depending on the router's settings. Most of the time it would re-lease every time it connects to the WiFi, but sometimes it wouldn't. To get around that I upped the log level so all network traffic was logged. That can add up to a LOT of logging! I researched a little iptables trick to reduce that. The following iptables command forced my router to log any of activity from my iPhone at most once a minute:

Code: Select all
iptables -I FORWARD -s Travis-iPhone -m limit --limit 1/minute --limit-burst 1 -j LOG


I used this in the Firewall script tab on my Tomato router. But it should work on any linux box that uses iptables.

Thanks for the feedback loafbread.


I have had a couple false "aways". I changed the dhcp lease time to 20 minutes for my iPhones. If I have too many false "aways", I will try your iptables trick.
Thanks

Posted on
Sat Jun 18, 2011 6:39 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

hammer32 wrote:
On the Airport Utility page that shows the wireless signal strength of wireless clients I see my iPhone listed by MAC address, it's been there continuously since the reboot, but searching the web, checking email, using Indigo Touch - nothing makes a log entry (now set at level -7 "Debug"). Smartphone radar show's my iPhone as not having been seen since the router reboot.

Hmmm. Seems the Time Capsule refuses to do any sort of connection logging. That's too bad. Can you adjust the DHCP lease time in there? If you can reduce that to something like 1 hour, then change your Away timeout in SPR to a little over an hour then that might work around this problem. It will force the phones to reassociate with the Time Capsule for another IP address which should force a log entry.

My wife's iPhone doesn't show up on the Wireless Clients page continuously. Her's pops in and out every few minutes, corresponding with log entries like these:

Strange that hers behaves differently than yours.

hammer32 wrote:
I've been thinking about picking up an additional router just for the iPhones to connect to, that has more robust logging... What do folks recommend? I figure it's probably cheaper than your average Insteon module anyway ;)

I've always used a Linksys WRT54GL. The L stands for Linux. They basically sell this model knowing the buyer is going to install Tomato or DD-WRT firmware on it. I use Tomato, it has nice real-time graphing of bandwidth and QoS. Either firmware will add tons of features and allow you to do fun things like increase the wireless output power beyond FCC limits. The WRT54GL router is only wireless G with 100Mb ports. So if you want something super fast for transferring huge files wirelessly then you might want to find another model with wireless N. The initial post shows links where you can get more details.

Posted on
Sat Jun 18, 2011 7:50 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Swancoat wrote:
So a lot of this seems to be working. Unfortunately, it's not detecting my phone. I've picked it up and loaded new web pages. Nothing.

Are you at least seeing the association log message when the phone first connects? You should at least see something similar to what hammer32 is getting.

You can force your phone to re-associate by going into the WiFi list, selecting the network, and choosing Renew Lease.

Posted on
Sat Jun 18, 2011 8:15 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Smartphone Radar - Smartphone presence detection (Update

No new log entries when I renew my lease.

http://nerdhome.jimdo.com

Posted on
Sat Jun 18, 2011 10:11 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Is the log level on the AEBS set to at least "5 - Notice" or higher?

Posted on
Sat Jun 18, 2011 10:17 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Smartphone Radar - Smartphone presence detection (Update

Yep.

http://nerdhome.jimdo.com

Posted on
Sat Jun 18, 2011 10:45 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Swancoat wrote:
Yep.

Hmmm. That's bizarre. Does the AEBS keep outputting any log data at all as it runs or do you just see those few lines at startup?

Posted on
Sun Jun 19, 2011 12:21 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Smartphone Radar - Smartphone presence detection (Update

Well, I plopped down in front of the computer today, and the log states that my iPhone is 'home' and lastSeen = 3.

So now all of a sudden it looks like stuff is happening. FYI, the router logs are basically like reading a foreign language to me. I look for key phrases (my iPhone's MAC address) and that's about all I can read.

I went back to the logs and found my MAC address.
Code: Select all
Jun 19, 2011 1:08:31 PM
  Smartphone Radar                Router Log: <133>Jun 19 13:08:30 10.0.1.1 attic-extreme 80211: Disassociated with station 60:33:4b:f0:59:54


It's popping up a few other places in the history too.
Code: Select all
Jun 19, 2011 1:03:52 PM
  Smartphone Radar                Router Log: <133>Jun 19 13:03:51 10.0.1.1 attic-extreme 80211: Associated with station 60:33:4b:f0:59:54

  Smartphone Radar                Router Log: <133>Jun 19 13:03:51 10.0.1.1 attic-extreme 80211: Installed unicast CCMP key for supplicant 60:33:4b:f0:59:54


However, I whip out my phone and load a web page, and it doesn't seem to prompt a reset to lastSeen or any new log entries.

http://nerdhome.jimdo.com

Posted on
Mon Jun 20, 2011 5:41 am
loafbread offline
Posts: 137
Joined: May 25, 2009

Re: Smartphone Radar - Smartphone presence detection (Update

Swancoat,

"Associated" is when your iPhone connects its wireless interface to your AirPort access point. "Disassociated" is when it disconnects. I found that those actions do not happen often enough or with enough predictability to be useful to Smartphone Radar. For instance, when the iPhone is connected to a charger, like at night, the iPhone stays associated, it never disassociates so there are no log entries for Smartphone Radar to use.

Posted on
Tue Jun 21, 2011 9:34 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Smartphone Radar - Smartphone presence detection (Update

Looks like Apple has an updated Airport Express in the pipe... (Time Capsule announced today, new AEBS widely expected). Hopefully this thing does a bit better on the logging!

http://nerdhome.jimdo.com

Posted on
Tue Jun 28, 2011 9:27 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Version 0.9.2 Released:
- Phone home/away states now show up correctly in Indigo's Device List. Unfortunately the device has to be deleted and recreated for this fix to take effect.

Posted on
Wed Jun 29, 2011 7:10 pm
loafbread offline
Posts: 137
Joined: May 25, 2009

Re: Smartphone Radar - Smartphone presence detection (Update

Does deleting and re-creating the devices change the variable IDs? I have the variables in a lot of places. Before I delete the devices, I want to be prepared if I am going to have to find all my variable locations.

by the way... I love Smartphone Radar. It has been working flawlessly.

Posted on
Wed Jun 29, 2011 7:21 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

loafbread wrote:
Does deleting and re-creating the devices change the variable IDs? I have the variables in a lot of places. Before I delete the devices, I want to be prepared if I am going to have to find all my variable locations.

Smartphone Radar actually uses the phone's Device Name to create and reference the variable so you should be fine as long as you give the phone the exact same name. Eventually I'll change it to reference by ID so users can rename the variables. You will however have to recreate any triggers that reference the phone's old device.

loafbread wrote:
by the way... I love Smartphone Radar. It has been working flawlessly.

Great, thanks! :D

Posted on
Wed Jun 29, 2011 7:32 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Smartphone Radar - Smartphone presence detection (Update

Instead of deleting and recreating, try changing the Device type to an X10 appliance module, OK out of the dialog, then switch back and change it back to the plugin's type. That should re-create the Device but the device ID will be the same (not that it matters since it currently is referenced in the plugin by name, but the general technique of toggling between 2 device types is useful to know).

Image

Page 5 of 23 1, 2, 3, 4, 5, 6, 7, 8 ... 23

Who is online

Users browsing this forum: No registered users and 2 guests