wpa_supplicant 是一款用于连接 AP 热点的应用工程

wpa_supplicant 使用手册

本编用于介绍 SylixOS 下的 wpa_supplicant 使用方法。

概述

wpa_supplicant 是一款用于连接 AP 热点的应用工程,借助这个程序,可以使 SylixOS 下的无线网卡作为一个 STA 设备去连接想要连接的热点。

使用方法

本篇以连接一个 AP 热点为例,说明如何使用 wpa_supplicant。这个热点的信息如下:编译部署

首先从 git 仓库中下载好对应的源码工程,然后导入 IDE 进行编译。编译完成后,直接 upload 将编译好的内容部署到 SylixOS 硬件中。

配置文件

wpa_supplicant 启动时是需要指定配置文件的。
通过配置文件,可以说明,如何去连接一个 AP 热点,以下是一个简单的配置文件 demo

country=CN

network={
    ssid="QInf_ACOINFO"
    psk="mima8ge8"
}

连接热点

有了配置文件之后,就可以启动 wpa_supplicant 去连接配置文件中的 AP 热点。
启动 wpa_supplicant 可以跟如下一些参数:

[root@sylixos:/root]# wpa_supplicant
Successfully initialized wpa_supplicant
wpa_supplicant v2.4
Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.

usage:
  wpa_supplicant [-BddhKLqqtvW] [-P<pid file>] [-g<global ctrl>] \
        [-G<group>] \
        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
        [-b<br_ifname>] [-e<entropy file>] \
        [-o<override driver>] [-O<override ctrl>] \
        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
        [-p<driver_param>] [-b<br_ifname>] [-I<config file>] ...]

drivers:
  wext = SylixOS wireless extensions (generic)
options:
  -b = optional bridge interface name
  -B = run daemon in the background
  -c = Configuration file
  -C = ctrl_interface parameter (only used if -c is not)
  -i = interface name
  -I = additional configuration file
  -d = increase debugging verbosity (-dd even more)
  -D = driver name (can be multiple drivers: nl80211,wext)
  -e = entropy file
  -g = global ctrl_interface
  -G = global ctrl_interface group
  -K = include keys (passwords, etc.) in debug output
  -t = include timestamp in debug messages
  -h = show this help text
  -L = show license (BSD)
  -o = override driver parameter for new interfaces
  -O = override ctrl_interface parameter for new interfaces
  -p = driver parameters
  -P = PID file
  -q = decrease debugging verbosity (-qq even less)
  -v = show version
  -W = wait for a control interface monitor before starting
  -N = start describing new interface
example:
  wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

其中 -D 表明 wpa_supplicant 使用哪个驱动程序, -i 后面跟对应的无线网卡,-c 跟对应的配置文件。因此上述用例,可以使用如下命令,进行启动:

wpa_supplicant -Dwext -iwlan0 -c/etc/wpa.conf

此后, wpa_supplicant 就会去自动连接 AP

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值