Based on Chi ap6210WiFi module a33-vstar development board transplantation

Documentation: hostapd + dnsmasq + a33 + ap6210 create soft AP ....
link: http: //note.youdao.com/noteshare id = b8546c1b34eecc5166704a012b1d09a2 & sub = E028A08CD2224F0492D4804AFFD6A364?

 

First, the preparations
1, create a new folder WiFi_AP
2, Download OpenSSL Download https://www.openssl.org/source/old/, here I downloaded version is openssl-1.0.2l.tar.gz Download https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz, download the file to copy to WiFi_AP, and extract
3, download libnl, Download http: // www.infradead.org/~tgr/libnl/, here I downloaded version is libnl-1.1.4.tar.gz Download http://www.infradead.org/~tgr/libnl/files/libnl- 1.1.4.tar.gz downloaded file to copy to WiFi_AP, and extract
4, enter WiFi_AP directory, execute the command git clone git: //w1.fi/srv/git/hostap.git download the latest hostapd
online clone version may be relatively high, and sometimes there will be some problems, so manually download hostap1.0, compiled by.
5, download dnsmasq, http: //www.thekelleys.org.uk/dnsmasq/dnsmasq-2.75.tar.gz, download the file to copy to WiFi_AP, and extract
6, preparatory work is now complete, took on more than four kits can be configured and cross-compiled to run on the development board
two, compile OpenSSL
1, enter openssl directory: cd WiFi_AP / openssl-1.0.2l
2、配置openssl:./config no-asm shared --prefix=$(pwd)/__install

no-asm: assembly code is not used in the code compilation process to accelerate cross-compilation, because its arm assembly code format is not supported.
shared: generating a dynamic link library.
--prefix: path to the build directory after a specified make install, this does not modify the default is OPENSSLDIR directory (/ usr / local / ssl) .
3. Modify the Makefile:
(. 1) modified compiler tool CC = / usr / local / gcc -arm / gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux / bin / arm-linux-gnueabi-gcc cross compiler tool chain path
(2) deleting the CFLAG = -m64
(. 3) the AR = ar $ (ARFLAGS) r to AR = /usr/local/gcc-arm/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux/bin / Linux-ARM-Ar-gnueabi $ (ARFLAGS) R & lt
(. 4) the rANLIB = / usr / bin / ranlib to rANLIB = /usr/local/gcc-arm/gcc-linaro-arm-linux-gnueabi-2012.03- 20120326_linux / bin / gnueabi-ARM-Linux-ranlib
(. 5) to the nM = nm nM = /usr/local/gcc-arm/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux/bin/arm-linux nm--gnueabi
(. 6) make command
execution make install command (. 7) make command is finished
Third, the compiler libnl
. 1, into the directory libnl: WiFi_AP / CD-1.1.4 libnl
2, disposed libnl: ./ Configure --prefix = $ (pwd) / __ the install-Shared --enable-static --enable
./configure the CC = / home / wien / work / GCC_ARM / gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi / bin / arm-linux-gnueabi-gcc --prefix = $ (pwd) / __ install --enable-shared the CC-static --host = --enable = / Home / Wien / Work / GCC_ARM / Linaro-GCC-6.1.1-2016.08-Linux-x86_64_arm-gnueabi / bin / Linux-ARM-gnueabi
. 3, Run: make CC = / usr / local / gcc- arm / gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux / bin / arm-linux-gnueabi-gcc cross-compile
4, Run: make CC = / usr / local / gcc -arm / gcc-linaro-arm- linux-gnueabi-2012.03-20120326_linux / bin / arm-linux-gnueabi-gcc install install
four cross compiler hostapd as wireless LAN router, the working mode of the AP
1, enter hostapd directory: cd WiFi_AP / hostap / hostapd
2, with default configuration, Run: CP defconfig .config
. 3, Y = enabled CONFIG_DRIVER_NL80211
. 4, modify the Makefile,
(. 1) will
IFNDEF the CC
the CC GCC =
endif
to
IFNDEF the CC
the CC = / usr / local / ARM-GCC / GCC -ARM-Linux--linaro gnueabi-2012.03-20120326_linux / bin / Linux-ARM-GCC-gnueabi
endif
(2)
at the start adding Makefile
CFLAGS + = -I ../../ libnl-1.1.4 / __ install / include /
the CFLAGS + = -I ../../ OpenSSL-1.0.2l / __ the install / the include /
LIBS + = -L ../../ libnl-1.1.4 / __ the install / lib /
LIBS = -L + .. /../openssl-1.0.2l/__install/lib/
. 5, the make command: make CC = / usr / local / gcc-arm / gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux / bin / arm- linux-gnueabi-gcc

