2. V853 supports WIFI and wired network card

100ASK-V853-PRO development board supports WIFI and wired network card

0. Preface

​ Through the previous chapter, we have successfully downloaded the Tina SDK package, completed compiling and programming the Tina Linux system, and then show how the 100ASK_V853-PRO development department can access the Internet through WIFI and wired network cards.

Allwinner Linux Tina-SDK development complete manual: https://tina.100ask.net/

100ASK_V853-PRO development board data collection (including 2000+ pages of development documents and Tina SDK package, etc.):

Link: https://pan.baidu.com/s/1TX742vfEde9bMLd9IrwwqA?pwd=sp6a Extraction code: sp6a

100ASK_V853-PRO development board data summary:

Link: 100ASK_100ASK-PRO Data Summary - Allwinner / V853-Pro - Embedded Development Q&A Community

100ASK_V853-PRO development board purchase link: 100ASK_V853-PRO development board

insert image description here

1. Use WIFI to realize Internet access

​ 100ASK_V853-PRO is equipped with Allwinner XR829 on the full-featured bottom board. The burned development board system has been adapted and can be used directly. Enter ifconfig on the development board to display the enabled network devices.

root@TinaLinux:/# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 84:B0:AC:67:95:EE
          UP 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)

You can see that wlan0 is enabled by default. If it is not enabled ifconfig -a, you can enter it to check whether there are wlan0 devices on all network interfaces. If wlan0 exists, you can enter ifconfig wlan0 upto enable wlan0.

root@TinaLinux:/# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 92:A8:E0:01:3D:F9
          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:59

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

p2p0      Link encap:Ethernet  HWaddr 84:B0:AC:67:95:EF
          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)

wlan0     Link encap:Ethernet  HWaddr 84:B0:AC:67:95:EE
          UP 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)

root@TinaLinux:/# ifconfig wlan0 up

After the enable is completed, because the system has built-in wifimanager-v2.0, you can quickly realize the network configuration, input wifi -h, and get parameter help

root@TinaLinux:/# wifi -h
=======================================================================
*************************  sta mode Options  **************************
=======================================================================
wifi -o sta
        : open sta mode
wifi -f
        : close sta mode
wifi -s
        : scan wifi
wifi -c ssid [passwd]
        : connect to an encrypted or non-encrypted ap
wifi -d
        : disconnect from ap
wifi -a [enable/disable]
        : Auto reconnect
wifi -l [all]
        : list connected or saved ap information
wifi -r [ssid/all]
        : remove a specified network or all networks
wifi -p [softap/ble/xconfig/soundwave]
        : softap/ble/xconfig/soundwave distribution network

=======================================================================
*************************  ap mode Options  ***************************
=======================================================================
wifi -o ap [ssid] [passwd]
        : open ap mode
        : if ssid and passwd is not set, start the default configuration: (allwinner-ap Aa123456)
        : if only set ssid, start the ap without passwd
wifi -l
        : list current ap mode information
wifi -f
        : close ap mode
=======================================================================
***********************  monitor mode Options  ************************
=======================================================================
wifi -o monitor
        : open monitor mode
wifi -f
        : close monitor mode
=======================================================================
***************************  other Options  ***************************
=======================================================================
wifi -D [error/warn/info/debug/dump/exce]
        : set debug level
wifi -g
        : get system mac addr
wifi -m [macaddr]
        : set system mac addr
wifi -h
        : print help
=======================================================================

Next, you can scan wifi. Note that you need to check whether the antenna is installed before scanning. The installation position is shown in the figure below.

insert image description here

After checking that the installation is complete, enter in the serial port terminal of the development boardwifi -s

