海运的博客

RG100-AA通过TTL线刷OpenWRT系统

发布时间:August 23, 2012 // 分类:OpenWrt // No Comments

不小心RG100-AA成砖了,先尝试用TTL修复吧,不行再使用JTAG,USB-TTL PL-2303_HX_数据线驱动

黑=GND
白=RXD
灰=TXD

RG100-AA TTL连接图,从左到右依次为:VCC-GND-RXD-TXD
RG100A刷机TTL连接图.png
securecrt参数设置:
securecrt使用TTL连接刷机参数.png
以下开始刷机,按住路由reset键,然后开启路由电源,10秒左右松开reset键,进入CFE界面,输入e a回车清除flash信息,CFE登录账号和密码:

#https://www.haiyun.me
用户:telecomadmin 密码:telecomadmin
用户:telecomadmin 密码:nE7jA%5m 
帐号:admin       密码:8mCnC@bj 
帐号:bjcnchgw     密码:8mCnC@bj

清除信息后会重新启动进入CFE界面,将网络插入LAN4接口,通过浏览器打开192.168.1.1进入WEB升级界面,密码同上,上传OpenWRT固件刷机即可。
整个步骤securecrt显示如下:

Initializing Arena.
Initializing Devices.
Parallel flash device: name AM29LV320MT|S29GL128-A, id 0x2201, size 16384KB
Flash Layout: Boot[0,0xbe000000] Kern[1,0xbe020000]
              AuxFS[93,0xbeba0000] Misc[125,0xbefa0000] PSI[127,0xbefe0000]
Flash RootFS Partition Length: 12058624
CPU type 0x2A010: 300MHz, Bus: 133MHz, Ref: 64MHz
CPU running TP0
Total memory: 67108864 bytes (64MB)

Total memory used by CFE:  0x80401000 - 0x80529850 (1214544)
Initialized Data:          0x8041E730 - 0x80421050 (10528)


** Flash image not found. **


*** Break into CFE console ***

Board IP address                  : 192.168.1.1:ffffff00  
Host IP address                   : 192.168.1.100  
Gateway IP address                :   
Run from flash/host (f/h)         : f  
Default host run file name        : vmlinux  
Default host flash file name      : bcm963xx_fs_kernel  
Boot delay (0-9 seconds)          : 1  
Board Id (0-8)                    : 96358VW2  
Number of MAC Addresses (1-32)    : 11  
Base MAC Address                  : 00:1f:a3:65:55:8c  
PSI Size (1-64) KBytes            : 24  
Flash Block Size (1-128) in KBytes: 128  
Auxillary File System Size Percent: 25  
Main Thread Number [0|1]          : 0  

udp_send finished
No answer .auto boot ...
CFE> e a
Pleas longin:
user:telecomadmin
passwd:*************
login success
CFE> e a
Erase all flash (except bootrom)? (y/n):y
No image tag found.  Erase the blocks start at [1]
...............................................................................................................................

Resetting board...Boot Address 0xbe000000

Initializing Arena.
Initializing Devices.
Parallel flash device: name AM29LV320MT|S29GL128-A, id 0x2201, size 16384KB
Flash Layout: Boot[0,0xbe000000] Kern[1,0xbe020000]
              AuxFS[93,0xbeba0000] Misc[125,0xbefa0000] PSI[127,0xbefe0000]
Flash RootFS Partition Length: 12058624
CPU type 0x2A010: 300MHz, Bus: 133MHz, Ref: 64MHz
CPU running TP0
Total memory: 67108864 bytes (64MB)

Total memory used by CFE:  0x80401000 - 0x80529850 (1214544)
Initialized Data:          0x8041E730 - 0x80421050 (10528)


** Flash image not found. **

Board IP address                  : 192.168.1.1:ffffff00  
Host IP address                   : 192.168.1.100  
Gateway IP address                :   
Run from flash/host (f/h)         : f  
Default host run file name        : vmlinux  
Default host flash file name      : bcm963xx_fs_kernel  
Boot delay (0-9 seconds)          : 1  
Board Id (0-8)                    : 96358VW2  
Number of MAC Addresses (1-32)    : 11  
Base MAC Address                  : 00:1f:a3:65:55:8c  
PSI Size (1-64) KBytes            : 24  
Flash Block Size (1-128) in KBytes: 128  
Auxillary File System Size Percent: 25  
Main Thread Number [0|1]          : 0  

