This is what I'm trying to accomplish:
I'm using a NodeMCU to create a soft AP which hosts one page of HTML. All that page contains is a latitude and longitude fed in from a GPS module attached to the NodeMCU.
I'm trying to create an app in AI2 that, on the click of a button:
- saves the current SSID to a text box;
- disconnects the current SSID and connects to the AP created by the NodeMCU;
- opens the 192.168.4.1 page and scrapes the latitude and longitude into a text box;
- disconnects from the NodeMCU AP SSID;
- re-connects the old saved SSID (if possible, although as all this activity will take place in the middle of the countryside, it's unlikely to be any use at the time); and
- opens Google maps and drops a pin on the scraped latitude and longitude.
Everything works ok except for the disconnecting and connecting from and to the SSIDs.
I've tried using the disable (to disconnect the current SSID) and then enable and ConnectSSID blocks, but they don't work as I expected. I tried putting a few seconds delay in at various places to see if that would help, but it didn't.
I've tried not disabling and enabling before I use ConnectSSID, but that didn't help either.
I've also seen the bit on the TaifunWifi Extensions page that says: 'Required permissions: android.permission.ACCESS_WIFI_STATE, android.permission.CHANGE_WIFI_STATE, android.permission.ACCESS_COARSE_LOCATION', which might be the answer, but which I don't understand. I assumed that, as you have to build the app before you can use it, these permissions would be set automatically.
I suspect I'm completely misunderstanding something elementary, so would appreciate any help, advice or suggestions you might have.
Thanks for your time.
Andy