> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WiFi 和 Bluetooth

Qualcomm Dragonwing IQ-8275 EVK 通过 M.2 接口上的 **NFA765A** 模块(WCN6856 NSP288 芯片)提供集成的 Wi-Fi 和 Bluetooth 连接。

## 规格

### Wi-Fi

| 特性            | 规格                       |
| ------------- | ------------------------ |
| **标准**        | Wi-Fi 6E (802.11ax)      |
| **频段**        | 2.4 GHz、5 GHz、6 GHz(三频段) |
| **峰值 PHY 速率** | 2.9 Gbps(1K QAM)         |
| **工作模式**      | 双频段同时工作(DBS)、STA 和 AP 模式 |
| **驱动**        | ath11k                   |

### Bluetooth

| 特性         | 规格                                |
| ---------- | --------------------------------- |
| **标准**     | Bluetooth Core Specification v5.2 |
| **BLE 速率** | 最高 2 Mbps                         |
| **远距离模式**  | 500 Kbps 和 125 Kbps               |
| **协议栈**    | BlueZ                             |

## 硬件安装

<Steps>
  <Step title="安装 Wi-Fi 模块">
    以 30 度角将 NFA765A 模块插入 M.2 插槽,压平后用随附的螺丝固定。
  </Step>

  <Step title="连接天线">
    * **ANT0** — 支持 Wi-Fi 2.4 GHz、5 GHz 和 6 GHz;在 2.4 GHz 工作时与 Bluetooth 共享
    * **ANT1** — 支持 Wi-Fi 2.4 GHz、5 GHz 和 6 GHz
  </Step>

  <Step title="连接 UART 调试线缆">
    将 UART 线缆连接到调试端口,并记下分配的 COM 端口或 `/dev/ttyUSB` 设备。
  </Step>

  <Step title="连接电源并启动">
    上电并通过 UART 控制台观察启动过程。默认登录:`ubuntu` / `ubuntu`。
  </Step>
</Steps>

## 验证组件

### Wi-Fi

```bash theme={null}
lsmod | grep ath11k
iw dev
ls -la /lib/firmware/ath11k/
```

### Bluetooth

```bash theme={null}
sudo lsmod | grep bt
hciconfig
ls -la /lib/firmware/qca/
systemctl status bluetooth
```

## Wi-Fi 配置

### Station 模式

```bash theme={null}
nmcli dev wifi list
nmcli dev wifi connect <SSID> password <password>
nmcli general status
ifconfig wlp1s0
ping 8.8.8.8
```

### 设置 MAC 地址(可选)

<Warning>
  手动设置的 MAC 地址仅在下次重启前有效,之后将恢复为出厂 OTP 地址。
</Warning>

```bash theme={null}
ifconfig wlp1s0 down
ifconfig wlp1s0 hw ether XX:XX:XX:XX:XX:XX
ifconfig wlp1s0 up
```

### 热点模式

<Steps>
  <Step title="添加 SoftAP 接口">
    ```bash theme={null}
    iw dev wlp1s0 interface add wlp1s0 type managed
    ```
  </Step>

  <Step title="配置并启动 hostapd">
    ```bash theme={null}
    hostapd -B /etc/hostapd.conf
    ```
  </Step>

  <Step title="启动 DHCP 服务器">
    ```bash theme={null}
    brctl addbr br0
    brctl addif br0 wlp1s0
    ifconfig br0 192.168.225.1 netmask 255.255.255.0 up
    dnsmasq --conf-file=/etc/dnsmasq.conf \
      --dhcp-range=br0,192.168.225.20,192.168.225.60,255.255.255.0,43200
    ```
  </Step>
</Steps>

**停止热点:**

```bash theme={null}
killall hostapd
ifconfig wlp1s0 down
rm -rf /var/run/hostapd/wlp1s0
```

## Bluetooth 配置

### 设置 Bluetooth MAC 地址(可选)

<Warning>
  手动设置的 Bluetooth MAC 地址在重启后不会保留。
</Warning>

```bash theme={null}
hciconfig hci0 down
btmgmt public-addr 22:22:9B:2C:79:1E
hciconfig
```

### GAP 操作

```bash theme={null}
bluetoothctl
power on
scan on
pair F8:7D:76:9D:9B:6B
devices
discoverable on
power off
```

### 支持的 Bluetooth 配置文件

| 配置文件 | 角色                   | 版本   |
| ---- | -------------------- | ---- |
| GAP  | Central 和 Peripheral | —    |
| SPP  | Client 和 Server      | v1.2 |
| GATT | Central 和 Peripheral | —    |
| OPP  | Client 和 Server      | v1.2 |
| FTP  | Client 和 Server      | v1.2 |
| PBAP | Client 和 Server      | v1.1 |
| MAP  | Client 和 Server      | v1.2 |

<Note>
  WCN6750/WCN6856 支持 A2DP、AVRCP 和 HFP。
</Note>

## 调试

```bash theme={null}
# Wi-Fi
echo "module ath11k +p" > /sys/kernel/debug/dynamic_debug/control
dmesg > /tmp/dmesg.txt

# Bluetooth
echo "module bluetooth +p" > /sys/kernel/debug/dynamic_debug/control
echo "module btqca +p" > /sys/kernel/debug/dynamic_debug/control
dmesg > /tmp/bt_dmesg.txt
```

## 故障排除

<AccordionGroup>
  <Accordion title="找不到 wlp1s0 接口">
    ```bash theme={null}
    dmesg | grep ath11k
    ls /lib/firmware/ath11k/
    ```
  </Accordion>

  <Accordion title="无法连接到 AP">
    验证 SSID 和密码;检查 AP 安全设置。
  </Accordion>

  <Accordion title="Bluetooth 无法开启">
    ```bash theme={null}
    dmesg | grep -i bluetooth
    ls /lib/firmware/qca/
    ```
  </Accordion>

  <Accordion title="配对失败">
    确保两台设备确认相同的配对密钥;重试配对。
  </Accordion>

  <Accordion title="音频配置文件无法工作">
    A2DP 和 HFP 需要 WCN6750/WCN6856——请验证配置文件支持情况。
  </Accordion>
</AccordionGroup>

## 资源

* [Wi-Fi Alliance](https://www.wi-fi.org/certification)
* [Bluetooth SIG](https://www.bluetooth.com/specifications/)
* [Linux Wireless](https://wireless.wiki.kernel.org/)
* [ath11k](https://wireless.wiki.kernel.org/en/users/drivers/ath11k)
* [hostapd 文档](https://w1.fi/cgit/hostap/plain/hostapd/README)
