Wireless Network Test of OKMX6ULL-C SBC
FETMX6ULL-C system on module(SoM) is based on NXP low power featuring processor i.MX6ULL, Cortex-A7@800MHz. Native support: 8 serial ports, 2 Ethernet ports, 2 CAN controller, 2 USB 2.0, LCD, etc. Ultra-Small size design, only 40*29mm, Suitable for application scenarios with a limited volume.
To facilitate user to test the performance and functions of FETMX6ULL-C SoM, Forlinx provides a development board, OKMX6ULL-C SBC. The function interfaces commonly used in the product development process are drawn out, such as 2-ch Ethernet, 2-ch USB, 2-ch CAN, 4-ch UART, 2-ch SPI and 2-ch IIC. Also reserved LCD interface for display and slots for 4G module and WiFi module.
This article introduces the interface function and test method of Forlinx iMX6ULL development board(OKMX6ULL-C SBC), helps user quickly familiar with it. Describes the test method of WiFi, and how to troubleshoot some problems during use. During the test, some commands were annotated to facilitate users' understanding.
First, WiFi Test of Forlinx iMX6ULL developemnt board (OKMX6ULL-C SBC)
WiFi Support
Module | Support |
RTL8188EUS | WiFi |
RTL8723BU | WiFi |
RTL8723DU | WiFi |
1. USB WiFi RTL8188eus
Note: USB WiFi wireless LAN card is an optional module(For optional module, you can visit the module part of Forlinx official web)
The following test is in STA mode, connecting WiFi module to a wireless network :
Step 1: Power on iMX6ULL development board and start Linux system.
Step 2: Connect USB WiFi to USB Host interface of Forlinx iMX6ULL development board
Step 3: Enter the corresponding parameters as the following format:
-i : WiFi model;
-s: name of WiFi hotspot;
-p: password. If no password, enter -p NONE;
The router uses wpa encryption. For specific operation instructions,please check WiFi.sh.
Connect and input as follows:
root@fl-imx6ull:~# fltest_cmd_WiFi.sh -i 8188 -s forlinx -p xxxx
The output information is as follows:
wifi 8188
ssid forlinx
pasw xxxx
usbcore: deregistering interface driver rtl8723bu
RTL871X: module exit start
usbcore: deregistering interface driver rtl8188eu
RTL871X: rtw_ndev_uninit(wlan1)
usb 1-1.3: reset high-speed USB device number 7 using ci_hdrc
RTL871X: module exit success
RTL871X: module init start
RTL871X: rtl8188eu v4.3.0.9_15178.20150907
RTL871X: build time: Mar 25 2020 02:23:46
bFWReady == _FALSE call reset 8051...
RTL871X: rtw_ndev_init(wlan0)
usbcore: registered new interface driver rtl8188eu
RTL871X: module init ret=0
==> rtl8188e_iol_efuse_patch
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
ps: invalid option -- 'f'
BusyBox v1.24.1 (2019-04-27 02:24:01 CST) multi-call binary.
Usage: ps
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL controRTL871X: set bssid:00:00:00:00:00:00
l device
RTL871X: set ssid [g▒isQ▒J▒)ͺ▒▒▒▒F|▒T▒▒vZ.c3▒ɚ���<▒▒▒▒] fw_state=0x00000008
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCGIWSCAN]: Resource temporarily unavailable
ioctl[SIOCGIWSCAN]: Resource temporarily unavailable
RTL871X: indicate disassoc
wlan0: Trying to associate with 04:d7:a5:84:fa:40 (SSID='forlinx' freq=2437 MHz)
RTL871X: set ssid [forlinx] fw_state=0x00000008
RTL871X: set bssid:04:d7:a5:84:fa:40
RTL871X: start auth
RTL871X: auth success, start assoc
RTL871X: assoc success
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
RTL871X: recv eapol packet
wlan0: Associated with 04:d7:a5:84:fa:40
RTL871X: send eapol packet
RsvdPageNum: 8
udhcpc (v1.24.1) started
RTL871X: recv eapol packet
RTL871X: send eapol packet
RTL871X: recv eapol packet
RTL871X: send eapol packet
RTL871X: set pairwise key camid:4, addr:04:d7:a5:84:fa:40, kid:0, type:AES
wlan0: WPA: Key negotiation completed with 04:d7:a5:84:fa:40 [PTKRTL871X: set group key camid:5, addr:04:d7:a5:84:fa:40, kid:2, type:AES
=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:84:fa:40 completed [id=0 id_str=]
Sending discover...
Sending select for 192.168.4.129...
Lease of 192.168.4.129 obtained, lease time 36000
/etc/udhcpc.d/50default: Adding DNS 222.222.202.202
/etc/udhcpc.d/50default: Adding DNS 222.222.222.222
Finshed!
After the script running finished, if it automatically assigns IP and adds DNS, then WiFi connection is successful.
Step 5: Ping ip or domain name, the command is as follows.
root@fl-imx6ull:~# ping -c 4 www.baidu.com
PING www.baidu.com (220.181.38.149): 56 data bytes
64 bytes from 220.181.38.149: seq=0 ttl=51 time=26.648 ms
64 bytes from 220.181.38.149: seq=1 ttl=51 time=13.529 ms
64 bytes from 220.181.38.149: seq=2 ttl=51 time=15.656 ms
64 bytes from 220.181.38.149: seq=3 ttl=51 time=26.249 ms
--- www.baidu.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 13.529/20.520/26.648 ms
Step 6: Uninstall the modules that have been added to the kernel.
root@fl-imx6ull:~# rmmod 8188eu
The output information is as follows:
RTL871X: module exit start
usbcore: deregistering interface driver rtl8188eu
RTL871X: indicate disassoc
RTL871X: rtw_cmd_thread: DriverStopped(1) SurpriseRemoved(0) break at line 478
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:84:fa:40 reason=3 locally_generated=1
RTL871X: rtw_ndev_uninit(wlan0)
RTL871X: rtw_dev_unload: driver not in IPS
usb 1-1.3: reset high-speed USB device number 7 using ci_hdrc
RTL871X: module exit success
2. Carrier Board WIFI
Note:
l WiFi frequency: 2.4G
l Compatible with two WiFi drivers: 8723bu, 8723du
l The router uses wpa encryption by default.
If the development board has an onboard WiFi wireless LAN card, it will soldered on the evaluation board as shown in the below picture (the picture is 8723du):
Step 1: Check whether the module has been soldered on iMX6ULL development board, and the correct soldering is as shown in above picture. And connect the antenna.
Step 2: Power on iMX6ULL development board, start Linux system, and use lsmod to check the module loading status first:
root@fl-imx6ull:~# lsmod
Module Size Used by
mx6s_capture 14876 0
8723 du 1313893 0 //The default wifi is automatically loaded, and 8723du has been loaded successfully
ov9650_camera 12446 0
Note: If 8723 b u is soldered on Forlinx iMX6ULL development board, using lsmod will display 8723 b u
The following takes 8723du as an example to test:
Step 3: Test
Ø STA mode
In this mode, connect to the wireless network as a station. The operation method is as follows:
-i: WiFi model; -s: name of WiFi hotspot; -p: password, if no password, enter -p NONE; The router uses wpa encryption. For specific operation instructions,please check WiFi.sh.
root@fl-imx6ull:~# fltest_cmd_wifi.sh -i 8723du -s forlinx -p xxx //Execute the test script
The output information is as follows:
wifi 8723du
ssid forlinx
pasw xxx
usbcore: deregistering interface driver rtl8723du
usbcore: registered new interface driver rtl8723du
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
udhcpc (v1.24.1) started
Sending discover...
wlan0: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlan0: Trying to associate with 04:d7:a5:f9:26:1d (SSID='forlinx' freq=2427 MHz)
wlan0: Associated with 04:d7:a5:f9:26:1d
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
wlan0: WPA: Key negotiation completed with 04:d7:a5:f9:26:1d [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:f9:26:1d completed [id=0 id_str=]
nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
Sending discover...
Sending select for 192.168.5.186...
Lease of 192.168.5.186 obtained, lease time 1800
/etc/udhcpc.d/50default: Adding DNS 222.222.202.202
/etc/udhcpc.d/50default: Adding DNS 222.222.222.222
WLAN Finshed!
After the script running finished, if it automatically assigns IP and adds DNS, then WiFi connection is successful.
Ping ip or domain name, the command is as follows
root@fl-imx6ull:~# ping -c 5 www.baidu.com
The output information is as follows:
PING 192.168.4.1 (192.168.4.1): 56 data bytes
64 bytes from 192.168.4.1: seq=0 ttl=128 time=39.783 ms
64 bytes from 192.168.4.1: seq=1 ttl=128 time=81.529 ms
64 bytes from 192.168.4.1: seq=2 ttl=128 time=15.236 ms
64 bytes from 192.168.4.1: seq=3 ttl=128 time=12.076 ms
64 bytes from 192.168.4.1: seq=4 ttl=128 time=16.300 ms
--- 192.168.4.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 12.076/32.984/81.529 ms
WiFi signal
Check WiFi signal as follows:
root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $3}' //Get signal strength
78.
root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $4}' //Get signal quality, dBm
-68.
root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $5}' //The background noise of the network port, dBm
-256.
AP mode
Note:
l This module supports AP mode, and the theoretical maximum number of connected users is 8.
l This example is the description of Ethernet eth0 connecting to the router. After the configuration of Ethernet, it need to test whether eth0 can connect to Internet. If it can connect to Internet (please refer to "Wired Network Card" chapter for the method), please continue to follow the operation steps. If not, please check whether the connection of Ethernet or router is normal.
In AP mode, devices such as mobile phones can directly connect to the module.
Set Ethernet IP, configure network firewall:
root@fl-imx6ull:~# udhcpc -i eth0 //Automatically assign IP, if eth0 network has been tested to be normal, you can skip this step
root@fl-imx6ull:~# echo 1 > /proc/sys/net/ipv4/ip_forward //Open IP forwarding
root@fl-imx6ull:~# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE //Set forwarding rules
Set WiFi mode and IP
Make sure module 8723bu is loaded.
root@fl-imx6ull:~# ifconfig wlan0 up //Turn on WiFi
root@fl-imx6ull:~# ifconfig wlan0 192.168.0.10 netmask 255.255.255.0 //Set IP and subnet mask
root@fl-imx6ull:~# ifconfig wlan0 promisc //Set wlan0 to promiscuous mode
enable AP
root@fl-imx6ull:~# udhcpd /etc/udhcpd/udhcpd.conf & //Configuration information such as WiFi address and gateway
root@fl-imx6ull:~# hostapd -d /etc/hostapd/hostapd.conf & //Encryption method, username, password and other settings
In hostapd.conf file: ssid is username, / is password
Mobile terminals such as mobile phones can connect to the AP hotspot of development board through WiFi. Forlinx iMX6ULL development board uses the following username and password by default:
Hotspot name: forlinxtest Password: 1234567890
Step 4: Uninstall the modules that have been added to the kernel:
root@fl-imx6ull:~# rmmod 8723du
usbcore: deregistering interface driver rtl8723du
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:f9:26:1d reason=0
FETMX6ULL-C SoM is the third SoM launched by Forlinx based on NXP i.MX6U series processors. With Forlinx matured technical solutions, it bring a whole new experience of stable and reliable. Compact size by 40*29mm while the package is 2mm height board to board connector. It combines small size and easy disassembly. Welcome send an inquiry for details.