Wi-Fi connection between Android phones and Development Boards

Source: Internet
Author: User

The Android mobile phone is used as the Wi-Fi Access Point (AP), PC, and arm-Linux as two terminals. The following describes how to connect the Development Board to an Android phone, but I have not implemented it yet.
I. Environment Introduction:
PC: Windows XP
Android phone: Android 2.2
Development Board: mini2440 Linux 2.6.32.2
WiFi USB wireless network adapter: RealTek 8188
Ii. Basic Concepts
I will not mention some very basic or very professional words. Here, I will only explain the two concepts that will be used in this article.
Essid
The identifier of the Service Set Identifier (SSID) Service set, which is usually broadcast by the AP. It is mainly used to distinguish different networks. It is simply considered as the name of the network; this general concept is followed by bssid and Essid. The former is said to be a small LAN consisting of a single AP and a site (terminal); the latter can have multiple APs, A large-scale network is divided by Essid. Therefore, when you find many available networks and connect to the network through your wifi wireless network card, you can identify them by the SSID.
In Linux wireless network cards, the mode is generally used, that is, to configure the working mode of your device: usually managed, ad-hoc/P2P, master. The managed mode is equivalent to using your device as the terminal node of the network. You can connect to an AP and access devices in the network. The Ad-Hoc/P2P mode can be called the point-to-point mode, that is, in the same SSID network, there is no direct communication between AP devices. You can refer to the Ubuntu website help documentation https://help.ubuntu.com/community/wifidocs/adhoc. In master mode, a wireless network card is used as an AP to allow connections from other devices. If it is a softap, it is equivalent to a wireless route. It may not be very accurate. There is such a concept.
Iii. Network Construction
It's a little big. Is the relevant driver installation, use. First, go to "Settings"> "wireless and network" on the Android mobile phone and find something similar to hotspot settings (there may be different calls for different mobile phones ), go to the portable Wi-Fi hotspot and set the network SSID. Here is the default "androidap ".

Install the rtl818su driver on the PC or download the corresponding software from the official website. Select "Base Station" from the "Mode" menu, find "SSID" androidap "from" available network ", and select Add to configuration file ,:

Automatically obtain the IP address after connection ,:

In Linux, just make the rtl8180 driver and load the insmod. To use it on the Development Board, you only need to configure the corresponding cross compiler to specify the source file path of the target board kernel. In the config of the Linux driver on the disk, modify the following:
Config_platform_i1__pc = N
Config_platform_arm_s3c = Y
Modify makefile as follows:

Ifeq ($ (config_platform_arm_s3c), Y)
Extra_cflags + =-dconfig_little_endian
Arch: = arm
Cross_compile: = arm-Linux-
Kver: = 2.6.32.2
Ksrc: =/opt/arm_linux/kernel/Linux-$ (kver)-mini2440
Endif

If the driver is downloaded from the official website, you only need to change the makefile:

Config_platform_i1__pc = N

Config_platform_android_x86 = N

Config_platform_arm_s3c = y

Config_platform_arm_pxa = N

Ifeq ($ (config_platform_arm_s3c), Y)

Extra_cflags + =-dconfig_little_endianarch: = arm

Cross_compile: = arm-Linux-

Kver: = 2.6.32.2

Ksrc: =/opt/arm_linux/kernel/Linux-$ (kver)-mini2440

Endif

Here, cross_compile: The cross compiler. ksrc is the kernel directory location of your board.
Copy the generated. Ko file to the board, load it through insmod, and insert the USB wireless network card. The following describes how to configure the management mode so that it can connect to the AP created by the Android mobile phone. The command is as follows:
Iwconfig wlan0 up
Ifconfig wlan0 192.168.43.25 (the default IP address on the mobile phone is 192.168.43.1, so it must be in an IP segment)
Iwconfig wlan0 mode managed Essid androidap (these commands are available in readme of the Linux driver of the NIC, and androidap is the name of the AP created by the mobile phone)
Other channels and rates are optional.
All right, ping it and try it. My example is as follows:
[Root @ friendlyarm/] # ifconfig wlan0 192.168.43.25
[Root @ friendlyarm/] # Ping 192.168.43.1
Ping 192.168.43.1 (192.168.43.1): 56 data bytes
Fwdbg: issue action: 00000003,000 00000, 00000000

Fwdbg: addba RSP: 00000001

64 bytes from 192.168.43.1: seq = 0 TTL = 64 time = 15.797 MS
64 bytes from 192.168.43.1: seq = 1 TTL = 64 time = 30.911 MS
64 bytes from 192.168.43.1: seq = 2 TTL = 64 time = 25.923 MS
^ C
--- 192.168.43.1 Ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
Round-trip min/AVG/max = 15.797/24.210/30.911 MS
[Root @ friendlyarm/] # Ping 192.168.43.23
Ping 192.168.43.23 (192.168.43.23): 56 data bytes
64 bytes from 192.168.43.23: seq = 0 TTL = 64 time = 84.997 MS
64 bytes from 192.168.43.23: seq = 1 TTL = 64 time = 33.968 MS
64 bytes from 192.168.43.23: seq = 2 TTL = 64 time = 29.037 MS
^ C
--- 192.168.43.23 Ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
Round-trip min/AVG/max = 29.037/49.334/84.997 MS
Iii. Problems
At first, I wanted to use the Development Board as an AP, and the mobile phone and PC could be connected directly. However, the purchased RealTek 8188 series USB Wireless WiFi Nic does not support the soft AP function in Linux, then I want to connect the mobile phone and the Development Board through the ad-hoc mode. However, Android phones do not support the ad-hoc mode by default. to modify the mode, I have to get the root permission of the mobile phone, modify the wifi configuration file, but my mobile phone is not a common Google G series, and I did not find the tiwlan mentioned on the Internet. INI, let alone modify it. The result shows that the wpa_supplicant configuration seems to be supported, but after several attempts, the root permission is not obtained, and the modification is not successful. Finally, we found the hostapd, which can switch the wireless network adapter to the master mode and simulate the AP (which can be considered as a router) function, that is, the soft AP (soft
AP ). It looks very good. The results include SSL and libnl porting boards. After testing, I failed to change to AP mode and quit. I checked the supported driver and didn't have my Nic. However, since the USB Nic can implement the soft AP function in windows, the hardware is correct, however, this function is not available in Linux because of the existence of other products. Therefore, you can modify the driver support based on hostapd to implement the AP function on the board, if you can do it later, make up it again!
If you want to communicate with others, please kindly advise. My mailbox w.7849516230@163.com

These two articles may help you:
Build Wireless WiFi hotspot/accesspoint (AP) with Ubuntu: http://phoeagon.byethost15.com/2011/08/20/%E7%94%A8ubuntu%E6%90%AD%E5%BB%BA%E6%97%A0%E7%BA%BFwifi-hotspot%E7%83%AD%E7%82%B9accesspointap/
Linux WiFi shared Internet script, similar to win 7 connectify tool: http://blog.csdn.net/feifei454498130/article/details/6642140

Related Article

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.