Difference between revisions of "OpenWRT: Build Firmware Linksys E1700"

From OnnoWiki
Jump to navigation Jump to search
Line 104: Line 104:
  
 
  cd ~
 
  cd ~
  cp -r rt2860v2-for-openwrt-mt7620/ralink ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/mtd/
+
  cp -r rt2860v2-for-openwrt-mt7620/ralink ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/
  
 
  cd ~
 
  cd ~
  cp -r rt2860v2-for-openwrt-mt7620/rt2860v2  rt2860v2-for-openwrt-mt7620/rt2860v2_ap  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/net/wireless/
+
  cp -r rt2860v2-for-openwrt-mt7620/rt2860v2  rt2860v2-for-openwrt-mt7620/rt2860v2_ap  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/
  
Hati-hati folder /linux-ramips_mt7620/linux-3.14.27 mungkin akan berubah / berbeda tergantung versi openwrt yang kita compile.
+
Hati-hati folder
 +
 
 +
/linux-ramips_mt7620/linux-3.14.26
 +
/linux-ramips_mt7620/linux-3.14.27  
 +
 
 +
mungkin akan berubah / berbeda tergantung versi kernel yang kita compile.
  
  
Line 118: Line 123:
 
Tambahkan kalimat berikut di akhir file Kconfig sebelum endif #MTD
 
Tambahkan kalimat berikut di akhir file Kconfig sebelum endif #MTD
  
  vi  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/mtd/Kconfig  
+
  vi  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/Kconfig  
  
 
  source "drivers/mtd/ralink/Kconfig"
 
  source "drivers/mtd/ralink/Kconfig"
Line 126: Line 131:
 
Tambahkan kalimat berikut di akhir file makefile:
 
Tambahkan kalimat berikut di akhir file makefile:
  
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/mtd/Makefile
+
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/Makefile
  
 
  obj-$(CONFIG_MTD_RALINK)    += ralink/
 
  obj-$(CONFIG_MTD_RALINK)    += ralink/
Line 132: Line 137:
 
Tambahkan kalimat berikut di akhir file Kconfig sebelum endif # WLAN
 
Tambahkan kalimat berikut di akhir file Kconfig sebelum endif # WLAN
  
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/net/wireless/Kconfig  
+
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/Kconfig  
  
 
  source "drivers/net/wireless/rt2860v2_ap/Kconfig"
 
  source "drivers/net/wireless/rt2860v2_ap/Kconfig"
Line 139: Line 144:
 
Tambahkan kalimat berikut di akhir file makefile:
 
Tambahkan kalimat berikut di akhir file makefile:
  
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.27/drivers/net/wireless/Makefile  
+
  vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/Makefile  
  
 
  obj-$(CONFIG_RT2860V2_AP)  += rt2860v2_ap/
 
  obj-$(CONFIG_RT2860V2_AP)  += rt2860v2_ap/
Line 166: Line 171:
 
               [*]  Wireless LAN  --->  
 
               [*]  Wireless LAN  --->  
 
                       <*>  Ralink RT2860 802.11n AP support
 
                       <*>  Ralink RT2860 802.11n AP support
                            [*]    LED Support
+
                      [*]    LED Support
                            [ ]    WSC (WiFi Simple Config)
+
                      [ ]    WSC (WiFi Simple Config)
                            [*]    LLTD (Link Layer Topology Discovery Protocol)
+
                      [*]    LLTD (Link Layer Topology Discovery Protocol)
                            [*]    WDS
+
                      [*]    WDS
                            [*]    MBSSID
+
                      [*]    MBSSID
                            [*]      New MBSSID MODE
+
                      [*]      New MBSSID MODE
                            [*]    AP-CLient Support
+
                      [*]    AP-CLient Support
                            [*]      MAC Repeater Support
+
                      [*]      MAC Repeater Support
                            [ ]    IGMP snooping (NEW)
+
                      [ ]    IGMP snooping (NEW)
                            [ ]    NETIF Block (NEW)
+
                      [ ]    NETIF Block (NEW)
                            [ ]    DFS (NEW)
+
                      [ ]    DFS (NEW)
                            [*]    Carrier Detect
