2015年1月30日 星期五

arduino yun wifi configure reset / arduino yun wifi重新設定



Hi!我是jock36

本篇要教導各為如何重新設定arduino yun的wifi

閱讀本篇前提為(1)已經設定過WIFI想重新設定(2)找不到yun ap(3)連上後出現未知錯誤

以下有個方法




1.將yun連接至電腦上,並長按Yún RST(AR9331) 3秒~30秒 :


這方法會讓yun重新變為ap狀態,重新與yun配對後,輸入上次的密碼即可重新設定yun了

注1:此方法並不會還原密碼(即arduino)
注2:請不要按住超過30秒會導致linux系統還原



2.若你忘記上次設定的密碼或者按下Yun RST沒反應可以試試這方法:


此步驟為將linux還原初始狀態

(1)開啟ArduinoIDE透過USB燒錄範例程式YunSerialTerminal(在Bridge menu裡)

(2)開啟Serial monitor然後在右下角選擇newline

(3)按下Yun RST
(4)等待訊息直到出現"Press the [f] key and hit [enter] to enter failsafe mode":輸入f並按下enter鍵(或按send鈕也可以)

(5)輸入cd /usr/bin

(6)輸入./reset-to-factory-anyway (this will reset the Yún to factory settings)


稍等一下再一次看到輸入欄即完成 可以重新啟動arduino yun按照使用者說明重新安裝一遍了~


3.若以上方法都無法讓arduino yun還原成分享器狀態就試試這方法:


注1:這方法是將系統重新安裝
注2:本篇以windows為例

(1)下載Yun的映象檔點我下載映像檔
(2)先安裝TFTP點我下載
(3)安裝完成後開啟應用程式,點擊設定按鈕並更改路徑(Path)到解壓縮後的「映像檔資料夾」
(4)點擊最左邊的按鈕啟動TFTP伺服器
(5)將yun皆透過USB及網路線接至電腦上(若是使用無線上網者請將Arduino Yun的網路端口接至分享器上)


(6)開啟ArduinoIDE透過USB燒錄範例程式YunSerialTerminal(在Bridge menu裡)
(7)開啟Serial monitor然後在右下角選擇newline

(8)按下Yun RST

(9)數秒後會看到
eth0, eth1
Hit any key to stop autoboot: 4 3 2
訊息按下send鈕後會看到「ar7240>」這樣表示成功進入UBOOT

我們必須先告訴yun主機IP以及他自己的IP  以我的為例我的點腦IP為192.168.1.7;arduino yun的IP為192.168.1.206



先輸入伺服器(主機)的IP
setenv serverip 192.168.1.7;

再輸入arduino的IP
setenv ipaddr 192.168.1.206;
注1:若你的arduino yun是直接連到電腦上則不需輸入此行
注2:若你是筆記型電腦連接無線網路則需要輸入此行

輸入完畢後你可以準備重新刷機


(9-1)刷新UBOOT


輸入tftp 0x80060000 openwrt-ar71xx-generic-linino-u-boot.bin;

運行完畢後依序輸入下列指令:
erase 0x9f000000 +0x40000;
cp.b $fileaddr 0x9f000000 $filesize;



(9-2)刷新KERNEL


輸入tftp 0x80060000 openwrt-ar71xx-generic-yun-16M-kernel.bin;

運行完畢後依序輸入下列指令:
erase 0x9fEa0000 +0x140000;
cp.b $fileaddr 0x9fea0000 $filesize;



(9-3)刷新KERNEL


輸入tftp 0x80060000 openwrt-ar71xx-generic-yun-16M-rootfs-squashfs.bin;

運行完畢後依序輸入下列指令:
erase 0x9f050000 +0xE50000;
cp.b $fileaddr 0x9f050000 $filesize;


(9-4)重新啟動

上面的程式執行完畢後輸入:

bootm 0x9fea0000;
這樣就完成了\0.0/



1.Power the arduino yun, and press Yun rst(AR9331) (white button near the leds) 3~30secs:


This way can let yun reset to become an ap ,then reconnect to yun , enter the password which you have been set ,press enter you can reconfigure your setting 

2.if you forget your pass word or there'snothing happend when you press Yun RST you can try this way:


(1)In the Arduino development environment, upload the YunSerialTerminal example (in Bridge menu) via usb
(2)Press the "Serial Monitor" button and then select "newline" at the bottom right of the window
(3)Reset the AR9331 (white button near the leds)
(4)Wait until you read "Press the [f] key and hit [enter] to enter failsafe mode": do that, press f and hit enter (remember to first click inside the textbox at the top of the window)
(5)Type cd /usr/bin
(6)Type ./reset-to-factory-anyway (this will reset the Yún to factory settings)



