Resume known SSID in the WiFi extension Taifun

1,001 views
Skip to first unread message

Edgar Bettiol

unread,
Nov 29, 2017, 2:47:28 PM11/29/17
to MIT App Inventor Forum

Hi. I tried the Taifun WiFi extension and everything worked fine, but I get a problem when I try to reuse the created SSID. That is, the method: "call TaifunWiFi1.connectSSID" successfully creates a new connection, but every time you use it, create a new connection with the same name, as many times as the method is executed. This can be verified in the example of the extension with: "call.TaifunWiFi1.configuredSSIDs" where it can be seen that if 5 calls were made, 5 SSIDs with the same name will appear. I would need to create the new SSDI once and then reuse it and not create another equal one, every time. Is there a way to solve that? Thanks for the help.

Taifun

unread,
Nov 29, 2017, 5:21:57 PM11/29/17
to MIT App Inventor Forum
be verified in the example of the extension with: "call.TaifunWiFi1.configuredSSIDs" where it can be seen that if 5 calls were made, 5 SSIDs with the same name will appear.

I just tested it again and each time I click "view configured SSIDs I get the same list...
did you try another device?
Taifun

Edgar Bettiol

unread,
Nov 29, 2017, 6:08:01 PM11/29/17
to MIT App Inventor Forum
Thanks for sponding so fast ...

Yes, I tried with your extension example and (in photos) this is the result of an SUMSUNG S4mini and ZTE tablet ...
It should also be noted that when trying to delete the created SIDD, from the configurations of android for wifi, even if only one SSID appears, they must be deleted as many times as the command "call.Taifun1.connectSSID was used.


Screenshot_2017-11-29-18-44-10.png
Screenshot_2017-11-29-18-44-29.png
Screenshot_2017-11-29-18-45-29.png
Screenshot_2017-11-29-18-45-47.png
Screenshot_2017-11-29-18-58-10.png
Screenshot_2017-11-29-18-58-24.png
Screenshot_2017-11-29-18-58-50.png
Screenshot_2017-11-29-18-59-07.png

Edgar Bettiol

unread,
Nov 29, 2017, 6:10:55 PM11/29/17
to MIT App Inventor Forum
Look at the photos ... and note that every time you create a new connection, a new SSID appeared: "WANEDY"

Taifun

unread,
Nov 29, 2017, 6:25:29 PM11/29/17
to MIT App Inventor Forum
what exactly means "create a new connection"?
which buttons do you click? which steps exactly do you take to elicit this issue?
do you test using the companion app or after building the app using the apk file?

Taifun

Edgar Bettiol

unread,
Nov 29, 2017, 6:39:05 PM11/29/17
to MIT App Inventor Forum

"Campanion App" is not viable with WiFi tests. It happens with the APK ...

I just open the app: "wifi.apk", enter the SSID of the AP to which I want to connect:

SSID: WANEDY
PASSWORD: 12345678

And I click on 'Connect'

Now, I click on 'view configured SSIDs' and WANEDY appears next to other APs
ex: (WANEDY others ...)

Then, I click again on 'Connect'

and again in 'view configured SSIDs' and the result is:
ex: (WANEDY WANEDY Other ...)

If I click on 'Connect' 5 times, when I click again on 'view configured SSIDs' I get:
(WANEDY WANEDY WANEDY WANEDY WANEDY others ..)
Message has been deleted

Edgar Bettiol

unread,
Nov 29, 2017, 7:03:12 PM11/29/17
to MIT App Inventor Forum
On top of that, if I want to delete / forget the 'WANEDY' SSID created using the example 'wifi.apk' app from the extension, from the list of configured ones, I must go to device settings and in the WiFi SSIDs menu, I must do 5 times click on 'Forget network'

I would appreciate your help.

Taifun

unread,
Nov 29, 2017, 7:50:03 PM11/29/17
to MIT App Inventor Forum
And I click on 'Connect'
Now, I click on 'view configured SSIDs' and WANEDY appears next to other APs
ex: (WANEDY others ...)
Then, I click again on 'Connect'

which means, you are connected to your SSID and then you connect again to the same SSID? does this make sense?
I will do some more tests tomorrow...

Taifun

Edgar Bettiol

unread,
Nov 29, 2017, 8:43:03 PM11/29/17
to MIT App Inventor Forum
ok ... I try to explain my case in more detail.

Let's suppose that at home there is 2 router ... each one with its own SSID (ex: HOMESSID and WANEDY) ... and my device is initially connected via WiFi to HOMESSID ...

Now, I need that whenever I open my App, it connects to WANEDY because it is in that network that I have my resources that I want to use.

So the first thing the App does is check if the WiFi is on

call Taifun1.IsEnable.

Then, if WiFi is not activated, use:

call Taifun1.IsEnable

Then, knowing the SSID of the AP to which I want to connect (WANEDY), whenever I open the App, I look for if it is within reach:

call Taifun1.AvailableSSIDs

Then, if (WANEDY) in list of 'available' then:

call Taifun1.ConnectSSID / SSID: 'WANEDY'password:' 12345678 '

And I do what I have to do with the application ...
.
.
.

Up there, everything works fine ...