udp_send finished
No answer .auto boot ...
web info: Upload 3801092 bytes, Broadcom image format.
CFE> 
Flashing root file system and kernel at 0xbe020000: ..............................

.
*** Image flash done *** !

Resetting board...Boot Address 0xbe000000

2015.02.09更新:
Windows8.1已自带TTL数据线驱动,插入后通过设备管理器查看COM接口:
2015-02-09_075239.png
然后点击查看属性,后面使用xshell或securecrt要用到:
2015-02-09_075357.png
使用xshell新建会话,速率和上面的不一样:
2015-02-09_075829.png
然后连接:

Connecting to COM3...
Connected.

后面直接开机和进入CFE会显示启动界面,可用于进入CFE刷机或SSH不能连接Openwrt路由时使用。

Linux/Openwrt安装lrzsz使用Xshell快速上传下载文件

发布时间:August 17, 2012 // 分类:OpenWrt,Xshell // 4 Comments

lrzsz是一个下使用zmodem协议的档案传输工具,Xshell支持此功能,服务器端安装lrzsz通过ssh连接可快速上传下载文件。
OpenWRT下lrzsz安装:

opkg update
opkg install lrzsz
ln -s /usr/bin/lrz /usr/bin/rz
ln -s /usr/bin/lsz /usr/bin/sz

上传直接将文件拖到ssh窗口即可,xshell调用rz命令上传文件。
xshell使用rz上传文件.png
下载使用sz 文件名,选择保存目录:
xsehll使用sz下载文件.png

GT701-WG刷OpenWRT系统

发布时间:August 11, 2012 // 分类:OpenWrt // No Comments

GT701-WG配置如下 ,玩玩OpenWRT带几台电脑绰绰有余。

CPU:160MHZ
RAM:16M
FLASH:4M

GT701-WG最新可用Openwrt官方固件下载:http://downloads.openwrt.org/backfire/10.03.1/ar7/openwrt-ar7-squashfs.bin
刷机步骤,开机3秒左右连接到路由FTP:

ftp 192.168.0.1
Connected to 192.168.0.1.
220 ADAM2 FTP Server ready.
Name (192.168.0.1:peter): adam2
331 Password required for adam2.
Password: adam2
230 User adam2 successfully logged in.
Remote system type is UNIX.
ftp> binary
200 Type set to I.
ftp> quote SETENV MAC_PORT,0
200 SETENV command successful
ftp> quote SETENV mtd5,0x90010000,0x903e0000
200 SETENV command successful
ftp> quote MEDIA FLSH
200 Media set to FLSH.
ftp> put "openwrt-ar7-squashfs.bin" "openwrt-ar7-squashfs.bin mtd5"
local: openwrt-ar7-squashfs.bin remote: openwrt-ar7-squashfs.bin mtd5
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
100% |************************************| 2560 KiB 129.35 KiB/s 00:00 ETA
226 Transfer complete.
2621444 bytes sent in 00:20 (122.30 KiB/s)
ftp> quote REBOOT
221-Thank you for using the FTP service on ADAM2.
221 Goodbye.
ftp> quit

网络配置:

config atm-bridge
    option unit     0
    option encaps   llc
    option vpi      0
    option vci      35
    option payload  bridged
config interface wan
    option ifname       nas0
    option proto        pppoe
    option username    "username"
    option password    "password"

刷新为原版系统,提供GT701-WG官方5.5中文固件下载

ftp 192.168.0.1
Connected to 192.168.0.1.
220 ADAM2 FTP Server ready.
Name (192.168.0.1:user): adam2
Password:
230 User adam2 successfully logged in.
Remote system type is UNIX.
ftp> binary
200 Type set to I.
ftp> quote UNSETENV mtd5
200 UNSETENV command successful
ftp> quote UNSETENV MAC_PORT
200 UNSETENV command successful
ftp> quote MEDIA FLSH
200 Media set to FLSH.
ftp> put nsp.ar7wrd.squashfs.img "nsp.ar7wrd.squashfs.img mtd0"
local: nsp.ar7wrd.squashfs.img remote: nsp.ar7wrd.squashfs.img mtd0
502 Command not implemented - Try HELP.
227 Entering Passive Mode (192,168,0,1,4,45).
150 Opening BINARY mode data connection for file transfer.
100% |*************************************|  1940 KB   82.54 KB/s    00:00 ETA
226 Transfer complete.
1986560 bytes sent in 00:23 (81.18 KB/s)
ftp> put ram_zimage_pad.ar7wrd.nsp.squashfs.bin "ram_zimage_pad.ar7wrd.nsp.squashfs.bin mtd1"
local: ram_zimage_pad.ar7wrd.nsp.squashfs.bin remote: ram_zimage_pad.ar7wrd.nsp.squashfs.bin mtd1
227 Entering Passive Mode (192,168,0,1,4,45).
150 Opening BINARY mode data connection for file transfer.
100% |*************************************|   640 KB   85.43 KB/s    00:00 ETA
226 Transfer complete.
655360 bytes sent in 00:07 (81.14 KB/s)
ftp> quote REBOOT
221-Thank you for using the FTP service on ADAM2.
221 Goodbye.
ftp> quit

