Reconect yun to different wifi without pushing reset button

Hi! I am wondering if it is possible to make Arduino Yun to reconnect do different wi-fi (and not hard coded, so it can be any wi-fi) without holding the wi-fi reset button for 5 sec. And if this is possible how to approach the problem. I have been looking around and could not find a specific answer to this.

To be more specific I mean such a scenario: I am programming Yun to do some task and I would like for end user to be able to reconnect, as simply as possible, to his or any for that matter wi-fi without having a physical access to the board itself

Thank you in advance for any input, have a great day!

@domagalski,
are you still working on this issue? Have you looked at the OpenWRT website for possible solutions?
Jesse

Dear Jesse,

yes I am still looking for the solution. So far the closest I got to automation is that you need a txt file with wifi credentials on a usb stick or other storage connected to usb host, and when OpenWRT boots up it uses that file to configure the wifi. Yet again it is not suitable for my project, as for all cost (at least, so far) I would like to avoid for an user to have any interaction with Yun.

@domagalski, it appears that you need to learn more about how wifi works. Here are some quick pointers.

There are several types of wifi APs (Access Points) in the real world. Here are the most popular.

1) completely open - does not require a password or any type security certificates. This type is growing increasingly rare. This used to be the standard setup of in home wifi, but it is now #3.

2) webpage acknowledgement - these type requires the end-user to click sometype of button or give some type of password or give some type of security code -- all the variations have a wepage. I have found this to be the most popular type of system, in places like Starbucks and MacDonalds.

3) WEP/WPA or similar - this type requires some type of some type of password/passphrase or give some type of security code. This type of system requires that you fill some type of popup form on your laptop or similar system. Note: this type system is usually consider more secure and is also used for public access. I have found it used in motels, coffee shops and fastfood places (like Jack in the Box)

4) certificate based - This type of system is usually implement in corporate environments where easy of access is required and no password is required.

5) Any combination of #2, 3, & 4.

FWIW: when the Arduino Yun is an AP it is type #1 - when connected to the Internet.

Here is a reference article from wikipedia. It lists about a dozen security protocols, but there are in fact more that 50.

https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access

To finish up, there is no one software system available that can handle all the different security methods available. However, I have heard there is one hacker software that can break into the most weak wifi systems - I don;t know the name of it.

Best of Luck, Jesse

Thank you very much for such a nice and detailed input! It seems to me that the most common case is no.3 As the most usual situation is that someone will use it at home, small office, friend place, where there is standard connection to the router using some SSID and WPA2. But even identifying that, problem still remains how to configure Yun to connect to another wifi without a physical access to it.

domagalski: I would like to avoid for an user to have any interaction with Yun.

domagalski: problem still remains how to configure Yun to connect to another wifi without a physical access to it.

Without any user interaction with it? Or without any physical access to it? Which one is it? They are not the same.

Without any user interaction is simply not possible - you will always need to select or provide an SSID, and most of the time also enter a password.

Without physical access is much simpler. You log onto the Yun's configuration web page, and on that first page you can select which network you want to access. The issue is that if the Yun was used somewhere else, and is trying to connect to that other network, how do you get to that configuration page?

One way is to press the reset button to get it back to the default state of acting like an access point. But you don't want to do that.

Another way is to simply wait a few minutes. Unless you have specifically disabled it (many users have) the normal operation of the Yun is to try to connect to the configured WiFi network for a couple minutes. If that fails, the system will revert back to the default access point mode, reboot, and come up in the same state as if you had pressed that reset button. You can then connect to the Yun's access point, log into the web page, and set up the network.

The third way is to connect the Ethernet cable. That interface always works regardless of the WiFi status. That will let you get to the configuration web pages and set up the WiFi network.

Yes you are right, I wasn't precise enough, I meant without physical access to it and by writing interaction I also meant physical contact.

The issue is that if the Yun was used somewhere else, and is trying to connect to that other network, how do you get to that configuration page?

This is exactly the problem that I am seeking to solve.

One way is to press the reset button to get it back to the default state of acting like an access point. But you don't want to do that.

Yes. I did read that if Yun can not find old network it will revert to AP mode, but it never happened to me.

Yun is to try to connect to the configured WiFi network for a couple minutes.

But it seams that either I was to impatient and I need to wait more or this option is disabled (but I have never tried to do this).

I have to investigate both options (as connecting Ethernet cable is not possible) and I hope that I will figure it out. Waiting for couple minutes is not ideal though but I see that this might be an only option anyway.

Thank you so much for the input!

WPS (Wi-Fi Protected Setup):

You may have devices like Yun or wireless printers or wireless range extenders with their own WPS button that you can use for making very quick connections. Connect them to your wireless network by pressing the WPS button on the router and then on those devices (Yun). You don't have to input any data during this process. WPS automatically sends the network password and these devices remember it for future use. They will be able to connect to the same network in the future without you having to use the WPS button again.

Setup Yun with WPS (STA):

https://wiki.openwrt.org/doc/uci/wireless

BTW. My last few routers all have WPS build in.

That looks interesting I will look into it in details, thanks !

domagalski: But it seams that either I was to impatient and I need to wait more or this option is disabled (but I have never tried to do this).

I just stumbled across this post, and it made me think of this thread: http://forum.arduino.cc/index.php?topic=401647.msg2764122#msg2764122 [quote author=Federico Vanzati date=1463740266 link=msg=2764122]the "wifi-live-or-reset" script is still present in /usr/bin but by default it's not executed to avoid problems of re-connection when WiFi connection is lost. We received feedback from users that this behavior was bit annoying in permanent installation so, we decided to disable it.[/quote]

Apparently, the function to automatically reset the WiFi parameters when it can't make a connection is no longer the default behavior. You might have a newer board that does not have this enabled. If you want this behavior, edit /etc/rc.local and add a line "wifi-live-or-reset" to it. You can edit the file from the SSH command line, or you can open the Yun's configuration web pages, and on the System | Startup tab of the Advanced Configuration pages, there is an edit field at the bottom that allow easy editing of that file.

@ShapeShifter, thats sound like it could be the case I will investigate this. Thanks for remembering the thread and the tip :)

@ShapeShifter, yes, that helps ! Thanks a lot! Waiting is good enough solution for me ;)