Author Topic: iViri geofence not always updating  (Read 3429 times)

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
iViri geofence not always updating
« on: May 08, 2014, 11:41:24 am »
I  still on v1.2, and occasionally the location or geofence does not update, meaning its not registering that my wiofe has left the house or is back home. I have set the home geofence at 350m, which works perfectly with my Android, and most of the time with her iPhone too. Just the occasional glitch. For example today she has been home now for 30 minutes, but the geofence (my virtual switch) is still showing as away. I have checked her location via find my iPhone a couple of minutes after she has arrived back home, and that was showing her at home. Is there a way of forcing a update to the location ? I thought if I check the iPhonelocation in find my iPhone that might update the geofence, but that is not the case as I have checked multiple times, and it is still showing as away

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5402
  • Karma: +144/-299
Re: iViri geofence not always updating
« Reply #1 on: May 08, 2014, 12:46:42 pm »
I  still on v1.2, and occasionally the location or geofence does not update, meaning its not registering that my wiofe has left the house or is back home. I have set the home geofence at 350m, which works perfectly with my Android, and most of the time with her iPhone too. Just the occasional glitch. For example today she has been home now for 30 minutes, but the geofence (my virtual switch) is still showing as away. I have checked her location via find my iPhone a couple of minutes after she has arrived back home, and that was showing her at home. Is there a way of forcing a update to the location ? I thought if I check the iPhonelocation in find my iPhone that might update the geofence, but that is not the case as I have checked multiple times, and it is still showing as away

Following for info.

Offline shmixx

  • Full Member
  • ***
  • Posts: 171
  • Karma: +2/-1
Re: iViri geofence not always updating
« Reply #2 on: May 08, 2014, 01:36:06 pm »
@mikee123

Updating your location by checking with FinyMyiPhone won't update the geofence. I've run into some of these glitches myself. I believe 1.2 had ironed out the issues where it was related to something in the app not catching the Geo properly. It essentially would work for awhile with no issue, then suddenly after a period of time it was almost as if the Geo timed out (talking like a week here, not a few hours). If this wasn't fully resolved in 1.2, the 1.3 update will definitely take care of it.

Another thing to be aware of is Vera Restarts. I have RichardT's VeraAlerts plugin running which notifies me when there are Vera Restarts/Startups. This can indicate a reason why the automation is not quite functioning as expected. I've had this happen a few times, and so I've added the 2 phones to my Dashboard view when this fluke does happen to manually update it. The problem here, is that the geofence may be interacted with from the phone, but due to the timing of the restart, it may not register, register while the Vera is starting, or a multitude of chicken and egg type scenarios. Further fix for this is coming in 1.3 I believe as the dev has changed some of the way the code is handled, including error checking and validation of actions.

One way to help identify the difference between the two cases above, would be to make sure you have the local notifications turned on in the app. I personally do not, as I find it repetitive to have 4 different alerts coming through to simply indicate we are home. But for troubleshooting purposes, you may find that to work. Another way you may find if it is one or the other, is if the phone that has not updated, is updated upon leaving and returning again. In this situation, my suggestion for manually fixing the update is a workable solution.

Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #3 on: May 08, 2014, 08:48:33 pm »
Thanks for jumping on that @shmixx.... As he said in v1.3 I removed code that lingered from a pre-release decision but was never deemed to be an issue until reports started coming in.  Basically iViri used to use GPS as a way to determine what scene/switch/etc to activate and then I noticed the battery drain was as bad if not worse than using the iphone locator plugin, so I decided to jump over to geofences.  When it was using GPS I had a setting in the Geofence Object that would stop the device from sending an exit or entrance more than once saying you were already within the region our outside of it.  If this ever gets missed for whatever reason (wife on the phone when the region is crossed or device is off, etc.) it can take a week or more to get back in sync with your correct correlation with the region.  So this code is now removed, whenever you exit it will fire and the same for an entrance and there is no checking on what the previous state of the object is.

I am an huge apple fan so this may sound biased but I will say that I used android for years prior to my company allowing the iphone so I do have some experience on the android platform.  Apple cares more about its user base and they don't want anything being done by a developer in an app to ruin that user experience, so they are very strict on how an app behaves, especially in the background.  So with that said I have added some additional stuff to v1.3 to come up with some extra checks, if it cannot connect to a data network (wifi, 3g, 4g, lte, etc...) it will send you a local notification to go manually execute it in the app, so for people on verizon that are on the phone when they leave home they can trigger this manually after they end their phone call instead of it being missed.  Also if it can connect but receives a failure it will try over and over for up to 3 minutes until it gets a successful response.  If it hits the 3 minute mark there is nothing I can do because that is the most time apple will give me as a background process, but this should be good enough as it has made my setup way more stable.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: iViri geofence not always updating
« Reply #4 on: May 09, 2014, 01:29:23 am »
OK that sounds good, any idea of when v1.3 will be available ? I know you submitted it to the app store already

Sent from my GT-I9505 using Tapatalk


Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #5 on: May 09, 2014, 10:02:15 am »
OK that sounds good, any idea of when v1.3 will be available ? I know you submitted it to the app store already

I don't ever know when it will be approved but the average is about a week.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: iViri geofence not always updating
« Reply #6 on: June 11, 2014, 08:18:01 am »
I had upgraded to 1.30 as soon as it was available, and now on 1.31
It works about 90% of the time, detecting when my wife leaves or exits the home geofence (which is set to 325m). But there is still the 10% of the time where it doesn't. Today, she left the house, detected and turned the virtual switch to away. Then I see her ping sensor triggered, but the phone still in away mode. So gave her a call to see where she was, and she was home, and has been now for a couple of hours, but the phone is still away. On other occasions it doesn't trigger when she leaves the house.
I do not want to complain, as I am very happy with the app. Just wanted to have some feedback of your thoughts.
I was thinking of using PLEG to turn the phone virtual switch to home when the ping sensor is triggered, sort of as a backup if the geofence trigger fails, and have another PLEG logic to turn the phone virtual switch to away when the ping sensor has not been triggered for a while.
Is that likely to cause problems ? Is there anything I could do to trigger an update to the geofence when this happens, like rebooting the iphone ? I think the problem is on the iphone side, not iViri

Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #7 on: June 11, 2014, 11:01:56 am »
I had upgraded to 1.30 as soon as it was available, and now on 1.31
It works about 90% of the time, detecting when my wife leaves or exits the home geofence (which is set to 325m). But there is still the 10% of the time where it doesn't. Today, she left the house, detected and turned the virtual switch to away. Then I see her ping sensor triggered, but the phone still in away mode. So gave her a call to see where she was, and she was home, and has been now for a couple of hours, but the phone is still away. On other occasions it doesn't trigger when she leaves the house.
I do not want to complain, as I am very happy with the app. Just wanted to have some feedback of your thoughts.
I was thinking of using PLEG to turn the phone virtual switch to home when the ping sensor is triggered, sort of as a backup if the geofence trigger fails, and have another PLEG logic to turn the phone virtual switch to away when the ping sensor has not been triggered for a while.
Is that likely to cause problems ? Is there anything I could do to trigger an update to the geofence when this happens, like rebooting the iphone ? I think the problem is on the iphone side, not iViri

Here is the big question.  Who is your service provider and can you confirm that she was no using the phone during the region crossing?  There is a notification that comes if your network provider doesn't allow network usage and phone calls at the same time, so you just need to run that notification.  After I added this functionality in v1.3 and above to notify if network wasn't available and allow for the manual executing of the geofence my wife and I have been 100% accurate as long as we manually run that update.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: iViri geofence not always updating
« Reply #8 on: June 11, 2014, 11:27:32 am »
service provider is Orange (UK). Just asked my wife and she was not on the phone at all on her way back. As there were a few instances where it was not updated I cannot imagine that she would have been on the phone on all of them, maybe on some. I have to try to find out if Orange UK allows data and phone calls at the same time (she has an iphone 4), I am not sure about the notification you were talking about, never seen it. My wife says she never had a notification, and network coverage near our house is normally good. So if I understand it right, if there was a problem with network cover while iViri is trying to transmit a message (command) she should have a notification ?

Just had a look in google, apparently on all UK 3G networks data and voice simultaneous should work
« Last Edit: June 11, 2014, 11:40:14 am by mikee123 »

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5402
  • Karma: +144/-299
Re: iViri geofence not always updating
« Reply #9 on: June 11, 2014, 01:28:43 pm »
Here is the big question.  Who is your service provider and can you confirm that she was no using the phone during the region crossing?  There is a notification that comes if your network provider doesn't allow network usage and phone calls at the same time, so you just need to run that notification.  After I added this functionality in v1.3 and above to notify if network wasn't available and allow for the manual executing of the geofence my wife and I have been 100% accurate as long as we manually run that update.

On Android apps even if your off the network (say leaving the house switching from wifi to cell, or on the phone, or just plane no cell reception in that area) The app will attempt to resend for so long and check for the change to make sure the switch happened. Does Iviri not do this? Does it just send once when the line if crossed then say done no matter what happened?   

Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #10 on: June 11, 2014, 01:41:27 pm »
Here is the big question.  Who is your service provider and can you confirm that she was no using the phone during the region crossing?  There is a notification that comes if your network provider doesn't allow network usage and phone calls at the same time, so you just need to run that notification.  After I added this functionality in v1.3 and above to notify if network wasn't available and allow for the manual executing of the geofence my wife and I have been 100% accurate as long as we manually run that update.

On Android apps even if your off the network (say leaving the house switching from wifi to cell, or on the phone, or just plane no cell reception in that area) The app will attempt to resend for so long and check for the change to make sure the switch happened. Does Iviri not do this? Does it just send once when the line if crossed then say done no matter what happened?   

This is not a limitation of iViri but rather a limitation of what the iOS will allow an app to do in the background.  iViri if it does detect a network connection it will attempt to make a successful call for 3 minutes in the background before iOS forcefully closes the app in the background.  If iViri doesn't detect a network connection it will then send the notification to the user to allow them to manually execute the crossing.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5402
  • Karma: +144/-299
Re: iViri geofence not always updating
« Reply #11 on: June 11, 2014, 02:20:11 pm »
This is not a limitation of iViri but rather a limitation of what the iOS will allow an app to do in the background.  iViri if it does detect a network connection it will attempt to make a successful call for 3 minutes in the background before iOS forcefully closes the app in the background.  If iViri doesn't detect a network connection it will then send the notification to the user to allow them to manually execute the crossing.

More limitations of APPLE products.........  ;D

Well 3 mins sounds like a reasonable amount of time tho. No Wifi to cell tower switch takes that long and when leaving the house you can be a mile or two away in 3 min. Not hitting a cell tower by then would be hard to imagine.

With that said my father has the same problem with Iviri on his Iphone. I had to widen up the area to help with some of this, but there is the local grocery store on the back side of the house a block or 2 over and now I fighting keeping it from not tripping when he is there but tripping when he gets home. It definitely doesn't seem to be as accurate as some of the Android apps I have used (might be IOS issue more then anything).

If Iviri checks for a status update for up to 3 min. you think a delay might be possible but standing in your house on wifi without the switch ever happening shouldn't be even possible if its using 2 way communication. That is assuming your GPS is showing you where you actually are and not a mile over.

Again with apps on Andriod the geofence setup shows your current poistion a round ring of where the fence is and a map of either satellite or regular 3d view. So I can see everything that's going on. If I need to trouble shoot open the app and see if it shows me (GPS) somewhere else on the map, if the fence size is just to small, or where the actual fence starts and stops.

With Iviri It's just sort of a Guess game right now. Not sure if it can be fixed or not, but it sure would help out. 
« Last Edit: June 11, 2014, 02:23:19 pm by integlikewhoa »

Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #12 on: June 11, 2014, 02:35:01 pm »
iViri doesn't check every 3 minutes for a status update, what happens is you register a region for the Core Location services for the iOS to monitor for.  The logic of how often it monitors and how frequent updates are performed are hidden from the programmer and left up to Apples logic.  All iViri does is register for the call back on the region crossing.  So the Core Location services by Apple make a call back to any app that is requesting updates for region monitoring and when that call back happens it wakes or launches the iViri app to process this region crossing.  The timer starts there and the app has 3 minutes to process it before Apple says your taking too long and kills the background processing.  This is why I put in the logic that if there was no valid connection available to not even attempt the crossing but rather prompt the user and say a region was crossed but iViri couldn't reach a network connection, do you want to cross this region manually, yes/no....  The 2 URL api's provided by apple do offer timeouts and what not but what I found from testing and depending where the connection got hung up it wouldn't always time out and more often then not the iOS would kill iViri in the background saying it was taking too long to process.  What I could do is check for a network connection 3 times and sleep 10 seconds between each time and then send the notification to user if it wasn't able to be established.

I can understand the frustrations of user and I wish it was something in my code that I could change to make it 100% accurate for everyone.  However, I am at the mercy of your service provider (how many towers are in your area) and the API Providers (Apple in this case) on how often they search for region crossing.  One substantial thing I can tell users, if you disable your wifi you will have a drastic reduction in accuracy of the region crossings.  So if you are disabling wifi because you want to save battery and even if you are not connected to a wifi your accuracy will be a lot better if you just keep it enabled all the time.  Also I haven't seen any noticeable drain from leaving wifi enabled even if I am no where near a wifi network!.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5402
  • Karma: +144/-299
Re: iViri geofence not always updating
« Reply #13 on: June 11, 2014, 03:46:41 pm »
iViri doesn't check every 3 minutes for a status update, what happens is you register a region for the Core Location services for the iOS to monitor for.  The logic of how often it monitors and how frequent updates are performed are hidden from the programmer and left up to Apples logic.  All iViri does is register for the call back on the region crossing.  So the Core Location services by Apple make a call back to any app that is requesting updates for region monitoring and when that call back happens it wakes or launches the iViri app to process this region crossing.  The timer starts there and the app has 3 minutes to process it before Apple says your taking too long and kills the background processing.  This is why I put in the logic that if there was no valid connection available to not even attempt the crossing but rather prompt the user and say a region was crossed but iViri couldn't reach a network connection, do you want to cross this region manually, yes/no....  The 2 URL api's provided by apple do offer timeouts and what not but what I found from testing and depending where the connection got hung up it wouldn't always time out and more often then not the iOS would kill iViri in the background saying it was taking too long to process.  What I could do is check for a network connection 3 times and sleep 10 seconds between each time and then send the notification to user if it wasn't able to be established.

I can understand the frustrations of user and I wish it was something in my code that I could change to make it 100% accurate for everyone.  However, I am at the mercy of your service provider (how many towers are in your area) and the API Providers (Apple in this case) on how often they search for region crossing.  One substantial thing I can tell users, if you disable your wifi you will have a drastic reduction in accuracy of the region crossings.  So if you are disabling wifi because you want to save battery and even if you are not connected to a wifi your accuracy will be a lot better if you just keep it enabled all the time.  Also I haven't seen any noticeable drain from leaving wifi enabled even if I am no where near a wifi network!.

Well both the Iphone and Note 3 are on "SPRINT" so towers might be an issue for some. I also use DD-WRT checking for the MAC to register on the Network (fathers house needs some AP's setup tho as the property is too big and WIFI drops off before end of driveway or in back garage, so I currently rely mostly on Geofence at this house). Same like a Ping sensor. I'm also a firm believer that there is no reason to turn off Wifi. So Wifi is never off on any these devices.

That really only leaves the APP and the Operating system between the 5s and Note 3 from what I see as possible problems with my issue.

Ofcourse I'm not a big Apple fan (I do own and use a few devices tho) but I think because of the limitations they currently have put on you as an App maker it currently might not be able to get more accurate then what it is.

On Android we also have options to setup a "RAPID update". So we can set a larger fence and run the rapid update (how ever long we have inputted into the setting) witch will get phone awake and checking for location changes every few seconds looking for us to cross that next fence (which is your main or home fence) to help prevent unwanted delays.

Any of this possible?

Offline jpete7683

  • Moderator
  • Sr. Member
  • *****
  • Posts: 363
  • Karma: +10/-9
Re: iViri geofence not always updating
« Reply #14 on: June 11, 2014, 04:09:26 pm »
The only way it would be possible is if the app was running.  The goal of iViri is so that you don't have to keep the app open.  I will play with the code to see if there is anything I can do but I think the limitation is in the iOS that is causing your issues.  Maybe stuff will get better with iOS 8 but I haven't seen any changes in the release notes or in their WWDC.
I am the developer of iViri.  iViri is available in Apple Store.  Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.