Arduino yun ad and configuration

Hello there guys!

I'm wondering how can i do something that i think for some of you may be very simple. I'm a noobie into the yun and i need some help from you.

I want to make an app to configure some stuff for my project, including a SSID and a key for my client mode. What i want to do is, when i press a button and when it looses the connection with the configured ap to lunch the configuration mode (change the wifi module to AP mode and let me change some stuff in there from my Android app).

I'm a heavy linux terminal user as a server admin but i'm not getting this. What i tried to do is, having two config files, one for the AP mode and other for the client mode and then simply changing them with the default /etc/config/wireless file and then restarting the wifi module. This worked fine. But how do i check if i'm not connected to a wifi so i can change to AP mode?

I'm sorry for my bad english, it's not my natural language, but i hope you understud what i mean :slight_smile:

But how do i check if i'm not connected to a wifi so i can change to AP mode?

Enter Arduino.local, and clicked advanced configuration panel to see if the wifi is connected.
It will list the wifi connection status below. If it's connected, it will print some related information.

Is it the solution of your question?

Save STA mode setting:

uci export > /root/sta.conf

Save AP mode setting:

uci export > /root/ap.conf

Switch to STA mode:

uci import </root/sta.conf

Switch to AP mode:

uci import </root/ap.conf

Restart correlate service without reboot:

/sbin/wifi down; /sbin/wifi up
/etc/init.d/network restart