网页制作门户网站案例气象网站建设需求方案
news/
2025/9/26 13:23:24/
文章来源:
网页制作门户网站案例,气象网站建设需求方案,情感导师在线咨询服务,室内设计哪里学以下内容源于朱有鹏嵌入式课程的学习与整理#xff0c;如有侵权请告知删除。 一、移植前的准备工作 1、搭建开发环境 #xff08;1#xff09;虚拟机运行着ubuntu14.04系统。 #xff08;2#xff09;X210开发板运行着linux内核镜像、QT4.8文件系统镜像。相关的镜像文件在…以下内容源于朱有鹏嵌入式课程的学习与整理如有侵权请告知删除。 一、移植前的准备工作 1、搭建开发环境 1虚拟机运行着ubuntu14.04系统。 2X210开发板运行着linux内核镜像、QT4.8文件系统镜像。相关的镜像文件在开发板光盘资料的X210V3S_B\linux\QT4.8目录中账号与密码是root、123456。 3虚拟机中有内核源码树这个内核源码树主要用来编译无线网卡驱动源码它的版本必须与板载系统的内核版本一致否则编译后的驱动程序在开发版上运行时会遇到不匹配的问题。这里的内核源码树位于位于/home/xjh/iot/embedded_basic/kernel/x210_kernel。 4搭建好NFS服务器制作好文件夹形式的rootfs。 2、下载与解压无线网卡驱动 1下载地址DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2。 2将驱动源码压缩包解压至/home/xjh/iot/embedded_basic/x210_usb-wifi目录。 通过对比博文第五季2STA模式USB-WIFI网卡移植与测试的无线网卡驱动的内容可以看出两者是完全一样的。 #本课程的无线网卡驱动内容
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi# ls
DPO_MT7601U_LinuxSTA_3.0.0.4_20130913 DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi# cd DPO_MT7601U_LinuxSTA_3.0.0.4_20130913
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913# ls
ate common iwpriv_usage.txt Makefile mgmt phy README_STA_usb RT2870STA.dat sta_ate_iwpriv_usage.txt
chips include mac mcu os rate_ctrl RT2870STACard.dat sta tools
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913# #第五季2STA模式USB-WIFI网卡移植与测试
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver# ls
ap sta
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver# cd sta/
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver/sta# ls
DPO_MT7601U_LinuxSTA_3.0.0.4_20130913 openssl-0.9.8za wpa_supplicant-2.5
DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2 openssl-0.9.8za.tar.gz wpa_supplicant-2.5.tar.gz
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver/sta# cd DPO_MT7601U_LinuxSTA_3.0.0.4_20130913
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver/sta/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913# ls
ate common iwpriv_usage.txt Makefile mgmt phy README_STA_usb RT2870STA.dat sta_ate_iwpriv_usage.txt
chips include mac mcu os rate_ctrl RT2870STACard.dat sta tools
rootubuntu:/home/xjh/iot/hisi_development/usb-wifi/MT7601_driver/sta/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913# 3、确认无线网卡的硬件信息 在板载系统上使用lsusb命令查看无线网卡的“VIDPID”分别是厂商ID和产品ID。 [rootx210v3 ~]# lsusb
Bus 001 Device 009: ID 148f:7601 二、编译驱动源码得到mt7601Usta.ko文件 以下的操作主要为了得到无线网卡的驱动即mt7601Usta.ko文件。 1、确认USB的VID和PID 在x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/common/rtusb_dev_id.c文件中的rtusb_dev_id[ ]数组里列出了该驱动所支持的USB的VID和PID如果USB-WIFI网卡的USB的VID和PID不在该数组中移植时要添加。 USB_DEVICE_ID rtusb_dev_id[] {
#ifdef RT6570{USB_DEVICE(0x148f,0x6570)}, /* Ralink 6570 */
#endif /* RT6570 */{USB_DEVICE(0x148f, 0x7650)}, /* MT7650 */
#ifdef MT7601U{USB_DEVICE(0x148f,0x6370)}, /* Ralink 6370 */{USB_DEVICE(0x148f,0x7601)}, /* MT 6370 */ // 我们的模块就是这个
#endif /* MT7601U */{ }/* Terminating entry */
}; 2、修改Makefile文件 该文件位于x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/目录下。 1注释掉之前的PLATFORM然后在67行添加“PLATFORM SMDK”。 //省略部分代码注释掉这些
#PLATFORM BLPMP
#PLATFORM MT85XX
#PLATFORM MT53XX
#PLATFORM NXP_TV550
#PLATFORM MVL5
#PLATFORM RALINK_3352
#PLATFORM UBICOM_IPX8
#PLATFORM INTELP6
#PLATFORM MSTARTV//添加下面代码
PLATFORM SMDK 2根据实际情况设置内核源码树的路径、交叉编译工具链路径。如果交叉编译工具链没有export出来的话就要添加绝对路径。 ifeq ($(PLATFORM),SMDK)
#LINUX_SRC /home/bhushan/itcenter/may28/linux-2.6-samsung
#CROSS_COMPILE /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
LINUX_SRC /home/xjh/iot/embedded_basic/kernel/x210_kernel
CROSS_COMPILE arm-linux-
endif 3、修改网卡名字可选操作 1有线网卡的名字一般叫做eth0、eth1…ethn无线网卡的名字一般叫做ra0、ra1…ran或者wlan0、wlan1…wlann。 2在x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/include/rtmp_def.h文件中修改内容如下。 1600 //#ifdef ANDROID_SUPPORT
1601 #define INF_MAIN_DEV_NAME wlan
1602 #define INF_MBSSID_DEV_NAME wlan
1603 //#else
1604 //#define INF_MAIN_DEV_NAME ra
1605 //#define INF_MBSSID_DEV_NAME ra
1606 //#endif /* ANDROID_SUPPORT */ 4、添加wpa_supplicant支持 1在x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/config.mk文件中搜索“HAS_WPA_SUPPLICANT”确保“HAS_WPA_SUPPLICANTy”。 24 # Support Wpa_Supplicant25 # i.e. wpa_supplicant -Dralink26 HAS_WPA_SUPPLICANTy27 28 29 # Support Native WpaSupplicant for Network Maganger30 # i.e. wpa_supplicant -Dwext31 HAS_NATIVE_WPA_SUPPLICANT_SUPPORTy 2继续搜索“SMDK”大概在1089行处进行如下修改。 ifeq ($(PLATFORM),SMDK)EXTRA_CFLAGS : $(WFLAGS)export EXTRA_CFLAGS
endif5、编译驱动源码得到mt7601Usta.ko文件 1在x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/下执行“make clen”然后执行“make”此时在该目录下的os/linux/目录中生成mt7601Usta.ko文件。为了挂载将该文件拷贝到/home/xjh/iot/embedded_basic/rootfs/rootfs_xjh目录中。 2可以使用“modinfo mt7601Usta.ko”命令查看驱动信息。 rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux# ls mt*
mt7601Usta.ko mt7601Usta.mod.c mt7601Usta.mod.o mt7601Usta.o
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux# modinfo mt7601Usta.ko
filename: /home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux/mt7601Usta.ko
version: 3.0.0.3
description: RT2870 Wireless Lan Linux Driver
author: Paul Lin paul_linralinktech.com
license: GPL
srcversion: B2632BD2D7AD40A63B72D9E
alias: usb:v148Fp760Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp7601d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp6370d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp7650d*dc*dsc*dp*ic*isc*ip*
depends:
vermagic: 2.6.35.7 preempt mod_unload ARMv7
parm: mac:rt28xx: wireless mac addr (charp)
rootubuntu:/home/xjh/iot/embedded_basic/x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/os/linux# 三、配置无线网卡以实现上网功能 1、安装无线网卡驱动mt7601Usta.ko文件 1首先将上面生成的mt7601Usta.ko文件复制到板载系统的/usr/xjh_usb-wifi目录中。即启动开发板进入系统账号密码是root、123456然后“ifconfig eth0 up”开启有线网卡接着“ifconfig eth0 192.168.1.11”配置有线网卡的IP地址然后利用下面命令将mt7601Usta.ko文件所在的虚拟机目录挂载到板载系统的/mnt目录接着将mt7601Usta.ko文件复制到板载系统/usr/xjh_usb-wifi目录中。 mount -t nfs -o nolock 192.168.1.141:/home/xjh/iot/embedded_basic/rootfs/rootfs_xjh /mnt 2然后将无线网卡插入X210开发板的任意USB插槽。 # 插进第一个USB插槽时的输出
[rootx210v3 ~]#
[rootx210v3 ~]# [ 425.611753] usb 1-1.1: new high speed USB device using s5p-ehci and address 4
[ 425.716551] usb 1-1.1: New USB device found, idVendor148f, idProduct7601
[ 425.722827] usb 1-1.1: New USB device strings: Mfr1, Product2, SerialNumber3
[ 425.730077] usb 1-1.1: Product: 802.11 n WLAN
[ 425.734381] usb 1-1.1: Manufacturer: MediaTek
[ 425.738685] usb 1-1.1: SerialNumber: 1.0# 拔掉usb-wifi网卡时的输出
[rootx210v3 ~]# [ 564.425135] usb 1-1.1: USB disconnect, address 4 3然后安装无线网卡驱动即在/usr/xjh_usb-wifi目录下执行“insmod mt7601Usta.ko”。 [rootx210v3 xjh_usb-wifi]# ls
mt7601Usta.ko
[rootx210v3 xjh_usb-wifi]# insmod mt7601Usta.ko
[ 589.033836] rtusb init rt2870 ---
[ 589.036208] rt2870_probe()!
[ 589.040985] -- RTMPAllocAdapterBlock
[ 589.044569]
[ 589.044572]
#省略部分内容
[ 589.215602] Allocate net device ops success!
[ 589.219828] The name of the new wlan interface is wlan0...
[ 589.225298] RtmpOSNetDevAttach()---
[ 589.232064] ---RtmpOSNetDevAttach(), ret0
[ 589.235286] rt2870_probe()!
[ 589.238079] usbcore: registered new interface driver rt2870
[rootx210v3 xjh_usb-wifi]# 4此时使用“ifconfig -a”查看可以得知无线网卡wlan0的一些信息。 [rootx210v3 xjh_usb-wifi]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:09:C0:FF:EC:48 inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0inet6 addr: fe80::209:c0ff:feff:ec48/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:9603 errors:0 dropped:0 overruns:0 frame:0TX packets:5241 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:14523906 (13.8 MiB) TX bytes:367990 (359.3 KiB)Interrupt:42 Base address:0x4300 # 省略部分代码lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#省略部分代码
#无线网卡对应的“设备文件”wlan0
wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 2、开启无线网卡并设置IP地址 1首先使用命令“ifconfig wlan0 up”开启无线网卡。 [rootx210v3 xjh_usb-wifi]# ifconfig wlan0 up
# 省略部分输出
[ 1492.081350] DMAIdle, GloCfg0x40000050
[ 1492.085317] Driver auto reconnect to last OID_802_11_SSID setting - 11n-AP, len - 6
[ 1492.093366] CntlOidSsidProc():CNTL - 0 BSS of 0 BSS match the desire RTMPDrvOpen(2):Check if PDMA is idle!
[ 1492.101944] (6)SSID - 11n-AP
[ 1492.105507] CNTL - All roaming failed, restore to channel 1, Total BSS[00]
[ 1492.111625] DMAIdle, GloCfg0x40000050 2接着设置无线网卡的IP地址。 通过查看windows主机的无线网络信息可知其连接的无线路由器的地址为192.168.1.1。 SSID: XJH-ChinaNet-2.4G
协议: 802.11n
安全类型: WPA2-个人
网络频带: 2.4 GHz
网络通道: 2
IPv6 地址: 240e:3b6:30f4:ad80:912d:a070:e7d1:14ac
IPv6 DNS 服务器: fe80::1%17
IPv4 地址: 192.168.1.2 #笔记本的IP地址
IPv4 DNS 服务器: 192.168.1.1 #路由器的IP地址
制造商: Intel Corporation
描述: Intel(R) Dual Band Wireless-AC 8265
驱动程序版本: 20.70.4.2
物理地址(MAC): 88-B1-11-9A-37-5B 于是我们执行命令“ifconfig wlan0 192.168.1.211”将无线网卡的IP地址设置成和无线路由器IP地址同一网段的然后使用“ifconfig”命令查看wlan0是否启动。 [rootx210v3 xjh_usb-wifi]# ifconfig wlan0 192.168.1.211
[rootx210v3 xjh_usb-wifi]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:09:C0:FF:EC:48 inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0inet6 addr: fe80::209:c0ff:feff:ec48/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:9600 errors:0 dropped:0 overruns:0 frame:0TX packets:5247 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:14523684 (13.8 MiB) TX bytes:368318 (359.6 KiB)Interrupt:42 Base address:0x4300 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)wlan0 Link encap:Ethernet HWaddr 1C:BF:CE:2C:B2:5E inet addr:192.168.1.211 Bcast:192.168.1.255 Mask:255.255.255.0inet6 addr: fe80::1ebf:ceff:fe2c:b25e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:1078 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:312870 (305.5 KiB) TX bytes:0 (0.0 B)[rootx210v3 xjh_usb-wifi]# 3、使用wpa_supplicant工具将无线网卡接入网络 经过上面的操作无线网卡wlan0已经启动并且配置有IP地址就等待着接入无线路由器。此时我们可以使用 wpa_supplicant 工具将无线网卡wlan0接入网络。wpa_supplicant 工具主要用于管理无线网络它已经集成到busybox中因此可以直接使用。 [rootx210v3 xjh_usb-wifi]# find / -name wpa_supplicant
/usr/sbin/wpa_supplicant
[rootx210v3 xjh_usb-wifi]# 1在板载系统中创建/etc/Wireless/RT2870STA目录然后将虚拟机的x210_usb-wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/RT2870STA.dat文件拷贝到该目录。 2在板载系统中创建并编辑/etc/wpa_supplicant.conf文件注意删掉注释。 ctrl_interface/var/run/wpa_supplicantnetwork{
ssidXJH-ChinaNet-2.4G # 当前我房间的无线路由器的网络名字
scan_ssid1
key_mgmtWPA-EAP WPA-PSK IEEE8021X NONE # 加密方式
pairwiseTKIP CCMP
groupCCMP TKIP WEP104 WEP40
pskxie732787 # 路由器的密码
} 3使用命令“wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd ”将无线网卡接入连接无线网络。 [rootx210v3 xjh_usb-wifi]# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
#省略部分输出
EAPOL: SUPP_BE entering state IDLE
EAPOL authentication completed - resultSUCCESS
RTM_NEWLINK: operstate1 ifi_flags0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface wlan0 added
WEXT: if_removed already cleared - ignore event
SYNC - AP changed N OperaionMode to 0
EAPOL: startWhen -- 0
EAPOL: disable timer tick
MT7601AsicTemperatureCompensation::Change to TEMPERATURE_MODE_HIGH
SYNC - AP changed N OperaionMode to 3
SYNC - AP changed B/G protection to 0
SYNC - AP changed N OperaionMode to 0
SYNC - AP changed N OperaionMode to 1
SYNC - AP changed B/G protection to 1
#这是动态的输出需要按下回车继续下一步 4使用命令“wpa_cli -i wlan0 status”查看连接状态。 [rootx210v3 xjh_usb-wifi]# wpa_cli -i wlan0 status
RX ctrl_iface - hexdump_ascii(len6):53 54 41 54 55 53 STATUS
wlan0: Control interface command STATUS
bssid28:93:7d:25:a5:bd
ssidXJH-ChinaNet-2.4G
id0
modestation
pairwise_cipherCCMP
group_cipherTKIP
key_mgmtWPA2-PSK
wpa_stateCOMPLETED
ip_address192.168.1.211
address1c:bf:ce:2c:b2:5e
[rootx210v3 xjh_usb-wifi]# 4、ping通路由器与外网的测试 1注意先使用“ifconfig eth0 down”关掉eth0否则开发板默认使用eth0而非wlan0。 2经过上面操作之后开发板可以ping通路由器ping 192.168.1.1但是因为还没有设置网关所以不能ping通外部网络比如ping 8.8.8.8。我们可以通过在命令行输入下面命令来设置网关信息。 route add default gw 192.168.1.1 dev wlan0 3设置网关之后因为还没有设置DNS因此不能ping www.baidu.com等域名。我们可以在/etc/resolv.conf文件中配置DNS即创建此文件并添加“nameserver 192.168.1.1”。注意这里的IP是无线路由器的IP。 [rootx210v3 xjh_usb-wifi]# ping www.baidu.com
PING www.baidu.com (14.215.177.38): 56 data bytes
64 bytes from 14.215.177.38: seq0 ttl56 time19.485 ms
64 bytes from 14.215.177.38: seq1 ttl56 time7.584 ms
64 bytes from 14.215.177.38: seq2 ttl56 time7.942 ms
64 bytes from 14.215.177.38: seq3 ttl56 time8.450 ms--- www.baidu.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max 7.584/10.865/19.485 ms
[rootx210v3 xjh_usb-wifi]# 5、在interface文件中配置静态IP或动态IP可选操作 之前都是通过手动设置IP地址其实也可以修改板载系统的/etc/network/interfaces文件来配置静态或者动态IP地址。设置静态IP的修改如下其实就是替代手工配置时的ifconfig分配IP地址、route添加网关这两步。简单起见这里删除有线网卡的配置保留无线网卡的配置。 auto lo
iface lo inet loopback#auto eth0
#iface eth0 inet static
#address 192.168.1.11
#netmask 255.255.255.0
#gateway 192.168.1.1auto wlan0
iface wlan0 inet static
address 192.168.1.211
netmask 255.255.255.0
gateway 192.168.1.1 6、设置开发板开机自动连接路由器 这里是前面内容的总结可以忽略前面1~4的操作完成第5点后直接进行下面操作。开发板开机自动连接路由器这个功能可以通过修改板载系统的/etc/init.d/rcS文件来实现。 1rcS文件所在目录及内容如下可知它会遍历执行/etc/init.d目录下S??*的文件。 [rootx210v3 init.d]# pwd
/etc/init.d
[rootx210v3 init.d]# ls
S01logging* S20urandom* S50sshd* rcK*
S10mdev* S40network* S99qttest* rcS*
[rootx210v3 init.d]# #!/bin/sh# Start all init scripts in /etc/init.d
# executing them in numerical order.
# for i in /etc/init.d/S??* ;do # Ignore dangling symlinks (if any).[ ! -f $i ] continue case $i in *.sh) # Source shell script for speed.( trap - INT QUIT TSTP set start . $i ) ;; *) # No sh extension, so fork subprocess.$i start ;; esac
done 2于是在板载系统/etc/init.d/目录下创建S41WIFI文件并添加以下内容然后使用“chmod 777 S41WIFI”命令修改该文件权限。 insmod /usr/xjh_usb-wifi/mt7601Usta.ko
ifconfig wlan0 up
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
wpa_cli -i wlan0 statusifconfig wlan0 up 3在板载系统下执行“reboot”重启系统完全启动后使用“ifconfig”查看可见wlan0分配的IP地址和interfaces文件配置的一致而且可以ping通“ 8.8.8.8 ”但不能ping域名这是因为之前的DNS配置文件/etc/resolv.conf文件重启后会消失。 Welcome to Buildroot
x210v3 login: root
Password:
[rootx210v3 ~]# ifconfig
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)wlan0 Link encap:Ethernet HWaddr 1C:BF:CE:2C:B2:5E inet addr:192.168.1.211 Bcast:0.0.0.0 Mask:255.255.255.0inet6 addr: fe80::1ebf:ceff:fe2c:b25e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:892 errors:0 dropped:0 overruns:0 frame:0TX packets:32 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:304603 (297.4 KiB) TX bytes:2980 (2.9 KiB)[rootx210v3 ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq0 ttl116 time15.673 ms
64 bytes from 8.8.8.8: seq1 ttl116 time25.335 ms
64 bytes from 8.8.8.8: seq2 ttl116 time22.043 ms--- 8.8.8.8 ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max 15.673/21.017/25.335 ms
[rootx210v3 ~]# ping www.baidu.com
ping: bad address www.baidu.com
[rootx210v3 ~]# 四、在自己定制的rootfs中移植网卡 1、确认自制的rootfs正常工作 1在板载系统中删除上节的/etc/init.d/S41WIFI文件修改/etc/network/interfaces文件如下然后重启开发板。 auto lo
iface lo inet loopbackauto eth0
iface eth0 inet static
address 192.168.1.141
netmask 255.255.255.0
gateway 192.168.1.1 2在uboot控制台依次输入下面指令修改环境变量bootargs和bootcmd并保存。 setenv bootargs root/dev/nfs nfsroot192.168.1.141:/home/xjh/iot/embedded_basic/rootfs/rootfs_xjh ip192.168.1.88:192.168.1.141:192.168.1.1:255.255.255.0::eth0:off init/linuxrc consolettySAC2,115200
set bootcmd tftp 30008000 zImage;bootm 30008000
save 原来的环境变量bootargs和bootcmd的内容如下 setenv bootargs consolettySAC2,115200 root/dev/mmcblk0p2 rw init/linuxrc rootfstypeext3
setenv bootcmd movi read kernel 30008000; movi read rootfs 30B00000 300000; bootm 30008000 30B00000 busybox交叉编译 2启动后直接nfs方式挂载文件夹形式的rootfs测试ok后再做成镜像烧录 3挂载参数 2、确认需要的移植的工具集 1iwconfig工具集需要另外移植不是busybox中的 2dhcp工具集是busybox中集成的确认busybox的menuconfig中配置支持了这个 3wpa_supplicant工具集需要另外移植不是busybox中的 3、交叉编译iwconfig 1源码下载 2配置 3交叉编译 4部署安装 5测试 4、交叉编译wpa_supplicant 1下载wpa_supplicant源码并配置编译。参考http://blog.csdn.net/hktkfly6/article/details/48949863 2下载配套版本的openssl并配置编译。 3去掉配置NL相关的选项省去移植libnl。参考http://www.cnblogs.com/helloworldtoyou/p/6145995.htm 5、在nfs中测试wpa_supplicant使用 6、制作ext2镜像并刷机测试 制作ext2格式的根文件系统镜像_天糊土的博客-CSDN博客_ext2 文件系统制作
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/918311.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!