root@TinaLinux:/# wifi -s
root@TinaLinux:/# 1970-01-01 04:00:42:003: WMG_DEBUG [wifi_daemon.c:cmd_handle_thread:702]:  get cmd: s
1970-01-01 04:00:42:003: WMG_DEBUG [wifi_daemon.c:cmd_handle_s:196]:  cmd handle s:
1970-01-01 04:00:42:004: WMG_DEBUG [src/wmg_sta.c:sta_mode_ctl:463]:  =====sta_mode_ctl  cmd: 8=====
1970-01-01 04:00:42:004: WMG_EXCESSIVE [src/os/linux/linux_wpa.c:command_to_supplicant:195]: do cmd SCAN
1970-01-01 04:00:42:004: WMG_EXCESSIVE [src/os/linux/linux_wpa.c:command_to_supplicant:203]: do cmd SCAN, reply: OK
...
1970-01-01 04:00:45:185: WMG_INFO [wifi_daemon.c:cmd_handle_s:220]:  bss[00]: bssid=94:d9:b3:b7:c9:0a  ssid=100ASK  channel=7(freq=2442)  rssi=-23  sec=WPA_PSK
1970-01-01 04:00:45:185: WMG_INFO [wifi_daemon.c:cmd_handle_s:220]:  bss[01]: bssid=d0:76:e7:f8:93:d8  ssid=TP-LINK_93D8  channel=6(freq=2437)  rssi=-70  sec=WPA_PSK
1970-01-01 04:00:45:185: WMG_INFO [wifi_daemon.c:cmd_handle_s:220]:  bss[02]: bssid=7a:60:5b:29:22:ab  ssid=  channel=2(freq=2417)  rssi=-70  sec=WPA2_PSK
1970-01-01 04:00:45:185: WMG_INFO [wifi_daemon.c:cmd_handle_s:220]:  bss[03]: bssid=7a:60:5b:59:22:ab  ssid=  channel=2(freq=2417)  rssi=-70  sec=WPA_PSK
1970-01-01 04:00:45:517: WMG_INFO [wifi_daemon.c:cmd_handle_s:222]:  ===Wi-Fi scan successful, total 21 ap(buff size: 60) time 3180.000000 ms===

After the scan is completed, it will print Wi-Fi scan successful and the time used. You can see that the ssid in the output information is the scanned WIFI name. Note that if the WIFI name contains Chinese characters, it may not be displayed.

Next, you can connect to WIFI to access the Internet, enter wifi -c ssid [passwd], where ssid is the WIFI name, passwd is the password

Assuming that the name of the WIFI I am connected to is 100ASK, and the password is 12345678, you need to enterwifi -c 100ASK 12345678

root@TinaLinux:/# wifi -c 100ASK 12345678
root@TinaLinux:/# 1970-01-01 04:16:49:482: WMG_DEBUG [wifi_daemon.c:cmd_handle_thread:702]:  get cmd: c 100ASK 12345678
1970-01-01 04:16:49:482: WMG_DEBUG [wifi_daemon.c:cmd_handle_c:232]:  cmd handle c: 100ASK 12345678
1970-01-01 04:16:49:482: WMG_INFO [wifi_daemon.c:cmd_handle_c:256]:  connect to sta(100ASK) with pask(12345678)
...
1970-01-01 04:16:51:670: WMG_EXCESSIVE [src/os/linux/event.c:evt_read:128]: Excessive: read event 14
1970-01-01 04:16:51:670: WMG_DUMP [src/os/linux/linux_wpa.c:linux_supplicant_connect_to_ap:1531]: receive wpas event 'CONNECTED'
1970-01-01 04:16:51:671: WMG_EXCESSIVE [src/os/linux/linux_wpa.c:command_to_supplicant:195]: do cmd SAVE_CONFIG
1970-01-01 04:16:51:691: WMG_WARNG [src/os/linux/linux_wpa.c:linux_supplicant_connect_to_ap:1559]:  failed to save config to wpa_supplicant.conf
1970-01-01 04:16:51:691: WMG_DEBUG [src/wifimg.c:__wifi_sta_connect:87]:  wifi station connect success
1970-01-01 04:16:51:691: WMG_INFO [wifi_daemon.c:cmd_handle_c:265]:  ===Wi-Fi connect successful,time 2210.000000 ms===
udhcpc: started, v1.33.2
udhcpc: sending discover
udhcpc: sending select for 192.168.0.163
udhcpc: lease of 192.168.0.163 obtained, lease time 122
1970-01-01 04:16:53:689: WMG_DEBUG [src/os/linux/udhcpc.c:start_udhcpc:83]:  vflag= 4
1970-01-01 04:16:53:689: WMG_INFO [src/os/linux/udhcpc.c:start_udhcpc:85]:  get ip addr 192.168.0.163

