Page 1 of 1
Error using periodic location update trigger
Posted: 14 Sep 2016 12:13
by Econdoc
I am trying to write a flow to alert the user to change phone settings when away from home. First, I am getting an error, which I will describe below. Second, if anyone knows of a better way of doing this, please advise. Here is the gist of my flow:
• Trigger: Periodic Location update (5m) using Balanced, allow in idle/doze
• Condition: Location, 200 meters from home; accept every update (inside); accept on transition - nothing checked.
I occasionally get the following: “Error:: open failed: ENOENT (no such file or directory)”
What is causing the error?
It would be useful to know if the location trigger fails. I would then know that I am not home. Is there a way to trap when the trigger fails to get the current location?
Is there a better way of doing this?
A non-related question: Is there a way to put a notification on the screen that stays there until dismissed?
Re: Error using periodic location update trigger
Posted: 14 Sep 2016 19:08
by Martin
Hi,
The description of the flow sounds ok, but this highly depends on your environment. The action to execute should be added to the condition on the false branch since the condition will evaluate to true whenever the location is inside the defined area. It might also be helpful to select a minimum accuracy in the periodic location update trigger of 500 meters since the trigger could also provide less accurate locations depending on environment and device settings etc.
If you want to check every single location, it might be better to use a trigger
Periodic Timer: 5m and then use action
Init Variable Location since this action will throw an error when the location can not be fetched within a certain duration. You can also handle the error in your flow by attaching an additional action to the location action and then switching the connection type to 'Exception'.
It sounds like Automagic tries to write something to a file that does not exist, respectively the parent directory of the file might not exist. Please send the log to me to
info@automagic4android.com so I can identify the action that's causing this problem and the reason for the error. You can send the log from the flow list using menu->Manage->Log, menu->Send Log.
You can use action
Notification on Statusbar to post a regular notification. Action
Message Dialog might also be an option but I would go with the notification action in most cases.
Regards,
Martin
Re: Error using periodic location update trigger
Posted: 09 Nov 2016 09:59
by heilong
Not to steal a topic, but what are the main differences between Periodic Location Update trigger and Location triggers?
What are some example use cases when one is more suitable than the other?
E.g. SmartUnlock uses Location trigger for the same purpose as OP.
Re: Error using periodic location update trigger
Posted: 10 Nov 2016 20:27
by Martin
The regular location-trigger is meant to be used when you enter/exit a location. The logic of the trigger is entirely handled by the device (Classic) or by Google Play Services (Modern). Either method can work or fail on some devices but the Modern Google Play service option seems to work quite well lately. It might break when Google Play services is updated in the background or it might get more accurate with one of the next updates of Google Play services. Google does not document the way the locations are determined so it might also use nearby bluetooth devices or an indoor positions system to determine your location.
The periodic location update was once meant to be used when you want to record the location periodically to a file or similar. However it's also a good candidate if you want to build your own location detection when the regular location trigger does not work for some reason. For example it's very useful when you want to ignore locations provided by cell towers with a very bad accuracy. You could also use it to build a flow that only executes a few actions when the last three locations have all been within a certain area or when the location did not jump around in the last few minutes etc.
Regards,
Martin
Re: Error using periodic location update trigger
Posted: 10 Nov 2016 22:48
by heilong
Thanks, got it.