Openwrt使用mtd和sysupgrade刷机、备份恢复系统配置

发布时间:August 11, 2012 // 分类:OpenWrt // 3 Comments

查看当前系统分区信息:

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00020000 "CFE"
mtd1: 000dff00 00020000 "kernel"
mtd2: 00ee0000 00020000 "rootfs"
mtd3: 00840000 00020000 "rootfs_data"
mtd4: 00020000 00020000 "nvram"
mtd5: 00fc0000 00020000 "linux"

备份系统CFE:

dd if=/dev/mtd0 of=/mnt/cfe.bin

备份恢复Openwrt系统配置:

#备份自定义系统信息,包括新安装软件
dd if=/dev/mtd3 of=/mnt/overlay.bin
#恢复备份设置
mtd -r write /mnt/overlay.bin rootfs_data
#仅备份系统配置
sysupgrade -b /mnt/back.tar.gz
#恢复系统配置
sysupgrade -r /mnt/back.tar.gz

恢复Openwrt系统默认设置:

rm -rf /overlay/* && reboot
#删除/overlay分区所有文件,重启即恢复默认设置
mtd -r erase rootfs_data
#使用mtd清除/overlay分区信息后重启即恢复默认设置

刷新系统:

#使用mtd更新系统
mtd -r write openwrt.bin linux
#刷机并恢复系统配置,推荐
sysupgrade -f /mnt/back.tar.gz img.bin

Ubuntu/CentOS下编译OpenWRT固件

发布时间:August 10, 2012 // 分类:OpenWrt // 2 Comments

Ubuntu安装编译环境:

apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils\ 
subversion libncurses5-dev ncurses-term zlib1g-dev 

CentOS安装编译环境:

yum install autoconf binutils bison bzip2 flex gawk gcc gcc-c++ gettext make ncurses-devel patch \
unzip wget zlib-devel

编译以非root用户运行,新建用户:

useradd -m openwrt
su -l openwrt

获取源码:

#开发版
#svn co svn://svn.openwrt.org/openwrt/trunk 
#10.03
#svn co svn://svn.openwrt.org/openwrt/branches/backfire
#12.09
#svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment
#14.07
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker
#指定svn版本
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker -r 42625 
cd barrier_breaker
./scripts/feeds update -a
./scripts/feeds install -a

或Git获取源码:

#开发版
git clone git://git.openwrt.org/openwrt.git
#14.07
git clone git://git.openwrt.org/14.07/openwrt.git

更多见:
http://wiki.openwrt.org/doc/howto/buildroot.exigence#trunk_main_development_tree
https://dev.openwrt.org/wiki/GetSource
进入编译选项:

make menuconfig

可以在编译前添加/修改配置文件,所在目录:

package/base-files/files/

编译固件,编译成功后固件在当前目录bin目录下,可以先编译x86使用vmware测试openwrt固件

make
-j n #多线程,可使用CPUx2
V=99 #详细输出

编译单个软件,进入编译选项选择要编译的软件后,如果没有make需执行以下:

make tools/install
make toolchain/install

然后编译指定的软件:

make package/name/compile

遇到的问题:
/target-i386_i486_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyyynyyyyyyyynyyyynyyyynnyynnnyyyy] Error 2
编译gcc的问题,使用系统自带gcc正常,见https://dev.openwrt.org/ticket/17805
然后又遇到barrier_breaker/include/toplevel.mk:171: recipe for target 'world' failed
删除之前gcc编译生成的文件,见https://dev.openwrt.org/ticket/11175

make dirclean
分类
最新文章
最近回复
  • opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
  • zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...