NXP i.MXRT10XX: Connecting to the Internet over USB WiFi
This application note shows how to implement a USB WiFi secure client with the i.MX RT10XX running Linux. The functionality described below is available from the rootfs.uImage project provided by Emcraft for NXP i.MX RT1050/RT1060 EVKB board.
Emcraft tested the functionality documented below using the ComFast CF-WU815N adapter (based on the RT5370 chipset). If you are using some different USB WiFi dongle, then it may require enabling/porting/implementing the appropriate device drivers in the Linux kernel.
Disconnect Ethernet cable, and disable the eth0
interface:
/ # ifconfig eth0 down
Plug-in the USB WiFi device to the USB OTG port (USB1 J9
interface connector on the NXP i.MX RT1050 EVK board or USB1 J47
interface connector on the NXP i.MX RT1060 EVK board). The system will print the following to the console:
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usb 2-1: new high-speed USB device number 2 using ci_hdrc
usb 2-1: reset high-speed USB device number 2 using ci_hdrc
ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3070, rev 0201 detected
ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0005 detected
Start wpa_supplicant
to be able to connect to WiFi access points:
/ # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29
Scan for available WiFi access points:
Connect to the access point of your choice. Let's use MGTS_GPON_2263 in our example. Create a new wireless network:
The number reported in the command above (1) is the identifier that must be used in the commands below. Configure the wireless network specifying the access point name and the password:
Start the wireless network, obtain its status:
Configure the wireless networking using the access point DHCP server:
Validate the Internet connectivity:
The access point parameters are specified in the /etc/wpa_supplicant.conf
file. In this case the connection will be established automatically, and the procedure will look like this:
You may edit the wpa_supplicant.conf file right in the device console. Please note however that this file is located in the initramfs
, so to preserve changes over reboots you should:
Update the content of
projects/rootfs/etc/wpa_supplicant.conf
;Rebuild the project as described in Building Linux ;
Install the new
rootfs.uImage
file as described in Building and Installing Linux uImage on the NXP i.MX RT10XX EVK Board .