Openwrt: Difference between revisions

From Halfface
Jump to navigation Jump to search
Line 39: Line 39:
==recover tp-link wr1043nd==
==recover tp-link wr1043nd==
you can use any hexeditor to delete the first 0x20200 byte, it will start with 01 00 00 00 54 50 after delete
you can use any hexeditor to delete the first 0x20200 byte, it will start with 01 00 00 00 54 50 after delete
  dd if=orig.bin of=tplink.bin skip=131584 bs=1
  dd if=wr1043nv1_en_3_9_17_up_boot\(091118\).bin of=tplink.bin.257 skip=257 bs=512
tftp server
tftp server
  code.bin containing openwrt firmware.
  code.bin containing openwrt firmware.

Revision as of 07:46, 27 February 2010

Small linux for routers

Router

http://wiki.openwrt.org/inbox/tp-link.tl-wr1043nd

Write firmware

mtd write /tmp/openwrt-brcm47xx-squashfs.trx linux
reboot
mtd -e firmware write /tmp/openwrt-ar71xx-tl-wr1043ndv1-squashfs-universal.bin firmware
reboot

Which version of openwrt is installed.

cat /etc/banner

read /var/log/messages

logread

packages

update package list

opkg update 

install openvpn

opkg install http://downloads.openwrt.org/kamikaze/8.09.2/brcm-2.4/packages/zlib_1.2.3-5_mipsel.ipk
opkg install http://downloads.openwrt.org/kamikaze/8.09.2/brcm-2.4/packages/libopenssl_0.9.8i-3.2_mipsel.ipk
opkg install http://downloads.openwrt.org/kamikaze/8.09.2/brcm-2.4/packages/liblzo_2.03-1_mipsel.ipk
opkg install http://downloads.openwrt.org/kamikaze/8.09.2/brcm-2.4/packages/openvpn_2.0.9-5.1_mipsel.ipk

mount jffs2

mount -t jffs2 /dev/mtdblock3 /jffs/

list wireless

iw phy

serial cable

http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort
http://wiki.openwrt.org/oldwiki/openwrtdocs/customizing/hardware/serial_console
http://wiki.openwrt.org/inbox/tp-link.tl-wr1043nd#oem.installation.using.the.tftp.and.rs232.method
http://jethomson.wordpress.com/2010/02/21/diy-usb-to-serial-cable-for-3usd/

openwrt

http://eko.one.pl/openwrt/
http://openwrt.groov.pl

recover tp-link wr1043nd

you can use any hexeditor to delete the first 0x20200 byte, it will start with 01 00 00 00 54 50 after delete

dd if=wr1043nv1_en_3_9_17_up_boot\(091118\).bin of=tplink.bin.257 skip=257 bs=512

tftp server

code.bin containing openwrt firmware.
  • Cut cable of ca-42 and locate the four cables. gnd, rx, tx, ttl

Ca-42 dku-5 pinout.jpg Serial port cummunication values.

115200 8n1

Connect cables to wr1043nd and plug usb in computer. Start terminal emulator.

screen /dev/ttyUSB0

Start router and look at terminal. When waiting for 1 second press

tpl 
  • when it show autobooting, it will let you get into U-boot.
  • you can set the router ip address by
setenv ipaddr 192.168.1.1
  • tftpd server address by
setenv serverip 192.168.1.100

What to write in ubootin

erase 0xbf020000 +7c0000
7c0000: size of the firmware (be aware that u can have diffrent size so u will brick your router) 
tftpboot 0x81000000 code.bin
cp.b 0x81000000 0xbf020000 0x7c0000
bootm 0xbf020000