The method can be modified to compile wpa_supplicant 0.7.3 same wireless LAN connection to other devices, operating in STA mode
if you only want to work with the WiFi module AP mode, i.e. hot mode, without compilation.
V. cross compiler dnsmasq
. 1, enters dnsmasq directory: CD WiFi_AP / dnsmasq-2.75
2, modify Makefile:
(. 1) the first row was added CC = / usr / local / gcc -arm / gcc-linaro-arm-linux-gnueabi in Makefile -2012.03-20120326_linux / bin / gnueabi-ARM-Linux-GCC
(2) set the installation directory = /home/wien/work/Vstar/Wifi/dnsmasq-2.75/__install the PREFIX
. 3, running make
. 4, after completion of the translation, do make install install
six point all tools are all compiled, the next leg compiled executable file and obtain a copy of the relevant configuration directory corresponds to the development board

// need to copy relevant documents produced after the successful compilation to the root file system, and then packaged burning
mkdir -p / System / Vendor / modules
cp bcmdhd.ko / System / Vendor / modules
cp dnsmasq.conf hostapd.conf hostapd.accept hostapd.deny / etc
CP hostapd hostapd_cli dnsmasq / sbin
CP /dragonboard/bin/fw_bcm40181a2.bin / System / Vendor / modules /
CP /dragonboard/bin/nvram_ap6210.txt / System / Vendor / modules /
CP / dragonboard / bin / config .txt / System / Vendor / modules /
cp wifisetap.sh /
mkdir / var / lib / misc
cp dnsmasq.leases (you can create an empty file) / var / lib / misc
seven wpa_supplicant when compiled, will produce wpa_supplicant , wpa_cli, wpa_passphrase three documents, which are wpa_supplicant and wpa_cli server and client relationships, wpa_supplicant running in the background, using wpa_cli to search, settings, and connect to the network.
Wpa_supplicant effect:
1, reads the profile
2, the initial configuration parameters, the driving function
3, so that all current scan driving BSSID
. 4, to check whether the scan parameter settings and the user wants No.
5, If they match, the authentication operation permissions inform the driver
6, connected to the AP
wpa_cli primarily intended for configuring WiFi.

Command:
1. Power Load bcmdhd.ko WiFi module that is loaded
2. ifconfig wlan0 up open WiFi,
3. iwlist wlan0 Scanning | grep ESSID scanning near hot, hot parameter is used to display only the name

 

4. wpa_supplicant -B -c / etc / wpa_supplicant.conf -iwlan0 read using wpa_supplicant * .conf good hot spot information is provided beforehand, and the connection.

5. udhcpc -b -i wlan0 automatically assigned IP mode WiFi module to the STA, or can not ping Baidu.

 

6. ping www.baidu.com

Currently only wpa_supplicant write their own .conf configuration file where a pre-written death WiFi name and password, too limitations, wpa_cli not use tools, in addition to other WiFi_tool more powerful, such as learning to use the follow-up.
Commands:
IW tools: iwconfig is replacement

Using (1) can be used to open, WEP two kinds of "authentication / encryption" pattern

// WIFI card lists the performance of
iw list

// start wifi module
ifconfig wlan0 up

// Scan the AP WIFI
IW dev wlan0 Scan

// Connect to WIFI AP: xxx (open pattern) (no password, open wifi connection)
IW wlan0 Connect XXX

// Connect to WIFI AP: the back (WEP mode) xxx xxxxx indicates password
IW wlan0 Connect XXX Keys D: 0: xxxxxx
D: default, 0: 0 passwords

Manually configure wifi hotspot ip
ifconfig wlan0 192.168.1.22
the ping about Baidu, see if you can communicate with the network (premise has been set up to support the external network)
the ping www.baidu.com

Hot disconnect connections:
IW wlan0 the disconnect


killall hostapd
killall dnsmasq
rmmod /system/vendor/modules/bcmdhd.ko
insmod /system/vendor/modules/bcmdhd.ko op_mode=2
ifconfig wlan0 down
ifconfig wlan0 up
hostapd /etc/hostapd.conf -B
ifconfig wlan0 192.168.1.1
dnsmasq
iwlist wlan0 scanning

After successful compilation should look library
hostapd shared library

ld-2.11.1.so* libgcc_s.so.1* librt.so.1@
ld-linux.so.3@ libm-2.11.1.so*
libc-2.11.1.so* libm.so.6@
libc.so.6@ libpthread-2.11.1.so*
libdl-2.11.1.so* libpthread.so.0@
libdl.so.2@ librt-2.11.1.so*

dnsmasq 共享库
ld-2.11.1.so* libc.so.6@ libnss_files.so.2*
ld-linux.so.3@ libgcc_s.so.1*
libc-2.11.1.so* libnss_files-2.11.1.so*

 

Guess you like

Origin www.cnblogs.com/fanjuntao/p/11428807.html