Now suppose I left home and when I returned, the Wi-Fi on my device changed (manually or automatically) to HOMESSID ...
When I start the App again ... At that moment, following the same routine explained above, to change from HOMESSID to WANEDY, it reaches the point of executing:

'call Taifun1.ConnectSSID / SSID: 'WANEDY'password:' 12345678 '

And at that moment, a second copy 'WANEDY' is created ...

Every time I start my App, if the WiFi is not in 'WANEDY', a new 'WANEDY' is created in the configuredSSID record of my device.

In other words, 'call TaifunWiFi1.connect' always CREATES a new one and does not CHANGE to an already existing SSID, preconfigured.


Taifun

unread,
Nov 30, 2017, 9:45:02 AM11/30/17
to MIT App Inventor Forum
I can confirm this issue...
I will see, what I can do to fix this

Taifun

Edgar Bettiol

unread,
Nov 30, 2017, 11:40:47 AM11/30/17
to MIT App Inventor Forum
Ups..

Thanks anyway for attending my consultation.

For now, I will have the application inform the user that it must connect to the SSID manually, although that implies a setback in the effective design of the application ...

I will be very attentive to any solution you achieve.

Again, thanks Taifun

PD: Sorry for the quality of my text in English. I have been using google translator to communicate ...

Edgar Bettiol

unread,
Dec 5, 2017, 2:13:33 PM12/5/17
to MIT App Inventor Forum
Considering the issue with the extension of Taifun to connect to a preconfigured SSID, can someone have help me in another way?

For example, I think, from what I've read, it could be done through ActivityStarter, but because of my little experience I can not make it happen.

Can somebody help me?

Taifun

unread,
Dec 5, 2017, 2:50:01 PM12/5/17
to MIT App Inventor Forum
you can use the activity starter to open the settings for the user, but not to connect automatically to a SSID

Taifun

Edgar Bettiol

unread,
Dec 5, 2017, 3:00:47 PM12/5/17
to MIT App Inventor Forum
Thanks again, Taifun ...
I feel tied hands to finish my application .... :(


On the other hand, I wanted to ask you if you know if your WiFi extension, depends on its functioning of the android version, since I tried 'call Taifun1.MacAddress' on an android 4.1.1 and it seems not to work on that device ...

Edgar Bettiol

unread,
Dec 5, 2017, 3:05:56 PM12/5/17
to MIT App Inventor Forum
And I have a new question for Taifun:

Is there any way to delete a configured SSID?

That is, since 'call.Taifun.connect' creates a copy of the one that was previously created, is there a way to let that happen and simply delete the previous one?

It would not be the most elegant solution, but it would work for me ... (correct the effect and not the cause) ...

Thank you.

Taifun

unread,
Dec 5, 2017, 4:51:51 PM12/5/17
to MIT App Inventor Forum
 I tried 'call Taifun1.MacAddress' on an android 4.1.1 and it seems not to work on that device
what happens exactly, if you use that method? any error message?
die you try the example app?

call.Taifun.connect' creates a copy of the one that was previously created, is there a way to let that happen and simply delete the previous one?
why don't you just reconnect using the ConnectSSID method (using ssid and password)? just ignore the result of the ConfiguredSSIDs method

Taifun

Edgar Bettiol

unread,
Dec 5, 2017, 10:53:53 PM12/5/17
to MIT App Inventor Forum
Yes, I used the example application and I also tried to take it to its minimum expression ... in both cases nothing just happened. There was no error message, nor any result.
------------------------------------------

------------------------------------------
As for using the ConnectSSID method, it happens that the application for which I need it can be opened 10 times a day, every day ...

When I discovered the problem, it was because throughout the tests of my application, in which many times I used the method, my device started (without any explanation) to erase the access code of other SSID that I had configured ...

Alarmed because I still did not understand why those other SSIDs disappeared from my records, I had to restore my devices to factory settings

When I finally discovered that for that to stop happening, I had to erase 5, 10 times the SSID created with this method, I deduced (I'm not sure) that there should be some limit for the total number of records allowed for SSID and that when coping that limit, the previous records begin to be deleted ...

In fact, I think that this problem makes the method unusable, because after using it many times, it corrupts the SSIDs registry.

As I said before, I need a method that uses an existing SSID and not, that creates a new one each time.

And I think it must be something that is affecting all users that require your extension ...


Taifun

unread,
Dec 6, 2017, 10:28:22 AM12/6/17
to MIT App Inventor Forum
the issue should be fixed now
please download version 5a of the wifi extension https://puravidaapps.com/wifi.php and let me know, if it works for you now 
Taifun

Edgar Bettiol

unread,
Dec 6, 2017, 11:10:37 AM12/6/17
to MIT App Inventor Forum
Amazing Taifun!

'call.Taifun1.ConnectSSID' now works perfectly well.

The problem was completely and perfectly resolved!

Thousands of thanks for attending my consultation and millions of thanks for solving my problem. Now I can finish my project as it should be.

Edgar Bettiol.

Edgar Bettiol

unread,
Dec 6, 2017, 11:39:04 PM12/6/17
to mitappinv...@googlegroups.com
Important note:

With the last update in which Taifun corrected the WiFi extension (5a):'call.Taifun1.ConnectSSID', there was a small change in the way the method responds ... although it has nothing to do with the problem that it had, I think it is convenient to take note of the following, in the instructions for use:

Before the correction, when calling the method, the SSID was created and simultaneously, it was connected to said SSID.

Now, the method must be called twice: A first time to create the SSID and append it to the configured ones, and a second time, to connect, effectively, to that newly created ... that way it works perfectly!

Greetings. 

Edgar Bettiol.

Taifun

unread,
Dec 7, 2017, 9:07:05 AM12/7/17
to MIT App Inventor Forum
Now, the method must be called twice: A first time to create the SSID and append it to the configured ones, and a second time, to connect, effectively, to that newly created ... that way it works perfectly!
well, that's not correct
after connecting you will have to wait a little bit until the connection is made...
Taifun

Edgar Bettiol

unread,
Dec 7, 2017, 10:24:23 AM12/7/17
to MIT App Inventor Forum
Check what happens in the video: https://youtu.be/CNYB9Z-FM70

Initially connected to 'WANEDY', I try to connect to a new SSID 'PortonWFA6' not yet registered ... in that case, you must activate 'Connect' twice ...
With the first 'create in configurations' and still waiting, it does not connect until a second time.
For me it works well, but that way. I have no problem in re-invoking the method.

Edgar Bettiol

Taifun

unread,
Dec 7, 2017, 12:36:42 PM12/7/17
to MIT App Inventor Forum
well, you were not patient enough... 
Taifun

Edgar Bettiol

unread,
Dec 7, 2017, 2:32:40 PM12/7/17
to MIT App Inventor Forum
hehehe ... I guess it's some kind of joke ... :)

Some people who know me say that I am obstinate and others that I am stubborn as a mule ... and maybe, in that, they are right. :)))