It can be seen that when we complete the input, the development board will automatically connect to WIFI and automatically obtain an IP address. At this time, we can execute ping www.100ask.net to test whether the wifi can ping the official website of Baiwen.com, press Crtl+C to end the test.

root@TinaLinux:/# ping www.100ask.net
PING www.100ask.net (118.25.119.100): 56 data bytes
64 bytes from 118.25.119.100: seq=0 ttl=53 time=34.627 ms
64 bytes from 118.25.119.100: seq=1 ttl=53 time=34.894 ms
64 bytes from 118.25.119.100: seq=2 ttl=53 time=34.477 ms
64 bytes from 118.25.119.100: seq=3 ttl=53 time=36.828 ms
^C
--- www.100ask.net ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 34.477/35.206/36.828 ms

2. Use a wired network card to achieve Internet access

​ For the wired network card, we have supported it in our patch file, but it is not enabled by default. We need to enable it manually. Enter the serial port terminal of the development board to view all supported network devices. We can see that after the ifconfig -ainput A device with an eth0 wired network card will appear.

root@TinaLinux:/# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 92:A8:E0:01:3D:F9
          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:59

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

p2p0      Link encap:Ethernet  HWaddr 84:B0:AC:67:95:EF
          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)

wlan0     Link encap:Ethernet  HWaddr 84:B0:AC:67:95:EE
          inet addr:192.168.0.163  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::86b0:acff:fe67:95ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2676 errors:0 dropped:14 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:440957 (430.6 KiB)  TX bytes:3968 (3.8 KiB)

​ Confirm that the device of the eth0 wired network card exists, and enter it at this time ifconfig eth0 upto enable the wired network card.

root@TinaLinux:/# ifconfig eth0 up
[ 3183.253385] libphy: gmac0: probed
[ 3183.302411] sunxi-gmac gmac0 eth0: eth0: Type(6) PHY ID 001cc816 at 0 IRQ poll (gmac0-0:00)
[ 3183.322880] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

​ At this time, lead out a network cable from the router and plug it into the wired network port of the development board.

insert image description here

When the network cable is inserted into the development board, the serial port terminal of the development board will output the following information, indicating that the wired network has been successfully connected

root@TinaLinux:/# [ 3318.532310] sunxi-gmac gmac0 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 3318.540797] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

At this time, you need to obtain the IP for the wired network port of the development board device, enterudhcpc eth0

root@TinaLinux:/# udhcpc eth0
udhcpc: started, v1.33.2
udhcpc: sending discover
udhcpc: sending select for 192.168.1.38
udhcpc: lease of 192.168.1.38 obtained, lease time 86400
udhcpc: ip addr add 192.168.1.38/255.255.255.0 broadcast + dev eth0
udhcpc: setting default routers: 192.168.1.1

At this point, we can execute ping www.100ask.net to test whether the wifi can ping the official website of Baiwen.com, and press Crtl+C to end the test.

root@TinaLinux:/# ping www.100ask.net
PING www.100ask.net (118.25.119.100): 56 data bytes
64 bytes from 118.25.119.100: seq=0 ttl=54 time=34.836 ms
64 bytes from 118.25.119.100: seq=1 ttl=54 time=32.367 ms
64 bytes from 118.25.119.100: seq=2 ttl=54 time=31.824 ms
^C
--- www.100ask.net ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 31.824/33.009/34.836 ms





Guess you like

Origin blog.csdn.net/thisway_diy/article/details/130600360
Recommended