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

# WiFi 和蓝牙

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 速率** | 使用 1K QAM 时 2.9 Gbps    |
| **工作方式**      | 双频同时工作（DBS）、STA 和 AP 模式 |
| **驱动**        | ath11k                  |

### Bluetooth

| 特性         | 规格                  |
| ---------- | ------------------- |
| **标准**     | Bluetooth 核心规范 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  | 中心和外围   | —    |
| SPP  | 客户端和服务器 | v1.2 |
| GATT | 中心和外围   | —    |
| OPP  | 客户端和服务器 | v1.2 |
| FTP  | 客户端和服务器 | v1.2 |
| PBAP | 客户端和服务器 | v1.1 |
| MAP  | 客户端和服务器 | 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)
