owntracks / ios

OwnTracks' iPhone App
http://owntracks.org
Other
331 stars 91 forks source link

Issue with background updates #441

Closed frankreckt closed 7 years ago

frankreckt commented 7 years ago

Hi,

I've set up owntracks to communicate with my own server using the http mode. Update mode is set to "Significant Location Change". But there are no location updates even when I drive with car a longer distance. Opening the app imediatly updates the location and sends it to the server.

The app has the permission to run in background and to always obtain the current location.

Device is a iPhone 7 with iOS 7.2

jpmens commented 7 years ago

iOS 7.2? Really? ;-)

After a while you ought to see a badge on the OwnTracks icon indicating a bunch of outstanding updates. If you open the app, does your HTTP endpoint then get those updates (plural)? What I'm trying to get at: does your iPhone have connectivity while driving?

frankreckt commented 7 years ago

Aaah, you've got me. iOS 10.2.1 of course.... :-)

I had always a very goo connectivity over LTE. And I didn't see any badge informations. So there were no outstanding location updates transfered but onyl the current one.

jpmens commented 7 years ago

How are you determining that only one update is sent? Are you using our Recorder?

frankreckt commented 7 years ago

No, at the moment I use a custom php script so I can exactly do a monitoring if the app is connecting to the server or not

JonSilver commented 7 years ago

We've all but stopped using OwnTracks because it only reliably sends location updates when the user loads the app.

jpmens commented 7 years ago

Is it possible that you are swiping the app out?

I'm seeing great reliability with the iOS app (3 family members + 2 friends), and I can tell you that of my family members nobody launches the app; even so I permanently see their position.

goebelmeier commented 7 years ago

I'm new to OwnTracks, mainly using it in conjunction with openHAB. I'm currently running iPhone 6 with iOS 10.3.1. I will install the Recorder tomorrow for better debugging. Until this i'm using mosquitto-sub subscribed to owntracks/# and piping to a text file. OwnTracks is running in significant changes mode. From time to time i'm getting correct Enter or Leave push notifications but no owntracks events in my mosquitto-sub log.

Maybe iOS wake up time is too short for reliable event transport?

jpmens commented 7 years ago

@goebelmeier If you are getting correct enter/leave notifications, geofencing is working. Is it possible that your Mosquitto has an incorrect ACL for your device so that not all publishes can be submitted? The publishes used by iOS are listed at the top of this Booklet page, and as such there must be an ACL for your user/device allowing an MQTT publish there.

goebelmeier commented 7 years ago

I will check that tomorrow, but this would be odd, because i'm getting events from time to time but mostly they won't appear in my log and openHAB doesn't change the presence switch, too.

rjp commented 7 years ago

I'm getting push notifications for enter/leave my local geofence but it's missing ~100% of location points (eg. today I got one in 4 hours of being outside this geofence). However I'm running 10.3.3 beta 2 (14G5037b) which may be interfering - Human seems to not be getting GPS data properly either.

ckrey commented 7 years ago

9.5.9 is in the app store, which should fix the background problems with iPhone 6 / 7. #462

ljsvv commented 7 years ago

Unfortunately no events to the server, I do get notifications on my iPhone that I enter or leave a zone. Using a iPhone 6S Plus on iOS 10.3.2, Owntracks 9.5.9...

When manually publishing my location to the server I do see some incoming messages.

rjp commented 7 years ago

I am also having random loss of events - patchy rather than total. However I am running iOS 11b2 which may well be interfering in other ways.

parneli commented 7 years ago

Just a data point to which I may be seeing some of the behaviour above and some other worrying things. I have been running owntracks for 6 months with various versions and it has been pretty solid running in background with significant change mode, on 2 x iPhone 6S with a Geofence working correctly. It has been great and thankyou for the app!

Something has happened in the last 2 weeks which may involve updating to iOS 10.3.2 and/or Owntracks 9.5.9 to which I am now seeing very unusual behaviour. Firstly, after correctly leaving the geofence the next significant move seem to put us back at the Geofence even thought we were nowhere near it (ie. false positive for home). Have deleted the app and set it back up to now and have recreated the problem. Additionally today with one test it didn't publish at all until we opened and pushed location, so I am not sure what is going on.

rjp commented 7 years ago

11b2 with 9.5.9 is now only getting points for a brief period after a geofence notification.

parneli commented 7 years ago

So is this a confirmed bug with a version / IOS combination ? Is it a IOS fault or change in behavior?

rjp commented 7 years ago

11b3 (15A5318g) with 9.6.1 seems to have a stable background update for me today - has logged every part of my journeys.

ckrey commented 7 years ago

Thank you @rjp!

As for the other participants. Please check background updates with 9.6.1

parneli commented 7 years ago

11b3 (15A5318g) with 9.6.1 does NOT work for me on a clean iphone 6S with 9.6.1, as above I am getting enter/exit notifications but no publishes to MQTT. To confirm its not something with my setup I have now tested with a cloud MQTT server and am seeing the same thing, manual publishes work. As this started to happen around the 10.2.1 update, I would suggest the older slower phones are not getting enough time for Owntracks to publish, that would be my guess? But unfortunately for me I will have to stick with move move for now or maybe look to get new phones.

ckrey commented 7 years ago

This is an issue we just fixed with 9.6.2

ckrey commented 7 years ago

The initial config used for Public mode ehrn installed fresh were not overridden when switching to private mode.

Fix: 1) Install from fresh 9.6.2 2) Follow the manual steps given in #472 3) Export your settings, correct with editor, sent and import setting back to the phone

Sorry for the invonvenience

parneli commented 7 years ago

Thankyou Christoph!! Confirmed with fresh install with 9.6.2 and 11b3 (15A5318g) on iphone 6S working as expected again correctly publishing in "Significant Location Change" mode with geofences etc.. I exported the file and checked and it matched your settings in #472 already so I didn't have to change anything. I do note however In my config.otrc I see "pubQos" : 1, However in your comments you note it should be "pubQos":true, . Probably a version change or doesn't matter? Anyway a happy user once gain here, thankyou for the great app!

ckrey commented 7 years ago

Thanks @parneli I changed the wrong comment

rjp commented 7 years ago

Unfortunately, on 11b6 (15A5354b) with Owntracks 9.6.2, this is back to only delivering locations for a short period after a geofence is triggered.

ckrey commented 7 years ago

Blame it on the Beta version you are using

ckrey commented 7 years ago

sorry just kidding, will look into iOS 11 after returning from vacations in 2 weeks

donster22 commented 6 years ago

Hi. I have location settings as "Always" in iOS11 for the OwnTracks app but at least once a day it pops up the red notification badge on the app icon and does not publish any movements to my MQTT server until I've opened the app. I have the app set to significant changes mode. I haven't changed anything else in the app and it used to work flawlessly. Is there anything I am missing? Thanks.

jpmens commented 6 years ago

It is quite possible that a notification is pending; it will be flushed (i.e. published) by the app at the next convenient moment. The reason this happens when you open the app is then, in foreground, the app can immediately connect and publish. (Due to the nature of iOS apps that's not easy at all when app is in background.)

FWIW, I typically have a notification or a few even; they are eventually transmitted.