Page 1 of 1

WLAN available recognizes too late

Posted: 01 Dec 2016 18:41
by efyzz
Hello,

I'm using the German version of Automagic, so I hope that I translate the function names correctly ;)

My flow "leave work" triggers, when the phone losts the connection to the company WLAN. So far it works fine.
Then it checks in a endless loop (with 1 minute pause in it) if the WLAN is still available. If yes, the loop goes on until the phone is reconnected to WLAN again.
If no, the phone "knows" that I have left the company and should do some actions.

But the return value for "WLAN available" is "true" for a long time, even when I drove far away from the company. Sometimes even if I'm already at home the phone searches for the company WLAN ...
Mostly, if I use the phone in some way, it suddenly detects that the WLAN is not available anymore and the flow goes on as expected.

So I think Android checks the available WLANs rarely. Is there any way to actualize more often? Or perhaps manually (per Automagic) before checking the state?
I have Cyanogenmod 13 on my Galaxy S4 mini.

By the way, how can I delete the SD log? I have SD log active to have a look what happened in the last hours/days. But the list is meanwhile very long, so I want to clear it from time to time.

Thanks!

Re: WLAN available recognizes too late

Posted: 01 Dec 2016 20:28
by Martin
Hi,

You can ask Android to scan for networks with action WiFi Scan/WLAN Scan. Please note that the scan is executed asynchronously so the flow will continue immediately even when the scan results are not available yet. You could add an action Sleep 30s/Pause: 30s to wait for a few seconds.

You can just delete the file /storage/emulated/0/Automagic/log.txt or use action Write to File/In Datei Schreiben (without option append) to clear the log. I'll add a Clear Log option to the SD Log screen. :)

Regards,
Martin

Re: WLAN available recognizes too late

Posted: 05 Dec 2016 19:51
by efyzz
Thank you Martin!

I have added a WLAN scan into my flow and I will try it the next days.