But they have never said that I am 'impatient' ...;)

To prove it (my stubbornness), I took the courtesy of making another video, and upload it to youtube.com, similar to the previous one, but this time 5 minutes long, https://youtu.be/QpPdd_ik1hs  and I verify that, when I click the first time 'connect' to create the new SSID PortonWFA6, never gets connected (if it did not exist previously) ... that stays that way, until at the end of the video, after waiting 5 minutes without happening, I click again (second time) on 'connect' and then the connection if done ...

Again, I have no problem in calling back the method that I thank you have fixed. This is how it works for me and I just want to clarify it as a guide to other users.


Edgar Bettiol.

Taifun

unread,
Dec 14, 2017, 4:04:31 PM12/14/17
to MIT App Inventor Forum
this should be fixed now in version 5b
thank you again for the error report
Taifun

Edgar Bettiol

unread,
Dec 14, 2017, 11:00:40 PM12/14/17
to MIT App Inventor Forum
Once again, thank you Taifun.

Now 'call.TaifunWiFi1.ConnectSSID' works 100% as indicated.

Edgar Bettiol.

Edgar Bettiol

unread,
Dec 15, 2017, 12:00:04 AM12/15/17
to MIT App Inventor Forum
Now, Taifun, trying to always seek to improve the extension, I would like to comment on another thread that was pending in a comment that I made earlier ...

As I mentioned to you days ago, I also had problems when using: 'call Taifun1.MacAddres' ...

First I explain that my application connects via WiFi to another receiver device to operate a switch ... before doing so, I must be sure that the device from which I give the command to operate, is previously registered in the receiver. To achieve this, I transmit, along with the activation command, the MacAddress of the issuer of the command so that the receiver verifies if it comes from a registered source ...

I did tests with an Android 4.4.2, with a 4.2.1 and another 7.0 making it work perfectly, but when I tried to get the mac to transmit it from an Android 4.1.x, nothing happened. There was no error message or anything ... just as if it had never happened ...

To solve it, it occurred to me to transmit the IMEI or the MEID (as the case may be) instead of the MacAddress ... for which I used TaifunTM1 (Telephony Manager Extension) to obtain that new data as a record to be transmitte

It happened later that when I tried to upload the application to 'Play Store' I was told that because my app uses access to the secure information type of the device (android.permission.READ_PHONE_STATE and android.permission.GET_ACCOUNT), I had to make a series of additional steps such as for example the creation of a sheet of 'Privacy Policies' among others ... and I'm sure (almost) is due to TaifunTM1 ...

Being that the solution that I got, when leaving the MacAdress for the IMEI / MEID, turned out to complicate me more than the original problem, I wanted to ask you if you can review, please, why 'call Taifun1.MacAddres' does not work well with Android 4.1. x?

Once again a thousand thanks in advance ...

Edgar Bettiol.

Taifun

unread,
Dec 15, 2017, 8:32:21 AM12/15/17
to MIT App Inventor Forum
 I wanted to ask you if you can review, please, why 'call Taifun1.MacAddres' does not work well with Android 4.1. x?

unfortunately I do not have an Android 4.1 device, so I can't test this
but I could prepare a new version of that method for you to test
you might want to contact me by email, so we can discuss the details
thank you

Taifun

Reply all
Reply to author
Forward
0 new messages