Migration of wpa_supplicant Based on fs2410

Source: Internet
Author: User
Tags openssl library

The previous article has successfully transplanted sdio WiFi, but the AP is not encrypted. Currently, most wireless wi-fi networks are encrypted by WPA. Therefore, wpa_supplicant is required. The following is the migration process:

1. Download source code
Http://hostap.epitest.fi/wpa_supplicant/
Download wpa_supplicant-0.7.3.tar.gz (OpenSSL uses the 0.7.3 patch)
# Tar xvfz wpa_supplicant-0.7.3.tar.gz
Download www.openssl.org/source/openssl-0.9.8e.tar.gz
# Tar zxvf openssl-0.9.8e.tar.gz

Ii. Compile the OpenSSL library
Copy the patch from wpa_supplicant to OpenSSL.
# Cp wpa_supplicant-0.7.3/patches/openssl-0.9.8e-tls-extensions.patch openssl-0.9.8e/
# Cd openssl-0.9.8e
# Mkdir/usr/local/SSL
# Vim makefile
CC= Arm-Linux-GNU-gcc
Ar= Arm-Linux-GNU-ar $ (arflags) r
Ranlib= Arm-Linux-GNU-ranlib
Installtop=/Usr/local/SSL
Openssldir=/Usr/local/SSL
# Make
# Make install

Install the SSL library in the/usr/local/SSL directory
# Ls/usr/local/SSL
#Bin certs include lib man MISC OpenSSL. CNF private

Wpa_supplicant will be compiled later to depend on lib and include in OpenSSL.

3. Compile wpa_supplicant
Into the wpa_supplicant-0.7.3.tar.gz unzip the generated wpa_supplicant-0.7.3/wpa_supplicant directory:
# Cp defconfig. config
# Vim. config
Cc = arm-Linux-GNU-gcc-L/usr/local/SSL/lib/
Cflags + =-I/usr/local/SSL/include/
Libs + =-L/usr/local/SSL/lib/
# Make

The compiled wpa_supplicant source code shows two main executable tools: wpa_supplicant and wpa_cli. Wpa_supplicant is the core program, and its relationship with wpa_cli is the relationship between the service and the client: wpa_supplicant is run in the background, and wpa_cli is used to search, set, and connect to the network.

4. Configure wpa_supplicant
(1) first copy wpa_supplicant and wpa-psk-tkip.conf to the development board root file system, and renamedWpa-psk-tkip.confIsWpa_supplicant.conf

#CP wpa_supplicant/rootfs/filesystem/bin
#CP wpa_supplicant-0.7.3/wpa_supplicant/examples/wpa-psk-tkip.conf/rootfs/filesystem/etc/wpa_supplicant.conf

(2) modify the wpa_supplicant.conf configuration file
# Vim/rootfs/filesystem/etc/wpa_supplicant.conf

The modification content is as follows:

# WPA-PSK/TKIP

Ctrl_interface =/var/run/wpa_supplicant

Network = {
SSID ="Fs2410"// Enter the wireless network user name
Key_mgmt = WPA-PSK
PROTO = WPA
Pairwise = TKIP
Group = TKIP
PSK ="1234567890"// Enter the password
}

V. Test
(1) On the Development Board terminal:

#Mkdir-P/var/run/wpa_supplicant

(2) Compile the driver loading script
# Vim load. Sh (I put it in the root file system/sdio directory, the content is as follows :)

#! /Bin/sh
CD/sdio
Insmod libertas. Ko
Insmod libertas_sdio.ko helper_name =/lib/firmware/mrvl/helper_sd.bin fw_name =/lib/firmware/mrvl/sd8686.bin

And modify the load. Sh permission:Chmod 777 load. Sh

(3) load the driver
Enter the/sdio directory on the Development Board terminal and run./load. Sh to load the driver.
#CD/sdio
#./Load. Sh
After the driver is loaded, the following message is displayed: (if not, you can hot your sdio WiFi card again)
Libertas_sdio: libertas sdio driver
Libertas_sdio: Copyright Pierre Ossman
Libertas: 00: 0b: 6C: 89: 62: 4B, FW 9.70.3p23, Cap 0x00000303
Libertas: unidentified region code; using the default (USA)
Libertas: wlan0: Marvell WLAN 802.11 Adapter

Ifconfig-a to check whether the wlan0 node is created.
Assign IP Address:
#Ifconfig wlan0 192.168.1.5// You can also dynamically allocate dhclient wlan0, but you have to port DHCP.

(4) create a connection password (PSK password) and use the plaintext to convert the password.
# Cd/etc
#Wpa_passphrase fs2410 1234567890> wpa_supplicant.conf
This will be generated in the wpa_supplicant.conf file:
Network = {
SSID = "fs2410"
# PSK = "1234567890"
PSK = Signature
}

(5) then modify the wpa_supplicant.conf configuration file and change the line PSK = "1234567890" to the generated password in plaintext, that is:
PSK = Signature
Delete other generated redundant information. The wpa_supplicant.conf file is as follows:

# WPA-PSK/TKIP

Ctrl_interface =/var/run/wpa_supplicant

Network = {
SSID = "fs2410" // enter the User Name of the wireless network
Key_mgmt = WPA-PSK
PROTO = WPA
Pairwise = TKIP
Group = TKIP
PSK = Signature
}

(6) connect to the AP
Enter on the development board TerminalWpa_supplicantPress enter to display the help information. The last one is:
Example:
Wpa_supplicant-dwext-iwlan0-C/etc/wpa_supplicant.conf
Copy example usage and execute:
# Wpa_supplicant-dwext-iwlan0-C/etc/wpa_supplicant.conf&(You need to keep running in the background)
The printed information includes:
Trying to associate with 00: 26: F2: 0d: 5A: C4 (SSID = 'fs2410' freq = 2412 MHz)
Associated with 00: 23: 68: 28: 4E: A8
CTRL-EVENT-DISCONNECTED bssid = 00: 23: 68: 28: 4E: A8 reason = 0
Associated with 00: 26: F2: 0d: 5A: C4
WPA: key negotiation completed with 00: 26: F2: 0d: 5A: C4 [PTK = tkip gtk = TKIP]
CTRL-EVENT-CONNECTED-connection to 00: 26: F2: 0d: 5A: C4 completed (auth) [ID = 0 id_str =]
......
Ping the gateway again to check whether the connection is successful:
#Ping 192.168.1.1

3 packets transmitted, 3 packets received, 0% packet loss
Round-trip min/AVG/max = 17.627/20.023/24.631 MS
......

Wireless Network Card connection successful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.