+
                      [*]    Carrier Detect
                            [ ]    DLS ((Direct-Link Setup) Support (NEW)
+
                      [ ]    DLS ((Direct-Link Setup) Support (NEW)
                            [ ]    IDS (Intrusion Detection System) Support (NEW)
+
                      [ ]    IDS (Intrusion Detection System) Support (NEW)
                            [*]    CoC Support (NEW)
+
                      [*]    CoC Support (NEW)
                            [ ]    Memory Optimization (NEW)
+
                      [ ]    Memory Optimization (NEW)
                            [ ]    Video Turbine support (NEW)
+
                      [ ]    Video Turbine support (NEW)
                            [ ]    802.11n Draft3 (NEW)
+
                      [ ]    802.11n Draft3 (NEW)
                            [ ]    Adjust Power Consumption Support (NEW
+
                      [ ]    Adjust Power Consumption Support (NEW
                            [ ]    Single SKU (NEW)
+
                      [ ]    Single SKU (NEW)
                            Choose Power Design (Internal PA and Internal LNA)  --->
+
                      Choose Power Design (Internal PA and Internal LNA)  --->
                            [ ]  TSSI Compensation (NEW)
+
                      [ ]  TSSI Compensation (NEW)
                            [ ]  Temperature Compensation (NEW)
+
                      [ ]  Temperature Compensation (NEW)
  
 
Pastikan pilih (*) untuk membuat driver masuk ke kernel, bukan kernel module.
 
Pastikan pilih (*) untuk membuat driver masuk ke kernel, bukan kernel module.

Revision as of 12:57, 11 January 2015

Spesifikasi

Model : E1700
Platform : Mediatek MT7620A
RAM [MB] : 32
Flash [MB] : 8
Ant. Conn. Type : External
WLAN NIC : SOC
WLAN standard [802.11] : b/g/n 2x2:2
Eth. port count : 4 Gb LAN 1 Gb WAN
Power Input [V/A] 12V 0.5A

Siapkan Aplikasi Pendukung

sudo su
apt-get update
apt-get install subversion gawk flex sharutils bison libz-dev zlib1g-dev patch \
fakeroot lzma git-core build-essential unzip libncurses5-dev curl php-xml-parser \
libexpat1 libexpat1-dev libssl-dev libdaemon*
cd /usr/local/src
wget http://www.cpan.org/modules/by-module/XML/XML-Parser-2.43.tar.gz
tar zxvf XML-Parser-2.43.tar.gz
cd /usr/local/src/XML-Parser-2.43
perl Makefile.PL
make install


Compile Menggunakan Development Trunk

Development Trunk tampaknya paling RECOMMENDED

Lakukan sebagai user biasa

svn co svn://svn.openwrt.org/openwrt/trunk/ ~/openwrt.trunk/trunk
cd ~/openwrt.trunk/trunk/
./scripts/feeds update
./scripts/feeds install meshwizard openssh-server openssh-client
./scripts/feeds install freifunk-common freifunk-gwcheck freifunk-mapupdate
./scripts/feeds install luci luci-app-meshwizard luci-app-olsr luci-app-olsr-services
./scripts/feeds install luci-app-olsr-viz luci-app-freifunk-policyrouting luci-mod-freifunk
./scripts/feeds install luci-theme-freifunk-generic olsrd olsrd-mod-txtinfo olsrd-mod-dyn-gw
./scripts/feeds install olsrd-mod-dyn-gw-plain olsrd-mod-dot-draw
./scripts/feeds install olsrd-mod-arprefresh olsrd-mod-watchdog olsrd-mod-tas olsrd-mod-httpinfo
./scripts/feeds install olsrd-mod-pgraph olsrd-mod-secure olsrd-mod-bmf
./scripts/feeds install luci-app-upnp minidlna miniupnpc miniupnpd luci-app-minidlna
./scripts/feeds install libdlna libgupnp libgupnp-dlna rtorrent
./scripts/feeds install usb-modeswitch usb-modeswitch-data usbutils multiwan
./scripts/feeds install 6in4 6rd 4th 6to4 6tunnel libdaemon aprx usb-modeswitch
./scripts/feeds install pptpd ppp-mod-pptp smstools3 picocom
./scripts/feeds install kamailio4 kamailio asterisk18 asterisk11
./scripts/feeds update -a
./scripts/feeds install -a
make clean
make defconfig
make menuconfig
make world

Hasilnya akan berada di folder

~/openwrt.trunk/trunk/bin/ramips/

Konfigurasi Default

Konfigurasi untuk E1700

Target System (Ralink RT288x/RT3xxx) --->
Subtarget (MT7620 based boards) --->
Target Profile (Linksys E1700) --->

Konfigurasi default yang ada dari openwrt tidak ada driver wifi. Kita perlu menambahkannya secara manual berikut ini.




Select the following configuration------


rt2860v2-for-openwrt-mt7620

rt2860v2_ap/rt2860v2_sta driver for openwrt trunk(3.10.x kernel) on MT7620 SOC. (Test on mt7620n 16m flash + 64M ram)


Target System: (Ralink 288x/3xxx)
Subtarget: (MT7620N based boards)

$make V=99

Wait make command to be done.

When make finished. The firmware will be in the directory: $HOME/openwrt/openwrt-trunk/bin/ramips/


Cara Menambahkan Driver Wifi

Download patch

cd ~
git clone https://github.com/wuqiong/rt2860v2-for-openwrt-mt7620.git

Merge ke build directory

cd ~
cp -r rt2860v2-for-openwrt-mt7620/ralink ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/
cd ~
cp -r rt2860v2-for-openwrt-mt7620/rt2860v2  rt2860v2-for-openwrt-mt7620/rt2860v2_ap  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/

Hati-hati folder

/linux-ramips_mt7620/linux-3.14.26
/linux-ramips_mt7620/linux-3.14.27 

mungkin akan berubah / berbeda tergantung versi kernel yang kita compile.


Tambahkan di Kconfig dan Makefile

Selanjutnya, tambahkan Kconfig dan Makefile obj di directory "mtd" dan "wireless"

Tambahkan kalimat berikut di akhir file Kconfig sebelum endif #MTD

vi  ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/Kconfig 
source "drivers/mtd/ralink/Kconfig"
endif # MTD


Tambahkan kalimat berikut di akhir file makefile:

vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/mtd/Makefile
obj-$(CONFIG_MTD_RALINK)    += ralink/

Tambahkan kalimat berikut di akhir file Kconfig sebelum endif # WLAN

vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/Kconfig 
source "drivers/net/wireless/rt2860v2_ap/Kconfig"
endif # WLAN                      

Tambahkan kalimat berikut di akhir file makefile:

vi ~/openwrt.trunk/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.14.26/drivers/net/wireless/Makefile 
obj-$(CONFIG_RT2860V2_AP)   += rt2860v2_ap/

Tambahkan konfigurasi

Jalankan

cd ~/openwrt.trunk/trunk
make kernel_menuconfig

Masukan konfigurasi berikut

Machine selection  --->  
     System type (Ralink based machines)  --->
     Ralink SoC selection (MT7620/8)  --->
     Devicetree selection (None)  --->

Device Driver -->
      <*> Memory Technology Device (MTD) support  --->
             Ralink Flash Type support  --->
                   [*] Ralink MTD support  

Device Driver -->
      [*] Network device support  --->
             [*]   Wireless LAN  ---> 
                     <*>   Ralink RT2860 802.11n AP support
                     [*]     LED Support
                     [ ]     WSC (WiFi Simple Config)
                     [*]     LLTD (Link Layer Topology Discovery Protocol)
                     [*]     WDS
                     [*]     MBSSID
                     [*]       New MBSSID MODE
                     [*]     AP-CLient Support
                     [*]       MAC Repeater Support
                     [ ]     IGMP snooping (NEW)
                     [ ]     NETIF Block (NEW)
                     [ ]     DFS (NEW)
                     [*]     Carrier Detect
                     [ ]     DLS ((Direct-Link Setup) Support (NEW)
                     [ ]     IDS (Intrusion Detection System) Support (NEW)
                     [*]     CoC Support (NEW)
                     [ ]     Memory Optimization (NEW)
                     [ ]     Video Turbine support (NEW)
                     [ ]     802.11n Draft3 (NEW)
                     [ ]     Adjust Power Consumption Support (NEW
                     [ ]     Single SKU (NEW)
                     Choose Power Design (Internal PA and Internal LNA)  --->
                     [ ]   TSSI Compensation (NEW)
                     [ ]   Temperature Compensation (NEW)

Pastikan pilih (*) untuk membuat driver masuk ke kernel, bukan kernel module.

Buat lagi firmware

cd ~/openwrt.trunk/trunk/
make V=99
make world

Flash Linksys E1700

Flash image yang di hasilkan ke router. Device ra0 akan muncul

ifconfig ra0

Kita tidak bisa mengkonfigurasi

ifconfig ra0 up.

Karena kita ridak memiliki file

/etc/Wireless/RT2860/RT2860.dat

Atau symbol link ke /tmp/RT2860.dat.

File tersebut di buat oleh script di directory /lib/wifi/ yang pertama kali di perkenalkan oleh lintel.


7. Enjoy DIY with your hands.

I will not provide the dat file or script file. you need to scratch up those file by yourself.

Last commit, I havn't shared the script file.

This Time, I shared the script file named: rt2860v2.sh.

I fixed the wrong default mac address problem via shell command in this script file, you know, it's not the best, but works well.

Your can define your perefered mac addres in /etc/config/wireless file with option macaddr '1a:1a:1a:1a:1a:1a';

Or you can read out the factory default mac address in eeprom, using this shell:

hexdump -s 4 -n 6 -C /dev/mtd2 | head -n 1 | sed 's/\ \ /:/g' | cut -d: -f 2 | sed 's/\ /:/g'

substitute and eval this shell in the appropriate place in rt2860v2.sh file. you can get everything automatically. Where is the best and perfect firmware? I will not to Share out any more. Dive into the code and fix it by yourself, it's so easy. 8. Say thanks to me as much as you can.

sorry for these Chinglish, wish you can read it.


Then, you can download and burn the new firmware to the mt7620 SOC Board via TFTP in the uboot stage.

Lebih Lanjut

Referensi