how do I obtain the contents of the variable access_points?

Post your questions and help other users.

Moderator: Martin

Post Reply
andrewb
Posts: 8
Joined: 07 Nov 2014 08:10

how do I obtain the contents of the variable access_points?

Post by andrewb » 11 Nov 2014 18:19

I am going quite crazy trying to get a list of available wifi access points.

I use the trigger "Wifi Scan results available" but I never get any results in "access_points" but null, even when there is a wifi connected.

I can't even work out if the variable is supposed to be a string or a list.

Can someone *please* post a simple working code example which will display the list of access points either in a message box or even to a log?

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: how do I obtain the contents of the variable access_poin

Post by Bushmills » 11 Nov 2014 20:28

did you execute "WLAN scan" in order to trigger "WLAN scan results available"?

Try this:
http://automagic4android.com/flow.php?i ... 6a86d55959

open the flow, then open WLAN scan action, and from menu, "Execute".
access_points refers to a list, with one list element for each access point.

andrewb
Posts: 8
Joined: 07 Nov 2014 08:10

Re: how do I obtain the contents of the variable access_poin

Post by andrewb » 12 Nov 2014 13:51

Thank you for your help but I just can't make this work. I execute the scan; I run the flow. I just get null as the result. The variable {access_points} is always null.

I know there are scan results available because I added a step to the flow to play a chime when the trigger "wifi scan results available" goes off.

This is with Automagic 1.24 running on stock Android 4.4.4 (a different rom on my table, where it doesn't work either)
Last edited by andrewb on 12 Nov 2014 13:59, edited 1 time in total.

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: how do I obtain the contents of the variable access_poin

Post by Bushmills » 12 Nov 2014 13:55

The flow should be executed as result of you running the scan. You shouldn't execute the flow manually. At least, when I execute the "Scan" action here on my device, the flow is triggered, and a list of APs displayed.

andrewb
Posts: 8
Joined: 07 Nov 2014 08:10

Re: how do I obtain the contents of the variable access_poin

Post by andrewb » 12 Nov 2014 14:04

hang on -- it just worked -- this is with the alarm step added to teh flowl Maybe that slows it down enough.

No: it's now working even without the alarm step. I am mystified. But I thank you enormously for your help.

andrewb
Posts: 8
Joined: 07 Nov 2014 08:10

Re: how do I obtain the contents of the variable access_poin

Post by andrewb » 12 Nov 2014 14:06

Wow -- so now I can do what I originally wanted, which is to make a flow that will re-enable all the access points once I lose contact with my home wifi.

Thank you once more.

A

Post Reply