Go Down

Topic: Arduino Yun - deactivating the auto WiFi reset (SOLVED) (Read 2780 times) previous topic - next topic

Thomas33

The Arduino Yun is a brilliant piece of HW. The bridge SW is a real downer in terms of speed, but there are projects trying to come up with fast alternatives.

But there is one thing, that makes the yun nearly unusable for real world usage. This is the auto WiFi config reset. When the yun starts up, and can not reach the configured Wlan router for 100 seconds, it just resets the WiFi configuration to AccessPoint mode at 192.168.240.1.

You won't need this automatic behaviour. If there is really something screwed up with your Wifi config, there is still the Wifi reset button.

So - here is, how to deactivate this unlucky behaviour:

1) Edit the file /etc/rc.local and comment out the wifi-live-or-reset line
Code: [Select]
#wifi-live-or-reset


2) Give the yun a static ip address
I changed the wifi-iface section in the file /etc/config/wireless
Code: [Select]

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'sta'
        option ssid 'XXX_your_ssid_here_XXX'
        option encryption 'psk2'
        option key 'XXX_your_password_here_XXX'
        option proto 'static'
        option ipaddr '192.168.0.45'       
        option netmask '255.255.255.0'               
        option gateway '192.168.0.1'


This did not lead to the expected result, but I name it anyway. Maybe it was not "enough", but still needed in addition to the next change.

3) Add a line in /etc/rc.local
Code: [Select]
( sleep 90 ; ifconfig wlan0 192.168.0.45  netmask 255.255.255.0  up ) &


4) You may also ensure a proper value (like "retry") in uci wifi_reset_step:
Code: [Select]
uci show arduino
# and then if needed:
uci set arduino.@arduino[0].wifi_reset_step=retry
uci commit arduino


Now I can boot the Yun without the WiFi router powered on, and days later eventually switch on the router and connect to the Yun wireless. That's really fun again!



A mouse is a device to point at the xterm you want to type in.

federicofissore


2) Give the yun a static ip address
I changed the wifi-iface section in the file /etc/config/wireless
Code: [Select]

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'sta'
        option ssid 'XXX_your_ssid_here_XXX'
        option encryption 'psk2'
        option key 'XXX_your_password_here_XXX'
        option proto 'static'
        option ipaddr '192.168.0.45'       
        option netmask '255.255.255.0'               
        option gateway '192.168.0.1'



These settings are correct but they must go to /etc/config/network

Thomas33

Thanks for the hint. I dont want to try it with my "productive" yun, but i just ordered a new one. Then i try it and update this howto.
A mouse is a device to point at the xterm you want to type in.

theenggprojects

That also a good way to do it. Btw I have written a script in python which automatically search for the available wifi connections and then connects to the one whose SSID and pass is given in the script, I will share it soon.

Go Up