Can't reconnect to the same Wifi

Hi Yuners gurus, I'm facing the following problem and would like to know if there is a solution to it:

I have a last generation Yun connected to my celular phone acting as the Wifi Access Point. Everything runs OK until for some reason (let say I go to sleep) I disconnect my celular.

I would expect the Yun to automatically reconnect when I wake up and connect my celular again but this is not happening.

The Yun never connects again unless I perform a "hard reset" (power off/on).

Am I missing something?

Many thanks in advance

You are missing posting the sketch you used but do so using code tags ( </> )

With 103 posts under your belt you should know a few things about the forum by now.

simon_schvartzman:
I would expect the Yun to automatically reconnect when I wake up and connect my celular again but this is not happening.

You would expect that, but that's not the out-of-the-box behavior. There is a feature that's designed to help you recover for improperly configured WiFi settings: there is a background process that monitors the WiFi connection, and if it is unable to connect for a period of time, it assumes you made a mistake in setting the WiFi configuration, and goes back to being its own access point. This gives you a chance to reconnect to the Yun's WiFi hotspot and reconfigure the WiFi connection.

While that's a handy feature for the initial configuration, or for a beginner who is likely to incorrectly enter the WiFi settings, it becomes a problem when the selected WiFi network is not always active. As you have found, it will reset the WiFi settings and become it's own access point again.

The [b]/etc/rc.local[/b] file is a script that is automatically run at system startup. There is a line in there that runs [b]wifi-live-or-reset[/b] which is the process that monitors and resets the WiFi connection. If you comment out that line by putting a # character in front of it, that will prevent the task from running, and the Yun will forever more keep trying to connect to the configured WiFi network.

You can edit that file from the SSH command line, or by going to the Yun's configuration web pages: log in, click the Configure button, then the Advanced Configuration link. Then select the System tab, and the Startup tab below that. You will see a Local Startup edit box that lets you edit the contents of /etc/rc.local