教程地址:
http://www.right.com.cn/forum/thread-169358-1-1.html
root:kf42
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "u-boot"
mtd1: 0014476c 00010000 "kernel"
mtd2: 0028b894 00010000 "rootfs"
mtd3: 000a0000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 003d0000 00010000 "firmware"
root@OpenWrt:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 0C:82:68:EB:47:18
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4353 errors:0 dropped:5 overruns:0 frame:0
TX packets:2701 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:520880 (508.6 KiB) TX bytes:275426 (268.9 KiB)
Interrupt:4
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/ar933x_wmac'
option htmode 'HT20'
option disabled '0'
option txpower '17'
option channel '8'
config wifi-iface
option device 'radio0'
option network 'lan'
option mode 'ap'
option encryption 'psk2'
option key 'kf42****'
option ssid 'mywifit'
注意,看这里。现在putty连时用ip 192.168.1.188
http://blog.appdevp.com/archives/290
先设置电脑IP 192.168.1.3
路由器上的网络插入电脑,putty登录192.168.1.1
root
输入下面这些信息:
设置lan ip(即访问路由的ip,与一级路由不同网段)
uci set network.lan.ipaddr=192.168.2.1
设置wan口类型为静态
uci set network.wan.proto=static
设置wan ip
uci set network.wan.ipaddr=192.168.1.200
网关指向上级路由
uci set network.wan.gateway=192.168.1.1
dns指向上级路由
uci set network.wan.dns=192.168.1.1
2.配置无线网络
打开无线
uci set wireless.@wifi-device[0].disabled=0
设置功率为17dbm
uci set wireless.@wifi-device[0].txpower=17
设置无线信道为8
uci set wireless.@wifi-device[0].channel=8
设置无线模式为ap
uci set wireless.@wifi-iface[0].mode=ap
设置无线SSID
uci set wireless.@wifi-iface[0].ssid=xxxxxx
无线链接到lan上
uci set wireless.@wifi-iface[0].network=lan
设置加密为WPA2-PSK
uci set wireless.@wifi-iface[0].encryption=psk2
设置无线密码
uci set wireless.@wifi-iface[0].key=kf42
————————————————————————-
3.应用配置:
应用提交
uci commit
重新启动网络
/etc/init.d/network restart
————————————————————————-
将电脑上的网线和路由器拔下来,插到另外的上级路由器上。重启,路由器就会显示xxxxx的wifi信号了
电脑连上xxxxx,ip改成192.168.2.3,用putty就可以登录192.168.2.1了。
我连上后,改vi /etc/config/network 192.168.2.1 改成192.168.1.188 本电脑改回自动ip,ssh 192.168.1.188也可以
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd36:f77a:1bcd::/48'
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.188'
~
在文件/etc/config/dhcp应该有一段是这样子的:
config 'dhcp' 'lan'
option 'interface' 'lan'
option 'start' '100'
option 'limit' '150'
option 'leasetime' '12h'
list 'dhcp_option' '6,87.216.1.65,87.216.1.66'
之前一直上不了网,终于找到原因了:
ping www.baidu.com ping不通
ping 119.75.217.56 显示:ping: sendto: Network unreachable
百度一下找到:
在我的板子上ping路由上的IP的时候可以ping通,但是ping外网的IP的时候提示“ping: sendto: Network is unreachable”
后来使用route命令看了一下
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 rausb0
发现网关(Gateway),是空着的没有设置,于是执行一下命令设置了网关:
# route add default gw 192.168.1.1
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 rausb0
default 192.168.1.1 0.0.0.0 UG 0 0 0 rausb0
最后终于可以ping通外网了
# ping 119.75.217.56
PING 119.75.217.56 (119.75.217.56): 56 data bytes
64 bytes from 119.75.217.56: seq=0 ttl=52 time=38.349 ms
64 bytes from 119.75.217.56: seq=1 ttl=52 time=30.369 ms
64 bytes from 119.75.217.56: seq=2 ttl=52 time=30.541 ms
64 bytes from 119.75.217.56: seq=3 ttl=52 time=29.659 ms
64 bytes from 119.75.217.56: seq=4 ttl=52 time=29.786 ms
另外如果网络的其他信息没有设置好,也会出现这样的情况,可以参考如下设置(http://www.lslnet.com/linux/f/docs1/i57/big5378732.htm)
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.255.255.0 lo
ifconfig eth0 192.168.10.0
route add -net 192.168.10.0 netmask 255.255.255.0
试了一下,终于可以了
已经装了:
opkg install mjpg-streamer
telnet 192.168.1.1
一。让设备联网
1.1 pppoe用户:
设置wan口类型为pppoe
uci set network.wan.proto=pppoe
设置pppoe用户名和密码、mtu
uci set network.wan.username=xxxxx
uci set network.wan.password=xxxxxx
uci set network.wan.mtu=1492
1.2二级路由模式(非DHCP获取):
设置lan ip(即访问路由的ip,与一级路由不同网段)
uci set network.lan.ipaddr=192.168.2.1
设置wan口类型为静态
uci set network.wan.proto=static
设置wan ip
uci set network.wan.ipaddr=192.168.1.200
网关指向上级路由
uci set network.wan.gateway=192.168.1.1
dns指向上级路由
uci set network.wan.dns=192.168.1.1
1.3交换机模式(当交换机用,WAN口空置)
关掉wan
uci set network.wan.proto=none
设置lan ip(本路由登陆IP)
uci set network.lan.ipaddr=192.168.1.100
网关指向上级路由
uci set network.lan.gateway=192.168.1.1
dns指向上级路由
uci set network.lan.dns=192.168.1.1
关掉lan的dhcp
uci set dhcp.lan.ignore=1
2.配置无线
打开无线
uci set wireless.@wifi-device[0].disabled=0
设置功率为17dbm 太高会烧无线模块
uci set wireless.@wifi-device[0].txpower=17
设置无线信道为8
uci set wireless.@wifi-device[0].channel=8
以下2行是开启300M
uci set wireless.@wifi-device[0].htmode=HT40-
uci set wireless.@wifi-device[0].noscan=1
设置无线模式为ap
uci set wireless.@wifi-iface[0].mode=ap
设置无线SSID
uci set wireless.@wifi-iface[0].ssid=xxxxxx
无线链接到lan上
uci set wireless.@wifi-iface[0].network=lan
设置加密为WPA2-PSK
uci set wireless.@wifi-iface[0].encryption=psk2
设置无线密码
uci set wireless.@wifi-iface[0].key=xxxxx
3.最后应用配置:
应用
uci commit
重新启动网络
/etc/init.d/network restart
二。安装组件
查看已安装的组件包
opkg list-installed
更新组件包package
opkg update
安装luci的web配置界面
opkg install luci
启动uhttpd服务
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
这时,在浏览器打开192.168.1.1(如果没修改过)进入web配置界面
本地源设置:
vi ect/opkg.conf
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz barrier_breaker_base http://192.168.1.110 末尾添加
执行opkg update
root@OpenWrt:/etc# opkg update
root@OpenWrt:/etc# opkg install nano
root@OpenWrt:/etc# opkg remove nano
root@OpenWrt:/etc# cat openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r48135'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r48135'
DISTRIB_TAINTS=''
src/gz barrier_breaker_base https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base
src/gz barrier_breaker_luci https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci
src/gz barrier_breaker_management https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management
src/gz barrier_breaker_oldpackages https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages
src/gz barrier_breaker_packages https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages
src/gz barrier_breaker_routing https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing
src/gz barrier_breaker_telephony https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony
src/gz barrier_breaker_base https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/
src/gz chaos_calmer_base https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base
src/gz chaos_calmer_luci https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/luci
src/gz chaos_calmer_management https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/management
src/gz chaos_calmer_oldpackages https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/oldpackages
src/gz chaos_calmer_packages https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/packages
src/gz chaos_calmer_routing https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/routing
src/gz chaos_calmer_telephony https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/telephony
src/gz chaos_calmer_base https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/
src/gz chaos_calmer_base http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/base
src/gz chaos_calmer_luci http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/luci
src/gz chaos_calmer_management http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/management
src/gz chaos_calmer_oldpackages http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/oldpackages
src/gz chaos_calmer_packages http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/packages
src/gz chaos_calmer_routing http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/routing
src/gz chaos_calmer_telephony http://aqb.openwrt.bobiji.com//chaos_calmer/15.05/ar71xx/generic/packages/telephony
src/gz chaos_calmer_base http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/
一次替换文件里的内容:
sed -i 's/jsl.openwrt.bobiji.com/aqb.openwrt.bobiji.com/g' /etc/opkg.conf
sed -i 's/aqb.openwrt.bobiji.com/openwrt.mrx.one/g' /etc/opkg.conf
sed -i 's/openwrt.mrx.one/jsl.openwrt.bobiji.com/g' /etc/opkg.conf
sed -i 's/jsl.openwrt.bobiji.com/openwrt.mrx.one/g' /etc/opkg.conf
df -h 查看空间
记一下如何好使的:
一定要先设置wifi后安装下面这些,不然没空间!!!就设置不了wifi了,没空间写不进数据了
http://www.znck007.com/forum.php?mod=viewthread&tid=21570
我刷了openwrt, 不好使,后来在openwrt下,用命令
mtd -r write xxxx.bin firmware 重新装了openwrt-ar71xx-generic-tl-mr13u-v1-squashfs-factory.bin
路由器网络 连接插入电脑,打开网页,直接就可以192.168.1.1了,设置wifi(上面的链接)
putty连上后
opkg update
opkg install kmod-video-uvc 只装这2个就能显示图像
opkg install mjpg-streamer 只装这2个就能显示图像
opkg install ser2net 引出rx tx ttl
opkg install kmod-video-pwc 不装,浪费空间
opkg install kmod-usb-ohci 不装,浪费空间
ls /dev 怎么都不显示/video0,硬重启了一下路由后,再打这个命令就看到video0了。
按这个设置的
http://tieba.baidu.com/p/2565884424
http://www.right.com.cn/forum/thread-76305-1-1.html
不用装什么驱动
mjpg_streamer -i "input_uvc.so -r 640x480 -f 30" -o "output_http.so -p 8080 -w /www"
192.168.0.2:8080/?action=stream(动态视频)
192.168.0.2:8080/?action=snapshot(静态图像)
http://blog.csdn.net/jk110333/article/details/8920131
#!/bin/sh /etc/rc.common
# /init.d/startCamera
START=50
start()
{
mjpg_streamer -i "input_uvc.so --yuv -r 352x288" -o"output_http.so -w /tmp/webcam"
}
stop()
{
killall startCamera
}
刚装完:
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 640.0K 216.0K 424.0K 34% /
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 14.1M 612.0K 13.5M 4% /tmp
tmpfs 14.1M 36.0K 14.1M 0% /tmp/root
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock3 640.0K 216.0K 424.0K 34% /overlay
overlayfs:/overlay 640.0K 216.0K 424.0K 34% /
opkg list_installed命令查看安装程序的列表
opkg remove+程序名称卸载
将不是必须的程序删掉就行了
恢复路由默认设置:
System->Backup /Flash Firmware -> Perform reset
恢复后设置 wifi:
network -> wifi -> Scan -> 选择你的wifi -> join network -> 输入密码->submit
network -> wifi -> Add -> Interface Configuration -> ESSID输入要生成的wifi名 xxxCar,选择lan -> Wireless Security设置 WPA-PSK/WPA2-PSK Mixed -> Key输入要设置的密码
到这里就可以上网了,可以看到xxxCar wifi了
到System -> Administration里设置putty要登录的账号密码,root + 密码
在System -> Software可以查看到剩下的空间
在network -> interface -> LAN -> Edit -> DHCP Server -> Advanced Settings -> 勾选 Dynamic DHCP 和 Force 并在DHCP-Options里输入3,192.168.10.1 这样使用xxxCar wifi的设备会自动分配IP,IP为192.168.10.x
ttl刷机:
我的路由器上的线,黄色连接usb2ttl上的gdn,红色接txd,蓝色接rxd (蓝色线在焊点模块的内侧,红色在外)
usb2ttl需要安装驱动
插入网线,设置本地链接:192.168.1.100 255.255.255.0 192.168.1.1
打开secureCRT,看usb2tll的com是几
Serial
COM4
115200
取消RTS/CTS
连接,打开View->Char window,输入tpl,然后 打开路由器开关,当出现Autobooting in 1 seconds的时候,按回车执行tpl命令进入安全模式,这里绝对要掌握好时间
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
hornet> 就会来这里了
打开tftp32 软件界面是否出现服务器ip:192.168.1.100,将openwrt.bin文件放到和他一个目录下,我改成11.bin文件放到和他一个目录下
执行命令
setenv serverip 192.168.1.100
tftpboot 0x80000000 11.bin
erase 0x9f020000 +0x3c0000(这个值是输出的Bytes transferred = 3932160 (3c0000 hex),不一样就改一下)
cp.b 0x80000000 0x9f020000 0x3c0000
bootm 0x9f020000
hornet> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
bootcmd=bootm 0x9f020000
bootdelay=1
baudrate=115200
ethaddr=0xba:0xbe:0xfa:0xce:0x07:0x41
ipaddr=192.168.1.111
serverip=192.168.1.100
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
Environment size: 362/65532 bytes
hornet> setenv serverip 192.168.1.100
hornet> tftpboot 0x80000000 11.bin
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.111
Filename '11.bin'.
Load address: 0x80000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
######################################################
done
Bytes transferred = 3932160 (3c0000 hex)
hornet> erase 0x9f020000 +0x3c0000
First 0x2 last 0x3d sector size 0x10000
61
Erased 60 sectors
hornet> cp.b 0x80000000 0x9f020000 0x3c0000
Copy to Flash... write addr: 9f020000
done
hornet> bootm 0x9f020000
## Booting image at 9f020000 ...
Uncompressing Kernel Image ... OK
Starting kernel ...
之后,就可以直接打开192.168.1.1,看到页面了
外网访问时,要把openwrt里,防火墙全部改成aceept
可以加密码。
修改/etc/init.d/mjpg-streamer文件
start函数里面,增加:
config_get username core username
config_get password core password
http://www.right.com.cn/forum/thread-169358-1-1.html
root:kf42
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "u-boot"
mtd1: 0014476c 00010000 "kernel"
mtd2: 0028b894 00010000 "rootfs"
mtd3: 000a0000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 003d0000 00010000 "firmware"
root@OpenWrt:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 0C:82:68:EB:47:18
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4353 errors:0 dropped:5 overruns:0 frame:0
TX packets:2701 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:520880 (508.6 KiB) TX bytes:275426 (268.9 KiB)
Interrupt:4
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/ar933x_wmac'
option htmode 'HT20'
option disabled '0'
option txpower '17'
option channel '8'
config wifi-iface
option device 'radio0'
option network 'lan'
option mode 'ap'
option encryption 'psk2'
option key 'kf42****'
option ssid 'mywifit'
注意,看这里。现在putty连时用ip 192.168.1.188
http://blog.appdevp.com/archives/290
先设置电脑IP 192.168.1.3
路由器上的网络插入电脑,putty登录192.168.1.1
root
输入下面这些信息:
设置lan ip(即访问路由的ip,与一级路由不同网段)
uci set network.lan.ipaddr=192.168.2.1
设置wan口类型为静态
uci set network.wan.proto=static
设置wan ip
uci set network.wan.ipaddr=192.168.1.200
网关指向上级路由
uci set network.wan.gateway=192.168.1.1
dns指向上级路由
uci set network.wan.dns=192.168.1.1
2.配置无线网络
打开无线
uci set wireless.@wifi-device[0].disabled=0
设置功率为17dbm
uci set wireless.@wifi-device[0].txpower=17
设置无线信道为8
uci set wireless.@wifi-device[0].channel=8
设置无线模式为ap
uci set wireless.@wifi-iface[0].mode=ap
设置无线SSID
uci set wireless.@wifi-iface[0].ssid=xxxxxx
无线链接到lan上
uci set wireless.@wifi-iface[0].network=lan
设置加密为WPA2-PSK
uci set wireless.@wifi-iface[0].encryption=psk2
设置无线密码
uci set wireless.@wifi-iface[0].key=kf42
————————————————————————-
3.应用配置:
应用提交
uci commit
重新启动网络
/etc/init.d/network restart
————————————————————————-
将电脑上的网线和路由器拔下来,插到另外的上级路由器上。重启,路由器就会显示xxxxx的wifi信号了
电脑连上xxxxx,ip改成192.168.2.3,用putty就可以登录192.168.2.1了。
我连上后,改vi /etc/config/network 192.168.2.1 改成192.168.1.188 本电脑改回自动ip,ssh 192.168.1.188也可以
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd36:f77a:1bcd::/48'
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.188'
~
在文件/etc/config/dhcp应该有一段是这样子的:
config 'dhcp' 'lan'
option 'interface' 'lan'
option 'start' '100'
option 'limit' '150'
option 'leasetime' '12h'
list 'dhcp_option' '6,87.216.1.65,87.216.1.66'
之前一直上不了网,终于找到原因了:
ping www.baidu.com ping不通
ping 119.75.217.56 显示:ping: sendto: Network unreachable
百度一下找到:
在我的板子上ping路由上的IP的时候可以ping通,但是ping外网的IP的时候提示“ping: sendto: Network is unreachable”
后来使用route命令看了一下
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 rausb0
发现网关(Gateway),是空着的没有设置,于是执行一下命令设置了网关:
# route add default gw 192.168.1.1
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 rausb0
default 192.168.1.1 0.0.0.0 UG 0 0 0 rausb0
最后终于可以ping通外网了
# ping 119.75.217.56
PING 119.75.217.56 (119.75.217.56): 56 data bytes
64 bytes from 119.75.217.56: seq=0 ttl=52 time=38.349 ms
64 bytes from 119.75.217.56: seq=1 ttl=52 time=30.369 ms
64 bytes from 119.75.217.56: seq=2 ttl=52 time=30.541 ms
64 bytes from 119.75.217.56: seq=3 ttl=52 time=29.659 ms
64 bytes from 119.75.217.56: seq=4 ttl=52 time=29.786 ms
另外如果网络的其他信息没有设置好,也会出现这样的情况,可以参考如下设置(http://www.lslnet.com/linux/f/docs1/i57/big5378732.htm)
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.255.255.0 lo
ifconfig eth0 192.168.10.0
route add -net 192.168.10.0 netmask 255.255.255.0
试了一下,终于可以了
已经装了:
opkg install mjpg-streamer
telnet 192.168.1.1
一。让设备联网
1.1 pppoe用户:
设置wan口类型为pppoe
uci set network.wan.proto=pppoe
设置pppoe用户名和密码、mtu
uci set network.wan.username=xxxxx
uci set network.wan.password=xxxxxx
uci set network.wan.mtu=1492
1.2二级路由模式(非DHCP获取):
设置lan ip(即访问路由的ip,与一级路由不同网段)
uci set network.lan.ipaddr=192.168.2.1
设置wan口类型为静态
uci set network.wan.proto=static
设置wan ip
uci set network.wan.ipaddr=192.168.1.200
网关指向上级路由
uci set network.wan.gateway=192.168.1.1
dns指向上级路由
uci set network.wan.dns=192.168.1.1
1.3交换机模式(当交换机用,WAN口空置)
关掉wan
uci set network.wan.proto=none
设置lan ip(本路由登陆IP)
uci set network.lan.ipaddr=192.168.1.100
网关指向上级路由
uci set network.lan.gateway=192.168.1.1
dns指向上级路由
uci set network.lan.dns=192.168.1.1
关掉lan的dhcp
uci set dhcp.lan.ignore=1
2.配置无线
打开无线
uci set wireless.@wifi-device[0].disabled=0
设置功率为17dbm 太高会烧无线模块
uci set wireless.@wifi-device[0].txpower=17
设置无线信道为8
uci set wireless.@wifi-device[0].channel=8
以下2行是开启300M
uci set wireless.@wifi-device[0].htmode=HT40-
uci set wireless.@wifi-device[0].noscan=1
设置无线模式为ap
uci set wireless.@wifi-iface[0].mode=ap
设置无线SSID
uci set wireless.@wifi-iface[0].ssid=xxxxxx
无线链接到lan上
uci set wireless.@wifi-iface[0].network=lan
设置加密为WPA2-PSK
uci set wireless.@wifi-iface[0].encryption=psk2
设置无线密码
uci set wireless.@wifi-iface[0].key=xxxxx
3.最后应用配置:
应用
uci commit
重新启动网络
/etc/init.d/network restart
二。安装组件
查看已安装的组件包
opkg list-installed
更新组件包package
opkg update
安装luci的web配置界面
opkg install luci
启动uhttpd服务
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
这时,在浏览器打开192.168.1.1(如果没修改过)进入web配置界面
本地源设置:
vi ect/opkg.conf
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz barrier_breaker_base http://192.168.1.110 末尾添加
执行opkg update
root@OpenWrt:/etc# opkg update
root@OpenWrt:/etc# opkg install nano
root@OpenWrt:/etc# opkg remove nano
root@OpenWrt:/etc# cat openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r48135'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r48135'
DISTRIB_TAINTS=''
src/gz barrier_breaker_base https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base
src/gz barrier_breaker_luci https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci
src/gz barrier_breaker_management https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management
src/gz barrier_breaker_oldpackages https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages
src/gz barrier_breaker_packages https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages
src/gz barrier_breaker_routing https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing
src/gz barrier_breaker_telephony https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony
src/gz barrier_breaker_base https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/
src/gz chaos_calmer_base https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base
src/gz chaos_calmer_luci https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/luci
src/gz chaos_calmer_management https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/management
src/gz chaos_calmer_oldpackages https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/oldpackages
src/gz chaos_calmer_packages https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/packages
src/gz chaos_calmer_routing https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/routing
src/gz chaos_calmer_telephony https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/telephony
src/gz chaos_calmer_base https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/
src/gz chaos_calmer_base http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/base
src/gz chaos_calmer_luci http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/luci
src/gz chaos_calmer_management http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/management
src/gz chaos_calmer_oldpackages http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/oldpackages
src/gz chaos_calmer_packages http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/packages
src/gz chaos_calmer_routing http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/routing
src/gz chaos_calmer_telephony http://aqb.openwrt.bobiji.com//chaos_calmer/15.05/ar71xx/generic/packages/telephony
src/gz chaos_calmer_base http://aqb.openwrt.bobiji.com/chaos_calmer/15.05/ar71xx/generic/packages/
一次替换文件里的内容:
sed -i 's/jsl.openwrt.bobiji.com/aqb.openwrt.bobiji.com/g' /etc/opkg.conf
sed -i 's/aqb.openwrt.bobiji.com/openwrt.mrx.one/g' /etc/opkg.conf
sed -i 's/openwrt.mrx.one/jsl.openwrt.bobiji.com/g' /etc/opkg.conf
sed -i 's/jsl.openwrt.bobiji.com/openwrt.mrx.one/g' /etc/opkg.conf
df -h 查看空间
记一下如何好使的:
一定要先设置wifi后安装下面这些,不然没空间!!!就设置不了wifi了,没空间写不进数据了
http://www.znck007.com/forum.php?mod=viewthread&tid=21570
我刷了openwrt, 不好使,后来在openwrt下,用命令
mtd -r write xxxx.bin firmware 重新装了openwrt-ar71xx-generic-tl-mr13u-v1-squashfs-factory.bin
路由器网络 连接插入电脑,打开网页,直接就可以192.168.1.1了,设置wifi(上面的链接)
putty连上后
opkg update
opkg install kmod-video-uvc 只装这2个就能显示图像
opkg install mjpg-streamer 只装这2个就能显示图像
opkg install ser2net 引出rx tx ttl
opkg install kmod-video-pwc 不装,浪费空间
opkg install kmod-usb-ohci 不装,浪费空间
ls /dev 怎么都不显示/video0,硬重启了一下路由后,再打这个命令就看到video0了。
按这个设置的
http://tieba.baidu.com/p/2565884424
http://www.right.com.cn/forum/thread-76305-1-1.html
不用装什么驱动
mjpg_streamer -i "input_uvc.so -r 640x480 -f 30" -o "output_http.so -p 8080 -w /www"
192.168.0.2:8080/?action=stream(动态视频)
192.168.0.2:8080/?action=snapshot(静态图像)
http://blog.csdn.net/jk110333/article/details/8920131
#!/bin/sh /etc/rc.common
# /init.d/startCamera
START=50
start()
{
mjpg_streamer -i "input_uvc.so --yuv -r 352x288" -o"output_http.so -w /tmp/webcam"
}
stop()
{
killall startCamera
}
刚装完:
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 640.0K 216.0K 424.0K 34% /
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 14.1M 612.0K 13.5M 4% /tmp
tmpfs 14.1M 36.0K 14.1M 0% /tmp/root
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock3 640.0K 216.0K 424.0K 34% /overlay
overlayfs:/overlay 640.0K 216.0K 424.0K 34% /
opkg list_installed命令查看安装程序的列表
opkg remove+程序名称卸载
将不是必须的程序删掉就行了
恢复路由默认设置:
System->Backup /Flash Firmware -> Perform reset
恢复后设置 wifi:
network -> wifi -> Scan -> 选择你的wifi -> join network -> 输入密码->submit
network -> wifi -> Add -> Interface Configuration -> ESSID输入要生成的wifi名 xxxCar,选择lan -> Wireless Security设置 WPA-PSK/WPA2-PSK Mixed -> Key输入要设置的密码
到这里就可以上网了,可以看到xxxCar wifi了
到System -> Administration里设置putty要登录的账号密码,root + 密码
在System -> Software可以查看到剩下的空间
在network -> interface -> LAN -> Edit -> DHCP Server -> Advanced Settings -> 勾选 Dynamic DHCP 和 Force 并在DHCP-Options里输入3,192.168.10.1 这样使用xxxCar wifi的设备会自动分配IP,IP为192.168.10.x
ttl刷机:
我的路由器上的线,黄色连接usb2ttl上的gdn,红色接txd,蓝色接rxd (蓝色线在焊点模块的内侧,红色在外)
usb2ttl需要安装驱动
插入网线,设置本地链接:192.168.1.100 255.255.255.0 192.168.1.1
打开secureCRT,看usb2tll的com是几
Serial
COM4
115200
取消RTS/CTS
连接,打开View->Char window,输入tpl,然后 打开路由器开关,当出现Autobooting in 1 seconds的时候,按回车执行tpl命令进入安全模式,这里绝对要掌握好时间
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
hornet> 就会来这里了
打开tftp32 软件界面是否出现服务器ip:192.168.1.100,将openwrt.bin文件放到和他一个目录下,我改成11.bin文件放到和他一个目录下
执行命令
setenv serverip 192.168.1.100
tftpboot 0x80000000 11.bin
erase 0x9f020000 +0x3c0000(这个值是输出的Bytes transferred = 3932160 (3c0000 hex),不一样就改一下)
cp.b 0x80000000 0x9f020000 0x3c0000
bootm 0x9f020000
hornet> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
bootcmd=bootm 0x9f020000
bootdelay=1
baudrate=115200
ethaddr=0xba:0xbe:0xfa:0xce:0x07:0x41
ipaddr=192.168.1.111
serverip=192.168.1.100
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
Environment size: 362/65532 bytes
hornet> setenv serverip 192.168.1.100
hornet> tftpboot 0x80000000 11.bin
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.111
Filename '11.bin'.
Load address: 0x80000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
######################################################
done
Bytes transferred = 3932160 (3c0000 hex)
hornet> erase 0x9f020000 +0x3c0000
First 0x2 last 0x3d sector size 0x10000
61
Erased 60 sectors
hornet> cp.b 0x80000000 0x9f020000 0x3c0000
Copy to Flash... write addr: 9f020000
done
hornet> bootm 0x9f020000
## Booting image at 9f020000 ...
Uncompressing Kernel Image ... OK
Starting kernel ...
之后,就可以直接打开192.168.1.1,看到页面了
外网访问时,要把openwrt里,防火墙全部改成aceept
可以加密码。
修改/etc/init.d/mjpg-streamer文件
start函数里面,增加:
config_get username core username
config_get password core password