AP和stage模式差异
1.板子起来后,输入ifconfig -a查看eth0
2.关闭eth0:ifconfig eth0 down
3.wifi命令行联网
mkdir -p /var/run
wpa_supplicant -B -i wlan0 -c /misc/wifi/wpa_supplicant.conf
/ # cat /misc/wifi/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
ssid="JNKJ_PHONE"
psk="12345678"
}
network={
ssid="JNKJ1"
psk="Jnkj3608"
}
/ # wpa_supplicant -B -i wlan0 -c /misc/wifi/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
nl80211: kernel reports: Registration to specific type not supported
rfkill: Cannot get wiphy information
4.udhcpc获取IP
udhcpc -i wlan0 -s /etc/init.d/udhcpc.script
5./ # ping www.baidu.com
二 WAP模式
/customer # ./wifiMngTest
wap k2 12345678
wap
host
host
rfkill: Cannot open RFKILL control device
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
udhcpd (v1.20.2) started
Sending OFFER of 192.168.123.20
Sending ACK to 192.168.123.20
^C
/customer # ifconfig
wlan0 Link encap:Ethernet HWaddr 00:90:4C:2E:C3:05
inet addr:192.168.123.1 Bcast:192.168.123.255 Mask:255.255.255.0
二 切换stage模式
/customer # ./wifiMngTest
con
con
Received SIGTERM
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
nl80211: kernel reports: Registration to specific type not supported
rfkill: Cannot get wiphy information
udhcpc (v1.20.2) started
Setting IP address 0.0.0.0 on wlan0
Sending discover...
Sending discover...
Sending select for 192.168.110.185...
Lease of 192.168.110.185 obtained, lease time 1800
Setting IP address 192.168.110.185 on wlan0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.110.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.110.1
[C:\~]$
Connecting to COM3...
Connected.
/ #
/ #
/ #
/ #
/ #
/ # ls
bin customer home linuxrc proc sys var
bootconfig dev init misc root tmp vendor
config etc lib mnt sbin usr
/ # ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:30:1B:BA:02:DB
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:53
lo Link encap:Local Loopback
LOOPBACK MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 00:90:4C:2E:C3:05
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
/ # ifconfig eth0 down
/ # mkdir -p /var/run
/ # cat /misc/wifi/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
ssid="JNKJ_PHONE"
psk="12345678"
}
network={
ssid="JNKJ1"
psk="Jnkj3608"
}
/ # wpa_supplicant -B -i wlan0 -c /misc/wifi/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
nl80211: kernel reports: Registration to specific type not supported
rfkill: Cannot get wiphy information
/ # udhcpc -i wlan0 -s /etc/init.d/udhcpc.script
udhcpc (v1.20.2) started
Setting IP address 0.0.0.0 on wlan0
Sending discover...
Sending discover...
Sending select for 192.168.110.185...
Lease of 192.168.110.185 obtained, lease time 1800
Setting IP address 192.168.110.185 on wlan0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.110.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.110.1
/ # ping www.baidu.com
PING www.baidu.com (180.101.51.73): 56 data bytes
64 bytes from 180.101.51.73: seq=0 ttl=52 time=11.231 ms
64 bytes from 180.101.51.73: seq=1 ttl=52 time=12.053 ms
64 bytes from 180.101.51.73: seq=2 ttl=52 time=11.660 ms
64 bytes from 180.101.51.73: seq=3 ttl=52 time=12.004 ms
64 bytes from 180.101.51.73: seq=4 ttl=52 time=13.831 ms
64 bytes from 180.101.51.73: seq=5 ttl=52 time=12.644 ms
64 bytes from 180.101.51.73: seq=6 ttl=52 time=12.326 ms
64 bytes from 180.101.51.73: seq=7 ttl=52 time=28.080 ms
64 bytes from 180.101.51.73: seq=8 ttl=52 time=13.994 ms
^C
--- www.baidu.com ping statistics ---
9 packets transmitted, 9 packets received, 0% packet loss
round-trip min/avg/max = 11.231/14.202/28.080 ms
/ # cd customer/
/customer # ls
IMU media.db
jnkj my_files.db
log ov32b40_mipi.ko
lost+found prog_vif_sensor_demo-815
media prog_vif_sensor_demo_linear
/customer # tftp -gl wifiMngTest 192.168.1.111
^C
/customer # tftp -gl wifiMngTest 192.168.110.115
wifiMngTest 100% |*******************************| 51172 0:00:00 ETA
/customer # ls
IMU my_files.db
jnkj ov32b40_mipi.ko
log prog_vif_sensor_demo-815
lost+found prog_vif_sensor_demo_linear
media wifiMngTest
media.db
/customer # ./wifiMngTest
-/bin/sh: ./wifiMngTest: Permission denied
/customer # chmod 777 wifiMngTest
/customer # ls
IMU my_files.db
jnkj ov32b40_mipi.ko
log prog_vif_sensor_demo-815
lost+found prog_vif_sensor_demo_linear
media wifiMngTest
media.db
/customer # ./wifiMngTest
wap k2 12345678 ^H^H^H
wap
^[[A^H
unknow cmd
wap k2 12345678
wap
host
host
rfkill: Cannot open RFKILL control device
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
udhcpd (v1.20.2) started
Sending OFFER of 192.168.123.20
Sending ACK to 192.168.123.20
^C
/customer # ifconfig
wlan0 Link encap:Ethernet HWaddr 00:90:4C:2E:C3:05
inet addr:192.168.123.1 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:961 errors:0 dropped:67 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:243643 (237.9 KiB) TX bytes:9482 (9.2 KiB)
/customer #
/customer #
/customer #
/customer #
/customer #
/customer #
/customer # Sending ACK to 192.168.123.20
Sending ACK to 192.168.123.20
Sending ACK to 192.168.123.20
con
-/bin/sh: con: not found
/customer # ls
IMU my_files.db
jnkj ov32b40_mipi.ko
log prog_vif_sensor_demo-815
lost+found prog_vif_sensor_demo_linear
media wifiMngTest
media.db
/customer # ./wifiMngTest
con
con
Received SIGTERM
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
nl80211: kernel reports: Registration to specific type not supported
rfkill: Cannot get wiphy information
udhcpc (v1.20.2) started
Setting IP address 0.0.0.0 on wlan0
Sending discover...
Sending discover...
Sending select for 192.168.110.185...
Lease of 192.168.110.185 obtained, lease time 1800
Setting IP address 192.168.110.185 on wlan0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.110.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.110.1
拒绝访问。
Connection closed.
Disconnected from remote host(串口) at 17:21:25.