古人智慧

Just Do it!
上士聞道,勤而行之;中士聞道,若存若亡;下士聞道,大笑之。不笑,不足以爲道。
~ 道德經 41

「實現夢想不是追逐成功,而是在於賦予生命意義,人生中的每個決定與聲音都有其重要含義。」"The key to realizing a dream is to focus not on success but on significance — and then even the small steps and little victories along your path will take on greater meaning."
電視名人-歐普拉·溫芙蕾(OPRAH WINFREY)

搜尋此網誌

Translation

2015年5月10日 星期日

[Banana Pro][Wifi]解決Wifi不通 - 1'st step Wifi enable


當Banana Pro板子與HD組好後,就開始要試試他的功能。
我用HDMI接上電視,開機很順利的到login畫面,
但是,我沒usb keyboard,也不知Wifi是否有通,就算通也不知ip address。。。

這一關就卡住了。。。
後來,借了usb keyboard,總算可以login,但是發現Wifi是不運作的,真是糟啊!



上網搜尋的結果,發現不少同好遇到同樣問題,解決方案整理以下:

ID: root
password: pi

首先,重新config:
root@bpro ~ # bananian-config
Welcome to bananian-config!
This script assists you to set up some basic parameters...
For news and updates check: http://www.bananian.org
---------------------------------------------------------------------------------
No keyboard found. Skipping keyboard configuration.
---------------------------------------------------------------------------------
Do you want to change your root password? (y/N)
---------------------------------------------------------------------------------
Your current timezone is 'Asia/Taipei'. Do you want to change it? (y/N)
---------------------------------------------------------------------------------
Your current locale is 'en_US.UTF-8'. Do you want to change it? (y/N)
---------------------------------------------------------------------------------
Your current hostname is 'bpro'. Do you want to change it? (y/N)
---------------------------------------------------------------------------------
Video acceleration is currently enabled. Do you want to disable it? (y/N)
---------------------------------------------------------------------------------
Your current hardware configuration is: BananaPro-OTG
Do you want to change it? (y/N)

要注意!! 確定設成Banana Pro

--------------------------------------------------------------------------------
Do you want to expand the root file system (recommended)? (y/N)
---------------------------------------------------------------------------------
done! please reboot your system now! (shutdown -r now)



再到/etc修改modules
root@bpro ~ # nano /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

# VLAN support for BPI-R1
8021q

ap6210 


重新開機後就可以找到ap6210 driver,用lsmod來check
root@bpro ~ # modprobe ap6210
root@bpro ~ # lsmod

Module                  Size  Used by
cpufreq_powersave       1197  0 
cpufreq_userspace       3294  0 
cpufreq_conservative    5966  0 
cpufreq_stats           5901  0 
ap6210                584108  0 
cfg80211              173441  1 ap6210
8021q                  18594  0 
garp                    6114  1 8021q
stp                     1993  1 garp
llc                     5491  2 stp,garp

確定ap6210加入後,要設定連網的Wifi AP的ssid和密碼:
root@bpro ~ # nano /etc/wpa_supplicant/wpa_supplicant.conf
加入這幾行,把家裡的SSID填入ssid="xxxx",還有密碼填入psk=內

ap_scan=1 # use the wpa_supplicant to scan and choose the AP
network={
ssid="
xxxSSID_1xxxx"
psk="
xxxxxxxxxx"
}
network={
ssid="xxxSSID_2xxxx"
psk="xxxxxxxxxx"
}



然後,設定網路interface:
root@bpro ~ # nano /etc/network/interfaces
加入這幾行

auto lo
iface lo inet loopback
auto eth0
# dhcp configuration
iface eth0 inet dhcp
# static ip configuration
#iface eth0 inet static
# address 192.168.6.241
# netmask 255.255.255.0
# gateway 192.168.6.1

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
pre-down killall -q wpa_supplicant



重新開機,用ifconfig看看結果:

root@bpro # ifconfig 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 98:3b:16:e9:c7:a6  
          inet addr:192.168.0.112  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::9a3b:16ff:fee9:c7a6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:717 errors:0 dropped:0 overruns:0 frame:0
          TX packets:590 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:60434 (59.0 KiB)  TX bytes:75652 (73.8 KiB)

regis has logged on pts/1 from 192.168.0.103. 

BananaPro已經從Wifi AP透過DHCP取得正確地ip address 192.168.0.112。
完工!






參考文章:

沒有留言:

張貼留言