wait for second to let it restore system,when it done you can reset your arduino yun~



3.if you did way1,2 and there's nothing happend on yun you can try this way:


Download and unpack the image files

Download the base images zip file. Extract the three files (uboot, kernel, rootfs).
Setup a TFTP server

For U-Boot to download the 3 files from your computer to the Yún, you first need to setup a TFTP server on your computer.


Setup a TFTP server on Windows


Download and install TFTP Utility from http://sourceforge.net/projects/tftputil/.

Once the program has been installed, and you've started it, press the settings button and change the path, specifying the location where you have unpacked the base images zip file you downloaded earlier

Then start the TFTP server by pressing the first button on the left


Setup your Yún

Connect your Yún to your computer with a USB cable. Then connect the Yún to your router or your computer with a wired Ethernet cable. This is crucial: you cannot reflash via wifi.

Open the Arduino IDE and upload the YunSerialTerminal example to your Yún.

You'll need to do the next step quickly. Open the Serial Monitor from the Arduino IDE, press the YUN RST button (the white one near the LEDs), and press the Enter button a couple of times on your keyboard. If you're fast enough, you'll get something like the following in the Serial Monitor :
...
...
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Hit any key to stop autoboot: 4 3 2
ar7240>

The ar7240> is U-Boot prompt.

If you don't hit enter at the right time, and don't enter U-Boot, press the YUN RST button once more and retry until you get U-Boot prompt.

Once inside U-Boot, you need to tell it your computer's IP address and the IP address for the Yún. Find the IP for your computer, and choose a unique address for the the Yún. If you're on a home network, you probably won't have any issues assigning something in the appropriate range (if you're in a network full of computers, you first need to ensure the IP address you'll assign to the Yún is not already used by someone else).



For example, your computer's IP address is 192.168.0.231, and you want to assign the Yún the address of 192.168.0.146. First set the IP of your computer in the Serial Monitor :



setenv serverip 192.168.0.231;

and press Enter. Then set the IP address for the Yún :
setenv ipaddr 192.168.0.146;



The Yún is now ready for reflashing.


Reflashing U-Boot (optional)

Reflashing U-Boot is a last option. These commands are only a reference.

In the Serial Monitor, type
tftp 0x80060000 openwrt-ar71xx-generic-linino-u-boot.bin;

and press Enter.

If it takes a long time to see the prompt ar7240> again, it means that you have used the wrong IP address for the Yún or your computer, your TFTP server is not running, or the Ethernet cable between the computer and Yún is not properly connected. Check these variables, and start over by pressing the YUN RST button.

If the U-Boot prompt does appear (it should be quite quick), type the following commands, pressing Enter after each line :
erase 0x9f000000 +0x40000;
cp.b $fileaddr 0x9f000000 $filesize;



Reflashing Kernel

In the Serial Monitor, type
tftp 0x80060000 openwrt-ar71xx-generic-yun-16M-kernel.bin;

If it takes a long time to see the prompt ar7240> again, it means that you have used the wrong IP address for the Yún or your computer, your TFTP server is not running, or the Ethernet cable between the computer and Yún is not properly connected. Check these variables, and start over by pressing the YUN RST button.

If the U-Boot prompt does appear, type the following commands, pressing Enter after each line :
erase 0x9fEa0000 +0x140000;
cp.b $fileaddr 0x9fea0000 $filesize;



Reflashing OpenWrt-Yun

In the Serial Monitor, type
tftp 0x80060000 openwrt-ar71xx-generic-yun-16M-rootfs-squashfs.bin;

If it takes a long time to see the prompt ar7240> again, it means that you have used the wrong IP address for the Yún or your computer, your TFTP server is not running, or the Ethernet cable between the computer and Yún is not properly connected. Check these variables, and start over by pressing the YUN RST button.



If the U-Boot prompt does appear, type the following commands, pressing Enter after each line :
erase 0x9f050000 +0xE50000;
cp.b $fileaddr 0x9f050000 $filesize;



Rebooting

After completing the above steps, if the U-Boot prompt appears, type the following command in the Serial monitor, followed by Enter :


bootm 0x9fea0000



OpenWrt-Yun will now start its boot process. Wait a couple of minutes (first boot is always slightly slower) and enjoy your freshly reflashed Yún.