Trigger reliability?

Post your questions and help other users.

Moderator: Martin

Post Reply
fractals
Posts: 11
Joined: 12 Mar 2013 15:27

Trigger reliability?

Post by fractals » 14 Mar 2013 11:00

It looks like the trigger "WiFi Disconnected" is erratic. I assume the trigger is an instant event reported by Android on WiFi disconnect, which in theory (and in my case, in practice) may cause Automagic to actually miss the event and not initiate the flow based on that trigger.

Would it be possible to add a NOT condition to every/most trigger(s)? In that way (and in this case), Automagic would evaluate the state of not being connected to WiFi rather than the instant of disconnection from WiFi, hence less chance of missing that event/initiating flows that depend on that trigger.

I have Automagic running in the foreground at all times so this is probably not an issue of resources.

I'm aware that I could check for a given access point with the Periodic Timer trigger and a 'WiFi connected' condition but I don't want to since this would be fixing something that should work in the first place.

Thanks for your comments!

User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Re: Trigger reliability?

Post by giovag7 » 14 Mar 2013 12:30

I too have noticed that sometimes triggers are lost, for example wifi connected/disconnected, BT conn./disc., Gleoo recording or not.. etc.
I think it happen with phone is in sleep state or for other reasons that i don't know.
It would be nice to enhance trigger reliability if possible...

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Trigger reliability?

Post by MURTUMA » 14 Mar 2013 16:44

I don't like to use periodic timer because it keeps the flow always running. Instead I set a loop in the flow checking wifi and the flow only triggers when you turn on your wifi. http://automagic4android.com/flow.php?i ... 0228669821

If you get the idea, it's easy to implement in any flow. Still not a perfect solution but for me that has to suffice until they fix the triggers.

User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Re: Trigger reliability?

Post by giovag7 » 15 Mar 2013 17:29

MURTUMA wrote:I don't like to use periodic timer because it keeps the flow always running. Instead I set a loop in the flow checking wifi and the flow only triggers when you turn on your wifi. http://automagic4android.com/flow.php?i ... 0228669821

If you get the idea, it's easy to implement in any flow. Still not a perfect solution but for me that has to suffice until they fix the triggers.
With periodic timer the flow run only when timer trigger. It doesn't drain battery. Sleep timer instead keep the phone always active.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger reliability?

Post by Martin » 18 Mar 2013 10:22

Trigger Periodic Timer only wakes the device when the flow is executed. Using a loop for such a construct will keep your device awake and drain battery.

The triggers (bluetooth and wifi) rely on the operating system events used to inform apps about such occurrences. You can try to change wifi events using different power saving modes in the advanced wifi settings (Android Settings->Wi-Fi->Menu->Advanced) and change settings like "Wi-Fi optimization" and "Keep Wi-Fi on during sleep".
Also ensure that the Automagic status bar icon is enabled otherwise Android can terminate and restart the Automagic service and Automagic can miss such events.

If this does not help, then please enable the "Debug Log" and "Log to SD card" in the settings of Automagic, reproduce a case when the event has been missed and send the log /sdcard/Automagic/log.txt to info@automagic4android.com

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger reliability?

Post by Martin » 18 Mar 2013 16:26

I found one bug in the wifi disconnect trigger that can cause it to fail. This problem should be fixed in the next update.
Nevertheless, please send the debug logs if you can reproduce such an issue in one of your flows (with wifi or bluetooth) since it might be another problem.

Thanks

fractals
Posts: 11
Joined: 12 Mar 2013 15:27

Re: Trigger reliability?

Post by fractals » 19 Mar 2013 10:31

Thanks for your responses! Martin, I am still on Android 2.3.6 and have the correct WiFi sleep policy selected in Android's advanced settings, so everything should work fine. That said, I'm glad you did identify the bug with WiFi disconnect because my problem was actually relevant to WiFi disconnect only. The WiFi connect trigger has always worked flawlessly for me.

I'm not sure how I could reproduce the bug and whether anything would show in the log if the trigger (being the first activity in a flow) would not fire in the first place? Any advice? I'd be happy to help.

Thanks again! Looking forward to the updates :)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger reliability?

Post by Martin » 21 Mar 2013 10:19

Unfortunately reproducing such issues is often very difficult. What you can do is to enable 'debug logging' and 'log to SD card' and just normally use Automagic until the problem occurs one more time.
When this happens, send the file /sdcard/Automagic/log.txt to me with a description what result you expected and what actually happened (something like "I left home at 8:15 and wifi disconnect trigger did not execute flow XYZ"). Please also send the relevant flows to me so I can check the settings and I can try to reproduce the problem.
If you want to check the debug log on your own, you can either open the text file on the sdcard or use menu->Manage->Log to show the live log. The log on the filesystem contains much more log history than the live log.

Post Reply