您的位置:首页 > 编程语言 > Go语言

Snapdragon Flight WIFI模式

2016-08-21 20:29 806 查看
Snapdragon Flight 有两种wifi模式

Wi-Fi

The system can be configured as an Access Point (AP) or Station (STA).

1.Station 模式

2.AP模式

AP模式下我的模块发出的wifi的ssid(热点名称)为Atlanticus_41668 密码:password

3.4.3.1 AP mode

The software AP (SoftAP) mode is facilitated with the host access point daemon (hostapd). Hostapd is a user space software access point capable of turning normal network interface cards into access points and authentication servers.

Enable AP mode

To configure the system for AP mode:

1. Run the following on the command line (via serial interface):

/usr/local/qr-linux/wificonfig.sh -s softap

2. Reboot the system.

Configure AP Mode

By default, the AP mode is configured for 802.11n, WPA2 authentication, and 2.4 GHz. The SSID is autogenerated with the installation of the platform image and the passphrase is set to password.

The hostapd configuration file is located at /etc/hostapd.conf on the target.

interface=wlan0

driver=nl80211

ieee80211d=1

ieee80211n=1

#

#

# Uncomment *one* of the following:

#

# 2.4Ghz setup

hw_mode=g

channel=2 # some channel in 2.4Ghz band

#

# or

#

# 5Ghz setup

#hw_mode=a

#channel=40 # some channel in 5Ghz band

#

#

ssid=Atlanticus_1952

macaddr_acl=0

ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=password

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP CCMP

rsn_pairwise=CCMP

The file can be modified to suit the desired configuration. After changing the configuration, reboot the system for the changes to take effect.

See the following websites for information on common configurations of hostapd:
https://wiki.gentoo.org/wiki/Hostapd#Sample_configurations http://linuxwireless.org/en/users/Documentation/hostapd/#Common_Options
Once the system is booted, the wlan0 IP address is listed as 192.168.1.1, which identifies the devices as the gateway.

> ifconfig wlan0

wlan0 Link encap:Ethernet HWaddr 00:03:7f:20:64:06

inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST MULTICAST MTU:1500 Metric:1

RX packets:9 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:1128 (1.1 KB) TX bytes:155 (155.0 B)

Set up the corresponding station client

From a client device, scan for the AP SSID and provide the correct authentication to correlate with the configuration of the AP. This then connects and obtains an IP address.

3.4.3.2 Station mode

Enable station mode

To configure the system for STA mode:

1. Run the following on the command line (via serial interface):

/usr/local/qr-linux/wificonfig.sh -s station

2. Reboot the system.

Configure station mode

To change the SSID or AP configuration:

1. Edit the supplicant configuration from the command line (via the serial interface).

For documentation details on the supplicant, see http://w1.fi/wpa_supplicant/.
2. Edit /etc/wpa_supplicant/wpa_supplicant.conf to configure the SSID and security options based on the corresponding AP to which the client is to connect.

3. For secure WPA2 personal configuration, specify the SSID and passkey in the following configuration. The SSIDName is the SSID to be used and XXXXXX is the pass-phrase of the AP.

network={

ssid="SSIDName"

proto=RSN

key_mgmt=WPA-PSK

pairwise=CCMP TKIP

group=CCMP TKIP

psk="XXXXXX"

}

4. For a non-secure AP, specify the SSID in the following configuration block. The SSIDName is the SSID of the AP.

network={

ssid="SSIDName"

proto=RSN

key_mgmt=NONE

pairwise=CCMP TKIP

group=CCMP TKIP

}

NOTE: Due to a known limitation, an adjustment to the configuration requires the system to be rebooted to take effect.

Reboot the system when making a configuration change:

1. Launch the utility app from the command line:

> wpa_cli (/sbin/wpa_cli)

2. Make the modified wpa_supplicant file active by typing:

> reconfigure

3. Click OK.

4. To list available networks:

list_networks

5. To select a network:

select_network (index no)

6. Quit

>quit

If necessary, run additional commands to enable or disable Wi-Fi and to obtain the status and IP address of the Wi-Fi connection.

■ To enable Wi-Fi:

> ifup wlan0

■ To disable Wi-Fi

> ifdown wlan0

■ To check Wi-Fi status

> ifconfig wlan0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: